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
  • From my end, as I narrowed down this issue, I guess, it may be related with the blocking mode in z_shell_log_backend_enable function.

    If I commented out the line (err = shell->iface->api->enable(shell->iface, true);) shown in the picture, the input to RTT was working well.   However, I am not sure about what the line means.  Does anyone know about this line or the blocking mode? Or, do you know any other proper way not to use blocking mode?  Please feel free to comment it.

    Thanks,

    Jae

Reply
  • From my end, as I narrowed down this issue, I guess, it may be related with the blocking mode in z_shell_log_backend_enable function.

    If I commented out the line (err = shell->iface->api->enable(shell->iface, true);) shown in the picture, the input to RTT was working well.   However, I am not sure about what the line means.  Does anyone know about this line or the blocking mode? Or, do you know any other proper way not to use blocking mode?  Please feel free to comment it.

    Thanks,

    Jae

Children
Related