7import isystem.connect
as ic
14 connMgr = ic.ConnectionMgr()
15 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
18 partitionName =
"Boot1"
20 storageCtrl = ic.CStorageDeviceFactory.makeDevice(connMgr, ic.EStorageDevice_EMMCDevice, devName, partitionName)
22 print(f
"Writing 8 bytes to partition {partitionName}...")
23 wData = ic.VectorBYTE(32)
25 for index
in range(32):
27 storageCtrl.write(ic.IConnectUMI.wProgDevice, 0x0, 8, wData)
29 ic.CStorageDeviceFactory.terminateDevice(connMgr, ic.EStorageDevice_EMMCDevice, devName)
33 filePath = os.path.join(os.getcwd(),
"data.bin")
34 print(f
"Alternatively, write data from file: {filePath}")
36 with open(filePath,
"w+b")
as fHandler:
37 fHandler.write(bytes(
"0123456789876543210",
"utf-8"))
38 storageCtrl.write(ic.IConnectUMI.wProgDevice, ic.IConnectUMI.wFileFormatAuto, 0x0, filePath)
42 ic.CStorageDeviceFactory.terminateDevice(connMgr, ic.EStorageDevice_EMMCDevice, devName)
45if __name__ ==
"__main__":