Important: We're excited to introduce our new technical documentation platform docs.nordicsemi.com, currently in Beta version. We invite you to explore it and share your feedback. Read more on our DevZone blog.
Important note: An issue with Segger J-Link firmware on the nRF5x boards might cause
data loss and/or corruption on the USB CDC ACM Serial Port on some machines.
To work around this disable the Mass Storage Device on your board as described in Disabling the Mass Storage Device functionality.
The serial port will appear as /dev/ttyACMx. By default the port is not accessible to all users.
Type the command below to add your user to the dialout group to give it access to the serial port.
Note that re-login is required for this to take effect.
Recent versions of ModemManager send AT commands to TTY-like devices; this
includes Nordic development kits. This will prevent you from using the serial
port for a few seconds, and can make your application misbehave if it reads
data from the UART. Before running your application, you might want to
temporarily disable ModemManager by running these commands:
Due to a known issue in Segger’s J-Link firmware, depending on your operating system
and version you might experience data corruption or drops if you use the USB CDC
ACM Serial Port with packets larger than 64 bytes.
This has been observed on both GNU/Linux and macOS (OS X).
To avoid this, you can simply disable the Mass Storage Device by opening:
On GNU/Linux or macOS (OS X) JLinkExe from a terminal
On Microsoft Windows the “JLink Commander” application
And then typing the following:
And finally unplugging and replugging the board. The Mass Storage Device should
not appear anymore and you should now be able to send long packets over the virtual Serial Port.
Further information from Segger can be found in the Segger SAM3U Wiki.
Segger’s J-Link supports Real-Time Tracing (RTT), a technology that allows a terminal
connection (both input and output) to be established between the target (nRF5x board)
and the development computer for logging and input. Zephyr supports RTT on nRF5x targets,
which can be very useful if the UART (through USB CDC ACM) is already being used for
a purpose different than logging (such as HCI traffic in the hci_uart application).
To use RTT, you will first need to enable it by adding the following lines in your .conf file:
There is also a HAS_SEGGER_RTT symbol that indicates that the platform
supports SEGGER J-Link RTT. This symbol is set automatically by the SoC
Kconfig files. Do not confuse it with USE_SEGGER_RTT.
USE_SEGGER_RTT depends on HAS_SEGGER_RTT.
If you get no RTT output you might need to disable other consoles which conflict
with the RTT one if they are enabled by default in the particular sample or
application you are running. For example, to disable the UART console,
add this to your .conf file:
Once compiled and flashed with RTT enabled, you will be able to display RTT console
messages by doing the following: