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 Reply Children
  • HI.

    1. I enabled

    NRF_LOG_BACKEND_RTT_ENABLE,  NRF_LOG_BACKEND_UART_ENABLE, NRF_LOG_ENABLE using CMSIS

    Config file is too huge. which option do you need ? 

    I Test SEGGER_RTT_WriteString or SEGGER_RTT_PRINTF. it work very well.

    I confused printf to UART or RTT? Could you recommand post to learn what difference and which config option need to enable or not.

    In my opinion printf and segger_rtt_printf works well. maybe some option is conflicted.

    Could you know only print NRF_LOG option? except other rtt or anything.

    Thank you kind 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.

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

  • now I found what is problem.

    15.3.0 in sdK_config.h 

    NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 1 

    this one is problem. maybe

    I compare totally 15.3.0 and 15.2.0. 

    I check and chagne one by one config line.

    and then NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 0

    print speed is normal. 

    I don't know why.

    anyway if you know why it happend 

    please more explain to me.

    Thank you

  • Thank you for reporting back the solution. I'm not sure why this would slow down the logging, but you can see an explanation of what happens in this post.

Related