Other Parts Discussed in Thread: UNIFLASH,
Here are the steps I recommend to follow to debug the basic_persistent app c (similar steps can be applied for basic_ble_oad_on_chip, basic_ble_oad_off_chip, etc.).
I- Build the image, flash the device and connect the debugger
- Build the basic_persistent app
- Click the Debug button – This leads the debugger to erase the device’s flash then download the newly built image
- This is going to lead to a JTAG Communication Error: (Error -615 @ 0x0). This is due to MCUBoot image not being programmed leading the code at address 0x0 to be invalid
- In the “Debug” window, right click on “Texas Instruments XDS110 USB Debug Probe” then “Connect Target”
II- Enable the “Memory Browser” and “Registers” views
- Click “View”
- Then select “Memory Browser”
- Click again “View” and select “Registers”
III- Force the device to execute the image you want to debug
- In the memory browser, find the entry point of the image. You can leverage the map file (see the green square) if you are not sure of the address.
In all the cases, you should find the resetVectors symbol at the entry point of the image.
For the basic_ble_persistent app, the entry point is at 0x6100
- In the “Registers” view, update the value of the Core Registers > SP register with the first value of the resetVectors (0x20009000 in my case)
- In the “Registers” view, update the value of the Core Registers > PC register with the second value of the resetVectors (0x2C66D in my case)
- In the “Registers” view, update the value of the SCB > VTOR register with the address of the resetVectors (which is also the entry point of the app, i.e. 0x6100 in my case)
- Setup a breakpoint in the basic_persistent application (e.g. on the call to BLEAppUtil_init() in the function appMain in app_main.c) and click the “Run button”
Note: The steps provided here only leads to flash one app (which is the recommended approach for app debugging). In case multiple apps have to be flashed at the same time, Uniflash should be used. Then the step to connect the Debugger to a Running Target described in the Debugger Guide should be followed. And, eventually, the steps in II- and III- should be applied.
- Make sure to review the SImpleLink Connect mobile app (see https://www.ti.com/tool/SIMPLELINK-CONNECT-SW-MOBILE-APP).
- A CC2340R5 flashed with the host_test example and BTool can be used as OAD distributor
I hope this will help!