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

Logging SDK15 Segger RTT

While I'm waiting on answers to other questions, I thought I would try to nrf_Logging with the Segger RTT up and running. It sounds like a pretty tool.

I have created a very simple UART program and included calls to the NRF_LOG_INFO routines just to watch some of the activity.

I've modified SDK_config.h to enable logging and to use RTT on the backend. UART logging is disabled.

I've placed an NRF_LOG_INIT(NULL) call near the beginning of my main along with an NRF_BACKEND_INIT(). And then I've sprinkled some generic, simple nfr_log_info calls around. Everything compiles great and the program does what I want.

If I attach a Segger JTAG unit (actually it's part of a 52DK unit) and then I launch the Jlink Viewer. I can see that the Jlink connects and that there are two Terminal visible, but there is NONE of the info fro the nRF52 device program being displayed  in the viewer.

If I set-up the code in debug mode and watch the SES debug window, I also see nothing.

The logging code and files were copied from a ble_bootloader example almost with no change.

Why don't I see any output?

I've either done something wrong or have missed something in the process.

Any help would be grand.

Thanks,

Wayne

Parents
  • Hi,

    It should be enough to call NRF_LOG_INIT(NULL) and NRF_LOG_DEFAULT_BACKENDS_INIT() (I assume NRF_BACKEND_INIT() which you wrote was a typo).

    The typical reasons for not seeing RTT output are:

    1. Incorrectly configured sdk_config.h, or
    2. Deferred logging enabled in sdk_config.h but not handled in the application main loop (no calls to NRF_LOG_PROCESS()).
  • I did have DEFERRED_LOGGING enabled. I added the NRF_LOG_PROCESS() in my main loop, but I still don't see anything with RTTViewer.  However, if I launch (SEGGER) GDB_server and then RTTClient, I see some logs in the Client window. (My understanding was that RTTViewer is a stand-alone program that does not the GDB-server running)

    I must still have some config error that is hiding the logs from RTTViewer.

Reply
  • I did have DEFERRED_LOGGING enabled. I added the NRF_LOG_PROCESS() in my main loop, but I still don't see anything with RTTViewer.  However, if I launch (SEGGER) GDB_server and then RTTClient, I see some logs in the Client window. (My understanding was that RTTViewer is a stand-alone program that does not the GDB-server running)

    I must still have some config error that is hiding the logs from RTTViewer.

Children
Related