winIDEA SDK
test_run_until_address.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2# (c) TASKING Germany GmbH, 2023
3#
4# This Python example gets the address of the main() function and resets
5# the CPU before running it until the main() address.
6# Finally, it calls the test_runUntilAddress() function.
7
8import isystem.connect as ic
9
10
11winidea_id = ''
12
13
14def test_runUntilAddress():
15 connMgr = ic.ConnectionMgr()
16 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
17
18 execCtrl = ic.CExecutionController(connMgr)
19 addCtrl = ic.CAddressController(connMgr)
20
21 mainAddress = addCtrl.getFunctionAddress("main").getAddress()
22
23 execCtrl.reset()
24 print(f"Running CPU to address {hex(mainAddress)} (function 'main') with 1 sec timeout...")
25 execCtrl.runUntilAddress(0, mainAddress)
26
27
28if __name__ == "__main__":
29 test_runUntilAddress()