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

rtt when link disconnected

I have an example combining BLE, UART and SPI in which I use RTT to watch the startup process. The SoC is nRF52 (BLE Nano2); building with armgcc. This works ok when JLink is connected. However, if I unplug the JLink the BLE fails with a GATT_CONN_TIMEOUT. I guess this could be because the RTT messages (SEGGER_RTT_printf) are getting stacked up somehow and eating up memory? Has anyone seen this? Is there a simple way to detect the absence of a JLink connection and disable RTT logging without removing all the calls? Thx.

Parents
  • No. RTT uses a fixed sized ring buffer which is overwritten if it fills up. RTT was designed to be able to be left in your code as it just harmlessly writes data, if a Segger isn't connected, it just doesn't get read or go anywhere.

    Segger used to have a much better description of RTT than it seems to now, there's an old copy of it www.phaedsys.com/.../seggerjlinksw.html which has the original description of the ring buffer and a comment you can use it without a debugger connected.

    So that's most likely not your problem.

Reply
  • No. RTT uses a fixed sized ring buffer which is overwritten if it fills up. RTT was designed to be able to be left in your code as it just harmlessly writes data, if a Segger isn't connected, it just doesn't get read or go anywhere.

    Segger used to have a much better description of RTT than it seems to now, there's an old copy of it www.phaedsys.com/.../seggerjlinksw.html which has the original description of the ring buffer and a comment you can use it without a debugger connected.

    So that's most likely not your problem.

Children
Related