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 Reply
  • Hi,

    One thing I did not think to ask about before is if you are using deferred logging or not? If yes, then you need to process the log in y our main loop. If not, you need to set NRF_LOG_DEFERRED to 0 in sdk_config.h.

    Another point is that as you have seen adding a lot of dependencies to an example project is a bit tedious, so it is often better to choose an example project that has most of what you need to begin with, and then adapt that, instead of taking a minimal project.

    In any case I have slightly modified the peripheral template sample application and added logging so that you can see it as a reference here: template_project_with_rtt.zip.

Children
No Data
Related