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

UART and RTT

I have a NRF51 talking through the UART to another uC, and I'm trying to log messages through Segger RTT. Everything works normally until I start to send some data through the UART, and then RTT stops working, although the UART traffic continues without any problems. If I just comment out the app_uart_put lines, RTT works just fine, so I know it is a conflict between the UART and RTT.

I'm using SDK9 since I'm working with the OpenMesh stuff. I've tried both the UART in normal and FIFO configuration, and I've programatically configured the SEGGER_RTT_ConfigUp/DownBuffers as is done in the nrf_log.c libraries, but nothing has helped.

Here is how the UART is configured:

const app_uart_comm_params_t comm_params =
  {
      RX_PIN_NUMBER,
      TX_PIN_NUMBER,
      0,
      0,
      APP_UART_FLOW_CONTROL_DISABLED,
      false,
      UART_BAUDRATE_BAUDRATE_Baud115200
  };

APP_UART_FIFO_INIT(&comm_params,
                     UART_RX_BUF_SIZE,
                     UART_TX_BUF_SIZE,
                     uart_error_handle,
                     APP_IRQ_PRIORITY_LOW,
                     error_code);

Any suggestions?

  • Can you try to update the jlink firmware to the latest version as well as using the newest RTT viewer (located in the install folder of the newest firmware)?

    Is your code resetting for some reason? This can be an the application running into an error condition (the default behavior is resetting the chip, see here). I believe in earlier jlink/RTT version the RTT logging stopped working if the chip was reset.

  • I'm using JLink_V610d and the firmware is dated Sept 1,2016, which is as new as I can find. I can also guarantee that the device is not resetting and sitting in an error loop, because it continues to operate normally after RTT stops logging; the other MCU is getting serial data, and nRFConnect stays connected to the device, and I can interact with my BLE service.

    I spent the last couple of days working on trying to get a service value to be stored in flash and not working on any of the serial code, and RTT was happily logging, even when it crashed into the error handler, where I use RTT to log the code, file and line number. It's just as soon as I start sending just a few bytes of data through the UART, RTT stops logging, but everything else keeps running.

  • I am experiencing this issue as well, when logging volume goes up, the RTT output stops but normal program execution continues. Using the latest version of segger's tools with PCA10040 devkits

Related