This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Trace support for nRF52832

Hi,

We are using our own custom nRF52832 based board, with revision B silicon however we are having trouble getting trace functionality to work.

Our code uses the Nordic nRF5_SDK_11.0.0.2alpha, we do not use a soft device, in IAR v7.50.2 with an I-Jet trace.

The pre-processor symbol ENABLE_TRACE has been defined, however when starting a debug session IAR reports that the trace pins are stuck at 0 or 1

"Thu Mar 03, 2016 10:53:10: Warning: trace calibration [4-bit,tclk=16.09MHz,auto]: FAILED, TraceD0 stuck at 0, D1 stuck at 0, D2 stuck at 0, D3 stuck at 0 - check ETM and GPIO settings "

The trace pins are not used for anything else on the board and are not configured anywhere else in the code - do we need to perform any other configuration besides defining ENABLE_TRACE?

Parents
  • Hi,

    I had some trouble with this as well, but think I got it to work by creating a startup script for the debugger (IAR calls it macros). This sets the enable register before execution starts as opposed to doing it in system_nrf52.c.

    Steps to enable ETM trace:

    • Open an IAR project from the SDK and make sure that there are no conflict between GPIO used for LEDs and the ETM trace pins.
    • Enter project options -> Debugger and tick "Use macro file" and and download and browse this one: etm_iar.mac
    • Start a new debug session and select J-link in the menu bar and click on ETM trace to enable.

    Screen dump when debugging the timer example with LEDs disabled. Download the image if you want to see the details more clearly since the text editor scales it down.

    image description

    I will report this internally to get a clarification on whether it would be better to provide debug macros for ETM trace or keep using the system_nrf52.c (maybe I missed something).

Reply
  • Hi,

    I had some trouble with this as well, but think I got it to work by creating a startup script for the debugger (IAR calls it macros). This sets the enable register before execution starts as opposed to doing it in system_nrf52.c.

    Steps to enable ETM trace:

    • Open an IAR project from the SDK and make sure that there are no conflict between GPIO used for LEDs and the ETM trace pins.
    • Enter project options -> Debugger and tick "Use macro file" and and download and browse this one: etm_iar.mac
    • Start a new debug session and select J-link in the menu bar and click on ETM trace to enable.

    Screen dump when debugging the timer example with LEDs disabled. Download the image if you want to see the details more clearly since the text editor scales it down.

    image description

    I will report this internally to get a clarification on whether it would be better to provide debug macros for ETM trace or keep using the system_nrf52.c (maybe I missed something).

Children
Related