winIDEA SDK
test_storage_emmc_read.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import os
6
7import isystem.connect as ic
8
9
10winidea_id = ''
11
12
13def test_read():
14 connMgr = ic.ConnectionMgr()
15 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
16
17 devName = "eMMCtest"
18 partitionName = "Boot1"
19 readBytes = 8
20 startAddress = 0x0
21 storageCtrl = ic.CStorageDeviceFactory.makeDevice(connMgr, ic.EStorageDevice_EMMCDevice, devName, partitionName)
22
23 print(f"Reading 7 bytes at address 0x10 from {partitionName} partition...")
24 rData = ic.VectorBYTE(readBytes)
25 storageCtrl.read(startAddress, readBytes, rData)
26 for index in range(readBytes-1):
27 print(f"\tData {index}: {rData[index]}")
28
29 ic.CStorageDeviceFactory.terminateDevice(connMgr, ic.EStorageDevice_EMMCDevice, devName)
30
31
32if __name__ == "__main__":
33 test_read()