ST-LINK/V2-1 is a serial and debug adapter built into all Nucleo and Discovery
boards. It provides a bridge between your computer (or other USB host) and the
embedded target processor, which can be used for debugging, flash programming,
and serial communication, all over a simple USB cable.
SEGGER offers a firmware upgrading the ST-LINK/V2-1 on board on the Nucleo and
Discovery boards. This firmware makes the ST-LINK/V2-1 compatible with J-Link
OB, allowing users to take advantage of most J-Link features like the ultra fast
flash download and debugging speed or the free-to-use GDBServer.
More informations about upgrading ST-LINK/V2-1 to JLink or restore ST-Link/V2-1
firmware please visit: `SEGGER`_
Zephyr supports the following debug tools through ST-LINK/V2-1:
ST-Link tool is available by default, flash and debug could be done as follows.
Host Tools and Firmware
Download and install the `Segger J-Link Software and Documentation Pack`_ to
get the J-Link GDB server for your host computer.
Use the CMake ``flash`` target with the argument ``STLINK_FW=jlink`` to
build your Zephyr application.
Use the CMake ``debug`` target with the argument ``STLINK_FW=jlink`` to build
your Zephyr application, invoke the J-Link GDB server, attach a GDB client, and
program your Zephyr application to flash. It will leave you at a GDB prompt.
If you configured your Zephyr application to use a UART console (most boards
enable this by default), open a serial terminal (minicom, putty, etc.) with the
- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1
If you configured your Zephyr application to use `Segger RTT`_ console instead,
.. code-block:: console
$ telnet localhost 19021
Connected to localhost.
Escape character is '^]'.
SEGGER J-Link V6.30f - Real time terminal output
J-Link STLink V21 compiled Jun 26 2017 10:35:16 V1.0, SN=773895351
Zephyr Shell, Zephyr version: 1.12.99
Type 'help' for a list of available commands
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, such as disable UART_CONSOLE in menuconfig.
.. _Segger J-Link Software and Documentation Pack:
.. _Segger RTT: