5import isystem.connect
as ic
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
15 ideCtrl = ic.CIDEController(connMgr)
16 devName =
"ST STM32F4xxxG_1024KB"
19 optCtrl = ic.COptionController(connMgr,
"/iOPEN/Data.UMI.Devices.Devices")
20 devIndex = optCtrl.index_of(
"Name",devName)
21 print(
"Index of the item whose 'Name' attribute has value " + devName + f
": {devIndex}")
23 storageCtrl = ic.CStorageDeviceFactory.makeDevice(connMgr, ic.EStorageDevice_EmbeddedFlashDevice, devIndex)
25 print(f
"Erasing entire device with index {devIndex}...")
26 storageCtrl.erase(ic.IConnectUMI.wProgDevice)
28 print(f
"Erasing first {int(eraseSize)} bytes of a device with index {devIndex}...")
29 addUrl = f
"/iOPEN/Data.UMI.Devices.Devices[{devIndex}].DeviceAddress"
30 add = ideCtrl.getOptionInt(addUrl)
31 storageCtrl.erase(ic.IConnectUMI.wProgDevice, add, int(eraseSize))
34if __name__ ==
"__main__":