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?   

Parents
  • Hi,

    I tried reproducing your error with v6.22a , and I see that the build fails with :

    It does however not fail with v5.64. 

    Another possible fix is discussed here.

    regards

    Jared 

  • Hi Jared,

    Thanks very much for your reply. I also tried with SES v5.70 and things are fine in this version too. 

    This (and related problems as described in the above link in your reply) seems to have arisen after the recent changes related to SES RTT since v6.20. 

    BTW, the fix in the link in your reply may not be exactly applicable to my specific situation (the UART example) since this project does not use the "SEGGER_RTT_Syscalls_SES.c" to begin with. So, there is nothing to remove (as suggested in the solution in that link). 

    Regards,

    Indranil.  

  • I see.

    As a temporary fix you can use an earlier version of SES. Alternatively you can try posting in the SES forum.

Reply Children
No Data
Related