case about How many bytes can output at a time in RTT

Hi,

sdk:ncs v1.6.1

board:9160dk_nrf9160

I use RTT to output log data, but I found that it can only output about 1k characters each time. Where can I modify it?

this my config about log

CONFIG_LOG=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n
CONFIG_CONSOLE=n
CONFIG_RTT_CONSOLE=n
CONFIG_UART_CONSOLE=n
CONFIG_LOG_DEFAULT_LEVEL=4
CONFIG_LOG_MODE_OVERFLOW=y
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=y
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
Thank you for all your assistance.
Kind regards,
yuanyongsong
Parents
  • Hi,

     

    I use RTT to output log data, but I found that it can only output about 1k characters each time. Where can I modify it?

    Try setting "CONFIG_LOG_MINIMAL=y" (CONFIG_LOG_MODE_MINIMAL in ncs v1.7.0 and newer), which disables the logging thread.

    You can also try to adjust "CONFIG_SEGGER_RTT_MAX_NUM_UP_BUFFERS".

    If you do not want it to drop packets when the buffer is filled up, you can add this configuration:

    CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL=y

     

    Note that this will block if the FIFO is filled up, meaning that you need to open the RTT viewer to allow the program to run.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    I use RTT to output log data, but I found that it can only output about 1k characters each time. Where can I modify it?

    Try setting "CONFIG_LOG_MINIMAL=y" (CONFIG_LOG_MODE_MINIMAL in ncs v1.7.0 and newer), which disables the logging thread.

    You can also try to adjust "CONFIG_SEGGER_RTT_MAX_NUM_UP_BUFFERS".

    If you do not want it to drop packets when the buffer is filled up, you can add this configuration:

    CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL=y

     

    Note that this will block if the FIFO is filled up, meaning that you need to open the RTT viewer to allow the program to run.

     

    Kind regards,

    Håkon

Children
  • Hi Håkon,Thank you very much for your reply

    I modified them separately according to your suggestions, but it didn’t seem to work

    I did a more detailed test and found that only the first packet of data when the 9160 is turned on will be like this,all subsequent data are complete.

    And I use the serial port to output log data, and there is no such problem at all.

    It feels like a problem with RTT.

    Kind regards,
    yuanyongsong
  • Hi,

     

    Which settings did you enable?

    If you are using a dedicated logger thread, you have to adjust the sizes there (see CONFIG_LOG_BUFFER_SIZE , CONFIG_LOG_BACKEND_RTT_OUTPUT_BUFFER_SIZE).

    Did you set CONFIG_LOG_MINIMAL? If so, the SEGGER_RTT buffers need to be adjusted (ie. CONFIG_SEGGER_RTT_BUFFER_SIZE_UP and CONFIG_SEGGER_RTT_MAX_NUM_UP_BUFFERS) and you should look into setting CONFIG_SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL, as previously mentioned.

     

    Kind regards,

    Håkon

Related