Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UART example in nRF5 SDK v17.0.2 not working as expected when built using Segger Embedded Studio for ARM v6.22.

Summary: Not able to see messages from printf() statements in the code on the serial monitor. 

I'm new to Nordic platform and to Segger Embedded Studio. 

I have a Nordic nRF52840 DK. I tried building the UART (<installation_dir>\examples\peripheral\uart) example from nRF5 SDK v17.0.2 using Segger Embedded Studio V6.22a. However, it failed, showing an error such as:

"C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 6.22a/lib/libc_v7em_fpv4_sp_d16_hard_t_le_eabi_balanced.a(fileops.o): in function `putchar':"

To fix this build failure issue, which seems to have originated due to the printf() statements in the code and using the latest SES, I changed the value of "Library I/O" (under Project options >> Code >> Library) from "None" to "RTT" and was able to build the project. 

After flashing to the device, and connecting a serial monitor as described in https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.0.2%2Flib_nrf_log.html, I was expecting to see outputs like "UART example started." and "Exit!" (after pressing 'q'). However, I do not see the expected messages (from the printf() statements) on the serial monitor. I think the reason I don't see the outputs is because I changed the value of "Library I/O" from "None" to "RTT". In fact, if I execute the code in debug mode, I do see both the messages in the Debug Terminal. More precisely, I can see the message "UART example started" on the Debug Terminal after flushing the code to the device, and see "Exit!" after sending "q" via the serial monitor. So, in a sense, the UART communication is working. 

What is the appropriate project settings such that I do not get the build error (as described above) and be able to see the printf() messages via the serial port?   

Related