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

NRF_LOG not working on Segger Embedded Studio

Greetings,

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

My setup:

OS: Windows 10

Board: NRF52-DK

SDK: 15.3.0

Example: peripheral\bsp

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_BACKEND_RTT_ENABLE 1
NRF_LOG_BACKEND_RTT_ENABLE 0
NRF_LOG_ENABLE 1
NRF_LOG_DEFFERED 1
NRF_LOG_DEFAULT_LEVEL 3 //AKA Info

4) Tried to build clean, build Debug, build Release

5)  On main:

Initializing NRF_LOG:

APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
NRF_LOG_DEFAULT_BACKENDS_INIT();

On main loop:

NRF_LOG_INFO("BSP example started.");
NRF_LOG_FLUSH();

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?

Parents
  • I'm using a PC with Linux OS (Ubuntu 18.04).

    I've just installed SES Release 4.52c Build 2020051500.42136 (Linux x64).

    I decided to use nRF5 SDK v16.0.0 and s113 (using nRF52811 chipset).

    My very first example opened was "ble_app_uart_pca10040e..."

    Using another document for guidance, I was able to configure, build, upload and initiate a debug session without issue.

    However, I could not see the NRF_LOG_INFO output in the SES output terminal.

    I searched online on the Segger Forum for any similar incidents.

    This is the first one I found which looked similar: https://forum.segger.com/index.php/Thread/6589-SOLVED-No-RTT-Output-in-Debug-Terminal-on-MacOS/

    Within this feed was a link to this Nordic Forum post, claiming that there was a solution.

    I tried the suggested solution but it did not work ( NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0 )

    Scrolling through the comments, it appears that this is an ongoing intermittent issue and that the solution is not 100% successful.

    Considering that this issue was first raised on this forum over 1 year ago, is there any official solution to this problem.

    As a complete novice to both SES and Nordic SDK's (on my very first example), the most likely scenario in my case is that I need to change some other default settings - maybe a reboot of SES is required, by way of example. Who knows.

    Please could someone advise.

    Thanks.

Reply
  • I'm using a PC with Linux OS (Ubuntu 18.04).

    I've just installed SES Release 4.52c Build 2020051500.42136 (Linux x64).

    I decided to use nRF5 SDK v16.0.0 and s113 (using nRF52811 chipset).

    My very first example opened was "ble_app_uart_pca10040e..."

    Using another document for guidance, I was able to configure, build, upload and initiate a debug session without issue.

    However, I could not see the NRF_LOG_INFO output in the SES output terminal.

    I searched online on the Segger Forum for any similar incidents.

    This is the first one I found which looked similar: https://forum.segger.com/index.php/Thread/6589-SOLVED-No-RTT-Output-in-Debug-Terminal-on-MacOS/

    Within this feed was a link to this Nordic Forum post, claiming that there was a solution.

    I tried the suggested solution but it did not work ( NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0 )

    Scrolling through the comments, it appears that this is an ongoing intermittent issue and that the solution is not 100% successful.

    Considering that this issue was first raised on this forum over 1 year ago, is there any official solution to this problem.

    As a complete novice to both SES and Nordic SDK's (on my very first example), the most likely scenario in my case is that I need to change some other default settings - maybe a reboot of SES is required, by way of example. Who knows.

    Please could someone advise.

    Thanks.

Children
  • Following some beginner trial and error, I discovered that the solution (i.e. setting NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED to 0) does in fact work, but I needed to always manually connect the j-link target before going into a debug session... I think that was suggested by someone else on this post too.

    EDIT. As a novice, I also noticed that there is some "buffering" or equivalent going on as the output is not always immediate. As in, if stepping into or out of code manually in debugging mode it does not always produce an immediate output response (both on UART and Debug). So, it looks as if something is not working but when in run mode you do see the output.

Related