This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] CC2340R5: Tips to debug OAD software

Part Number: CC2340R5
Other Parts Discussed in Thread: UNIFLASH,

Hi,

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

  1. Build the basic_persistent app
  2. Click the Debug button – This leads the debugger to erase the device’s flash then download the newly built image
  3. 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
  4. In the “Debug” window, right click on “Texas Instruments XDS110 USB Debug Probe” then “Connect Target”

 

II- Enable the “Memory Browser” and “Registers” views

  1. Click “View”
  2. Then select “Memory Browser”
  3. Click again “View” and select “Registers”

 

III- Force the device to execute the image you want to debug

  1. 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
  2. In the “Registers” view, update the value of the Core Registers > SP register with the first value of the resetVectors (0x20009000 in my case)
  3. In the “Registers” view, update the value of the Core Registers > PC register with the second value of the resetVectors (0x2C66D in my case)
  4. 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)
  5. 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.

Additional suggestions:

- 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!