Used SDK: 15.2.0
I want to print some debug messages over RTT after an error occured. After that I want to reset the system.
If I put the string into the que with NRF_LOG_INFO("Debug Text"), then forcing the log module to print out all the strings in buffer with NRF_LOG_FINAL_FLUSH(), then calling NVIC_SystemReset() to reboot the system will cause broken text output in J-Link RTT viewer. It seems that the NRF_LOG_FINAL_FLUSH() function does not block the code until all the text was sended out.
Including a delay before triggering the reset will solve the problem. But with various length of the debug messages, calling a fixed delay is not a well made solution. Also the documentation sais, that calling NRF_LOG_FINAL_FLUSH() is made for exactly this problem.
Do you know whats going wrong?
Thank you, Regards
It probably has to do with the limited buffer size of RTT. By default nrf_log uses SEGGER_RTT_MODE_NO_BLOCK_SKIP, which is probably why the text output is broken. You can try either increasing RTT buffer or setting SEGGER_RTT_MODE_DEFAULT to SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL.
Thank you for answering!
I tried both of your solutions, but none helped:
The first messages on top are with a delay inserted and the following messages are with your soltions:
- in sdk_config.h setting SEGGER_RTT_CONFIG_DEFAULT_MODE to "2" (BLOCK mode)
- in sdk_config.h double the buffers SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN and SEGGER_RTT_CONFIG_BUFFER_SIZE_UP
Do you have any others ideas?
Could you try:
sadly, it does not help. The output is still scrappy...