I'm having some trouble displaying logs to the SES Debug Terminal... Basically, I can see the logs with RTTviewer but not in SES Debug Terminal. However printf works just fine on the SES Debug Terminal
OS: Windows 10
IDE: Segger Embedded Studio 4.16
After reading lots of posts and documentation that's what I've done so far:
1) tried many other examples and got the same problem
2) NO, I'm not using RTTviewer and SES Debug Terminal at the same time
3) On SDK_Config.h made sure that settings are:
NRF_LOG_DEFAULT_LEVEL 3 //AKA Info
4) Tried to build clean, build Debug, build Release
5) On main:
On main loop:
NRF_LOG_INFO("BSP example started.");
6) If instead of NRF_LOG_INFO I use printf the SES Debug Terminal prints my message just fine
7) If I open the SES J-Link Control Panel Window while debugging, I can see the message on the RTT tab, but still not in Debug Terminal:
8) Verified Project Debug Settings:
9) Tried changing NRF_LOG_FLUSH() to NRF_LOG_PROCESS() . No difference...
10) I also notice that something is been send to the Debug Terminal because the cursor moves to a new line every time a new NRF_LOG should be displayed.
Any ideas of what I am doing wrong?
There is an issue in the SDK, which adds \r\r\n instead of \r\n to the output message.postfix_process() wants to add \r\n, but nrf_printf() also explicitly adds \r before \n without checking if it…
Line 7543 in sdk_config.h
// <q> NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED - For each printed LF, function will add CR.
#ifndef NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED#define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED…
I can confirm that I'm seeing the same as you, although I'm not quite sure why yet.
However, if you take a look at the nRF5 SDK v.15.3.0 release notes you can see that the version of SES supported…
However, if you take a look at the nRF5 SDK v.15.3.0 release notes you can see that the version of SES supported by this version of the SDK, is SES v.4.12.
If you downgrade to the previous version of SES, you should be able to see the output in the Debug Terminal.
Best regards, Joakim Jakobsen.
There is an issue in the SDK, which adds \r\r\n instead of \r\n to the output message.postfix_process() wants to add \r\n, but nrf_printf() also explicitly adds \r before \n without checking if it is already present.
In ES (V4.16) this clears the current line and does a line break.
You can work around this by adding #define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0 to your sdk_config.h
this fixed the issue for me, thank you!
I just struggle with this for a while..
This flag is already defined as NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED so trying to redefine NRF_PRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED wasn't working.
Anyway. got the RTT terminal working now. Just had to change the existing sdk_config flag line.
Thanks for the input on this Johannes!