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

NRF_LOG_BACKEND_RTT_ENABLED isn't defined in some examples of the SDK

I'm using JLinkRTTViewer to view the outputs from the application and to enable the logging, I used the following configs in sdk_config.h:


set NRF_LOG_BACKEND_RTT_ENABLED to 1

set NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED to 0

But I see some examples (i.e template project) in the SDK that don't have macro NRF_LOG_BACKEND_RTT_ENABLED defined, and even copying the exact content of sdk_config.h from a functional example (where printing worked) didn't do the trick either. What am I missing? How can I get it to work? Why is sdk_config.h different for certain examples? 

Parents
  • Hi,

    Most example projects use UART logging, and most of them again also include the requirements for RTT logging. That does not apply to all though. And in that case, you need to add include paths, include files and sdk_config.h macros yourself. The easiest way to do this is to refer to an example project that use RTT logging, and do the same as is done there. You will probably miss one or two things, but then you should get a indication on what is missing from the error message when you try to build so that you can correct and try to build again. This is a bit tedious, but unfortunately that is the way it is.

Reply
  • Hi,

    Most example projects use UART logging, and most of them again also include the requirements for RTT logging. That does not apply to all though. And in that case, you need to add include paths, include files and sdk_config.h macros yourself. The easiest way to do this is to refer to an example project that use RTT logging, and do the same as is done there. You will probably miss one or two things, but then you should get a indication on what is missing from the error message when you try to build so that you can correct and try to build again. This is a bit tedious, but unfortunately that is the way it is.

Children
Related