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

NRF_LOG_INFO print RTT Viewer is too slow

HI. i use SEGGER Studio and SDK 15.3.0.

I usally use printf func for debug. however as use SDK func, I need to use NRF_LOG_INFO casue SDK file use NRF_LOG_INFO for debuing.

and I search how enable and it work. but the speed of print is slow. 

i compare printf vs nrf_log_info using 

for(; ;) { printf("A\n")} and for(; ;) { NRF_LOG_INFO("A\n")}

nrf_log_info also print log, but not enough speed to check real-time.

i try to change buffer size or deferred option. it is no change.

help me what problem 

Thank you.

add) i test SDK 15.2.0 it work very well. not slow 

Parents
  • Hi,

    • Can you post the configs you are using for NRF_LOG?
    • Do you have multiple backends enabled? 
    • Do you print to RTT Terminal using printf also, or did you use this to print to UART?
    • Are you sure that the configs are identical for SDK 15.2.0 and SDK 15.3.0? I do not think that there should be any major changes in the logger module.

    NRF_LOG_info is written using macros, so it should be faster than printf, which use variable argument list (__VA_ARGS__).

    Best regards,
    Jørgen

  • If you have bot UART and RTT backends enabled, this will be much slower than if you call the SEGGER_RTT functions directly. UART backend will transfer logs over UART peripheral, which by default runs at 115200 baudrate. RTT send logs over the debugger, which is typically running at 1-4 MHz. See Performance in the logger documentation for details about what you could expect with only RTT enabled and deferred vs. non-deferred.

    Ideally, you should use deferred mode and process the logs when the chip is idle, unless you have timing-critical logs, then you can process the logs immediately by calling NRF_LOG_PROCESS/NRF_LOG_FLUSH.

Reply
  • If you have bot UART and RTT backends enabled, this will be much slower than if you call the SEGGER_RTT functions directly. UART backend will transfer logs over UART peripheral, which by default runs at 115200 baudrate. RTT send logs over the debugger, which is typically running at 1-4 MHz. See Performance in the logger documentation for details about what you could expect with only RTT enabled and deferred vs. non-deferred.

    Ideally, you should use deferred mode and process the logs when the chip is idle, unless you have timing-critical logs, then you can process the logs immediately by calling NRF_LOG_PROCESS/NRF_LOG_FLUSH.

Children
Related