winIDEA SDK
Loading...
Searching...
No Matches
test_secure_unsecure_check.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_secureUnsecureCheck():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
umiCtrl = ic.CUMIController(connMgr)
devIndex = umiCtrl.getDeviceIndex("Infineon TC39x_PFLASH_16MB")
# print(f"Securing 16 bytes from range 0x80000000 of a device with index: {devIndex}")
# umiCtrl.secure(devIndex, 0x80000000, 16)
# print(f"\tIs secured: {umiCtrl.secureCheck(devIndex, 0x80000000, 16)}")
print(f"Securing entire device with index: {devIndex}")
umiCtrl.secure(devIndex)
print(f"\tIs secured: {umiCtrl.secureCheck(devIndex)}")
print(f"Un-securing 16 bytes from range 0x80000000 of a device with index: {devIndex}")
umiCtrl.unsecure(devIndex, 0x80000000, 16)
print(f"Un-securing entire device with index: {devIndex}")
umiCtrl.unsecure(devIndex)
if __name__ == "__main__":
test_secureUnsecureCheck()