winIDEA SDK
Loading...
Searching...
No Matches
test_storage_emmc_read.py
# This script is licensed under BSD License, see file LICENSE.txt, or search for `License` in the SDK online help.
#
# (c) TASKING Germany GmbH, 2023
import os
import isystem.connect as ic
winidea_id = ''
def test_read():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
devName = "eMMCtest"
partitionName = "Boot1"
readBytes = 8
startAddress = 0x0
storageCtrl = ic.CStorageDeviceFactory.makeDevice(connMgr, ic.EStorageDevice_EMMCDevice, devName, partitionName)
print(f"Reading 7 bytes at address 0x10 from {partitionName} partition...")
rData = ic.VectorBYTE(readBytes)
storageCtrl.read(startAddress, readBytes, rData)
for index in range(readBytes-1):
print(f"\tData {index}: {rData[index]}")
ic.CStorageDeviceFactory.terminateDevice(connMgr, ic.EStorageDevice_EMMCDevice, devName)
if __name__ == "__main__":
test_read()