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 !

  • 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