winIDEA SDK
Loading...
Searching...
No Matches
test_storage_verify.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_verify():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
devName = "ST STM32F4xxxG_1024KB"
optCtrl = ic.COptionController(connMgr, ic.CStorageDeviceFactory.DEVICES_OPT_URL)
devIndex = optCtrl.index_of("Name", devName)
print("Index of the item whose 'Name' attribute has value " + devName + f": {devIndex}")
storageCtrl = ic.CStorageDeviceFactory.makeDevice(connMgr, ic.EStorageDevice_EmbeddedFlashDevice, devIndex)
sess_ctrl = ic.CSessionCtrl(connMgr)
sess_ctrl.begin_program()
print("Next call will raise exception if memory contents do not match real values")
storageCtrl.verify()
print("\tVerification passed.")
print("Verify only 16 bytes from address 0x08000000 to current cache values...")
storageCtrl.verify(0x08000000, 16)
if __name__ == "__main__":
test_verify()