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

NRF52 DK RTT printf Problem

Hi,

I recently purchased the NRF52 DK. I'm using the ble_uart_example for the SDK 11. I'm using the softdevice PCA10040.

I noticed the the SDK 11 includes the RTT c and h files there, so I don't need to worry about using the tutorial.

I want to test out the SEGGER_rtt_printf, but when I compile and link the project, it gave me an error saying.

"._build\nrf52832_xxaa_s132.axf: Error: L6218E: Undefined symbol SEGGER_RTT_printf (referred from main.o)."

So I defined it as #define SEGGER_RTT_printf, it compiles but it gives me 3 warnings that about expressions that have no effect. That one couldn't print anything on jlink rtt.

I read the documentation for the sdk11, but it didn't give me much help. I currently have the nrf51dk kit and it didn't have this error. And it worked fine.

What am I missing here?

Thanks

Update:

image description

image description

Parents
  • I think this is a bug in the SDK. I don't see why Nordic has chosen to add "#ifdef NRF_LOG_USES_RTT" to SEGGER's source file. Whatever the compiler generates, the linker should omit if it is not referenced. If you download from SEGGER (as answered above), the file does not have that #ifdef. Then assuming I am wrong and there is a need for that, shouldn't Nordic have also added #include "sdk_config.h", which is where "#define NRF_LOG_USES_RTT 1" should be defined, by Nordics own convention? In other words, adding -DNRF_LOG_USES_RTT=1 works, but is not the documented way of configuring.

  • That is in the form of a command line argument to the compiler, add it to your Makefile. It must be defined when the NRF log files (from the SDK) are compiled, because that is where it is referenced. Just speaking in general, I don't know the specifics.

Reply Children
No Data
Related