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 !

  • Hi,

    You cannot debug using Segger Embedded Studio (SES) and use the RTT Viewer at the same time. SES an integrated RTT viewer, and you cannot use two RTT viewers simultaneously.

    Most SDK examples have UART logging enabled by default. The only thing you need to do to get RTT logging working is to set NRF_LOG_BACKEND_RTT_ENABLED to 1 in the projects sdk_config.h file. However, a few examples use the CLI interface instead of normal logging. This is the case for the TWIS Slave and TWI Master Mode Drivers Examples that you are using. I recommend you use a different example if you want an example without CLI, for example the TWI sensor example.

  • Hello,

    Thanks for your answer.

    There must be some major misunderstandings somewhere:

    According to: 

    nRF5 Getting Started > Software development Getting Started Guides > nRF5 Series: Developing with SEGGER Embedded Studio > Communicating with the board > Connecting via RTT

    Segger can indeed use JLinkRTTViewer.exe for logging:  The docs even claims it will start it automatically!

    An this Video:   https://www.youtube.com/watch?v=uP8RYgYGRvI at 03:48 

    Shows using RTT to Log to Segger Embedded Studio Debug Terminal:

    I do not need both to work, I will be satisfied using Segger Embedded Studio Debug Terminal, but it does not work.

    Regarding the code I am using: That's what my project will be based on, so it makes no sense to base my code on something else....

    See my Post here:

    https://devzone.nordicsemi.com/f/nordic-q-a/38306/confusing-docs-on-using-rtt-viwer-debug-terminal-with-segger

  • 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.

Related