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 STM32C0x6 (32 kB)"
17 optCtrl = ic.COptionController(connMgr, ic.CStorageDeviceFactory.DEVICES_OPT_URL)
18 devIndex = optCtrl.index_of(
"Name",devName)
19 print(
"Index of the item whose 'Name' attribute has value " + devName + f
": {devIndex}")
21 storageCtrl = ic.CStorageDeviceFactory.makeDevice(connMgr, ic.EStorageDevice_EmbeddedFlashDevice, devIndex)
23 print(f
"Enabling 'allow erase' for device: {devIndex}")
24 url = f
"/iOPEN/Data.UMI.Devices.Devices[{devIndex}].AllowErase"
25 ideCtrl.setOption(url,
"True")
27 print(f
"Erasing device with index: {devIndex}")
28 storageCtrl.erase(ic.IConnectUMI.wProgDevice)
30 print(f
"Performing device fill with a default value...")
33 print(f
"Disabling 'allow erase' for device: {devIndex}")
34 ideCtrl.setOption(url,
"False")
37if __name__ ==
"__main__":