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

How to configure Zephyr for RTT logging with nRF5340?

So far, since UART has been working well, now, we are switching from UART to RTT to remove UART port connection from our PCB design. 

However, the output to RTT is working well but nRF53 couldn't receive any characters over RTT.

Is there any way to enable RTT input to receive characters through RTT

The prj.conf setup:

# Enable RTT to replace UART
CONFIG_STDOUT_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=y
CONFIG_SHELL_BACKEND_RTT=y

The output from the device (nRF53400) was properly print out in RTT View as shown below.

< Capture of RTT Viewer >

 

The environment : 

  • Development board PCA10095 – nRF5340
  • Segger J-Link – JTAG debugger.
  • Host RTT software - J-Link RTT Viewer V7.20a
  • OS - Linux Ubuntu-18
  • Zephyr V2.5.0

The references I referred :

Links
devzone.nordicsemi.com/.../how-to-setup-zephyr-for-rtt-logging-with-nrf9160
devzone.nordicsemi.com/.../can-i-use-rtt-instead-of-uart-for-a-console-on-nrf5340

Thanks,

Jae

Parents Reply Children
  • Thank you for the testing!.   Yes, the output to RTT was not the issue to me either.

    You may want to check the input to RTT to see if working.  If not working, you may check CONFIG_LOG_MODE_IMMEDIATE to see if disabled.

    Now, with CONFIG_LOG_MODE_IMMEDIATE=n, both the output and the input worked well.

    The only curiosity is why CONFIG_LOG_MODE_IMMEDIATE=y set the blocking mode to disable RTT input polling feature. So, regardless of performance concern, RTT input was not functional anymore with CONFIG_LOG_MODE_IMMEDIATE=y.

    Thanks,

    Jae

Related