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.

  • Thx.

    OK. so there's some other issue. I removed all the RTT calls and the problem is the same. The timeout seen by the phone app is caused by the example crashing before BLE is connected.

    So evidently I have a hardware problem. I have tried additional pullup and down on the SWDIO and SWDCLK. Does not fix it. Neither does pulsing nRESET pin low.

    Could the JLink have put the nRF52 in some mode where it needs to remain connected? Just guessing.

Reply
  • Thx.

    OK. so there's some other issue. I removed all the RTT calls and the problem is the same. The timeout seen by the phone app is caused by the example crashing before BLE is connected.

    So evidently I have a hardware problem. I have tried additional pullup and down on the SWDIO and SWDCLK. Does not fix it. Neither does pulsing nRESET pin low.

    Could the JLink have put the nRF52 in some mode where it needs to remain connected? Just guessing.

Children
No Data
Related