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

SEGGER RTT printf not printing all the lines.

I want to read whole flash memory using for loop and see how long it takes. What i have noticed is that it does not print all the lines. On the other side i ask myself: Does it read all the lines?

I read the memory as suggested in this post devzone.nordicsemi.com/.../

  • Hi,

    It could be possible that you print the data "too fast". This means you write to the RTT buffer faster than the J-Link reads and empties the buffer. When the buffer is full, the default configuration is to discard new data.

    There are three approaches to avoid this:

    1. Use an external J-Link (PRO/ULTRA+) which might read the buffer faster
    2. Use a larger RTT buffer (increase BUFFER_SIZE_UP in SEGGER_RTT_Conf.h)
    3. Use RTT in blocking mode (define SEGGER_RTT_MODE_DEFAULT as SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL)

    Please note that with the third approach your application will be blocked and does not run if no J-Link/Debugger is attached.

    Regards Johannes

  • The buffer size is quite small by default in the SDK examples, only 64 bytes. Check SEGGER_RTT_CONFIG_BUFFER_SIZE_UP in sdk_config.h (BUFFER_SIZE_UP in SEGGER_RTT_Conf.h is set to this).

Related