winIDEA SDK
Loading...
Searching...
No Matches
test_storage_emmc_erase.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 isystem.connect as ic
winidea_id = ''
def test_erase():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
devName = "eMMCtest"
partitionName = "Boot1"
startAddress = 0x0
eraseSize = 0x400
storageCtrl = ic.CStorageDeviceFactory.makeDevice(connMgr, ic.EStorageDevice_EMMCDevice, devName, partitionName)
storageCtrl.erase(ic.IConnectUMI.wProgDevice)
print(f"Erasing entire partition with name {partitionName}...")
storageCtrl.erase(ic.IConnectUMI.wProgDevice,startAddress,int(eraseSize))
print(f"Erasing {int(eraseSize)} bytes with offset {startAddress} of partition with name {partitionName}...")
ic.CStorageDeviceFactory.terminateDevice(connMgr, ic.EStorageDevice_EMMCDevice, devName)
if __name__ == "__main__":
test_erase()