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

Step-by-step guide to printf on NRF51

Hi,

I can't seem to get printf working on the ble_app_cts_c example. I can't seem to find a definitive step-by-step guide as to how to get this working. Any help would be much appreciated.

Some more info:

I am using the main.c and retarget.c from Martin's post here: devzone.nordicsemi.com/.../

I then Build and Load it onto the nRF51 dk. I then click Debug -> Start Debugging. Then I open the Debug (printf) Viewer and run the program.

Nothing appears in the box. I am using Kiel v5.16.

Thanks,

EDIT:

Termite is communicating but receiving these values

Termite is communicating but receiving these values

Parents
  • It seems the Debug Viewer uses ITM:

    The Debug (printf) Viewer is a special serial window that can exchange data with the microcontoller. For Cortex-M microcontrollers, the window displays printf-data received from the Instrumentation Trace Macrocell (ITM). With some special target code (see CMSIS) data can be sent to a Cortex-M microcontroller.

    The CPU in nRF51 doesn't include an ITM, the CPU in nRF52 has it, but I haven't tested this functionality myself.

    You can send your printf-data through the virual com port provided by the Segger chip, and see it in a terminal on your computer.

    This tutorial should be helpful to you.

Reply
  • It seems the Debug Viewer uses ITM:

    The Debug (printf) Viewer is a special serial window that can exchange data with the microcontoller. For Cortex-M microcontrollers, the window displays printf-data received from the Instrumentation Trace Macrocell (ITM). With some special target code (see CMSIS) data can be sent to a Cortex-M microcontroller.

    The CPU in nRF51 doesn't include an ITM, the CPU in nRF52 has it, but I haven't tested this functionality myself.

    You can send your printf-data through the virual com port provided by the Segger chip, and see it in a terminal on your computer.

    This tutorial should be helpful to you.

Children
Related