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.

  • Thank you your reply.

    First now I test ANT+ Communication using S332. I forgot telling you what I did.

    I changed log option UART disabled and only RTT enable. but result is not change.

    I download totally new SDK 15.2.0 and 15.3.0 on nordic ofiicial website. I used ant+ ant_bsc example.

    first i did not chagne any option on sdk_config.h. on sdk_config.h log RTT is disable and uart is enable.

    on this state, i build on 52832 PCA10040 1.2.1, nrf_log_info is not working. and when i enable log rtt, log_info is working regardless log_uart enable or not.

    I disable log uart and enable log rtt. and same softdevice and same option.

    15.2.0 is normal. it is almost real time print and that is what i wanted 

    however 15.3.0 is still slow print. I don't know what is problem. thanks your kindly answer.

Reply
  • Thank you your reply.

    First now I test ANT+ Communication using S332. I forgot telling you what I did.

    I changed log option UART disabled and only RTT enable. but result is not change.

    I download totally new SDK 15.2.0 and 15.3.0 on nordic ofiicial website. I used ant+ ant_bsc example.

    first i did not chagne any option on sdk_config.h. on sdk_config.h log RTT is disable and uart is enable.

    on this state, i build on 52832 PCA10040 1.2.1, nrf_log_info is not working. and when i enable log rtt, log_info is working regardless log_uart enable or not.

    I disable log uart and enable log rtt. and same softdevice and same option.

    15.2.0 is normal. it is almost real time print and that is what i wanted 

    however 15.3.0 is still slow print. I don't know what is problem. thanks your kindly answer.

Children
No Data
Related