Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

No Log output to J-Link RTT Viewer

Hello,

I have read through all the posts I can find on this subject, but none has solved my problem.

- nRF5_SDK_15.1.0

- Example: Segger Embedded Studio Project: twi_master_with_twis_slave_pca10040  Using Segger Embedded Studio

- Connected to nrf52 Dev Kit (bought new a week ago)

Configured sdk_config.h according to other posts:

NRF_LOG_BACKEND_RTT_ENABLED    - YES

NRF_LOG_BACKEND_UARD_ENABLED - NO

NRF_LOG_ENABLED - YES

Tried enabling / disabling NRF:LOG_DEFERRED  - with no effect

Tried enabling / disabling NRF:LOG_FILTERS_ENABLED  - with no effect

Starting J-Link RTT Viewer found in the Segger Installation folder using:

RTT Viewer starts with the following message in the Log Window:

Starting Debugging by Pressing F5 in Segger. 

The first Log output it encounters is the following line in Main()

NRF_LOG_RAW_INFO(
"TWIS and TWI usage example started.\r\n"
"You can access simulated EEPROM memory using <eeprom> command.\r\n"
"Execute: <eeprom -h> for more information or press the Tab button "
"to see all available commands.\r\n"
);

Nothing shows in the All Terminals or Terminal 0 window.

I also added  NRF_LOG_FLUSH(); after the statement above - with no effect.

Please help !

Parents Reply Children
  • I see that I probably Misunderstood the docs i referred to above: Segger will not start RTTViewer, but the Debug Termoinal..

    So how do I get Segger's Debug Terminal to show logged data?

    Can I make the example user "Normal" Debugging?

    Can I get my own printf() of similar to show up in Segger Debug Terminal?

    By the way, What is CLI ?

    Sorry if I mess up a bit, but I have been trying to solve this for two days, and I wearing out...

  • Hi,

    What I wanted to to stress in my previous answer is that you can only use JLinkRTTViewer.exe or the built in Debug Terminal in SES, not both simultaneously. This was my main theory for you not seeing the logs, as it should work out of the box in most SDK examples provided you set NRF_LOG_BACKEND_RTT_ENABLED to 1 in your projects sdk_config.h file. You should also double check that NRF_LOG_ENABLED is set to 1, which it should be by default. The only other typical reason I can think of for logging to fail is if the example use deferred logging, and there is an error before the log can be processed. I recommend you refer to the Logger module documentation for a better understanding of how it works and is configured.

    If it still does not work, can you e.g. try to use the unmodified Heart Rate Application example in the SDK (<SDK 15>\examples\ble_peripheral\ble_app_hrs\pca10040\s132\ses\ble_app_hrs_pca10040_s132.emProject)? You just have to enable RTT logging by setting the NRF_LOG_BACKEND_RTT_ENABLED in <SDK 15>\examples\ble_peripheral\ble_app_hrs\pca10040\s132\config\sdk_config.h and run the project. You should get the debug printouts in SES. Alternatively, if you don't debug in SES, use JLinkRTTViewer.exe.

  • gos said:
    So how do I get Segger's Debug Terminal to show logged data?

    In the examples, simply enable RTT logging as we have discussed and as described in the Logger module documentation.

    gos said:
    Can I get my own printf() of similar to show up in Segger Debug Terminal?

     You would have to retarget printf to use RTT og the logger module. I do not see any benefit with this, and I suggest using the logger macros instead. That would give you all the benefits of the logger system, and the string formatting is identical with printf.

    gos said:
    By the way, What is CLI

     Command line interface. It interferes with logging, and is not useful in a practical application. I suggest you steer well clear of CLI, particularly if you want to get logging working.

  • Thanks Einar.

    I got it sorted: I used the TWI Sensor as my base, and then RTT works with Segger natively for both Logging and printf() statements. 

    I got my TWI (I2C) working with my sensor, but I am now fighting with Current Conspumption in __WFI ~500 uA. WIll post about this problem in another thread...

Related