How to use the J-Link probe

Revision as of 17:34, 26 February 2024 by Registered User


1. Overview

Before reading this article, it is highly recommended to read STM32CubeMonitor:Introduction and main principles of STM32CubeMonitor, to better understand the STM32CubeMonitor concepts.

J-Link is a probe distributed by SEGGER. STM32CubeMonitor is compatible with the J-Link probe. This article describes how to use the J-Link probe with STM32CubeMonitor.

2. J-Link connection

The J-Link probe must be connected to the STM32 board through the SWD connector. Jumper wires can be used for this purpose. Hereafter, the mapping between the J-Link probe and the CN4 (SWD) connector of a Nucleo board. Note that, in this configuration, the Nucleo board is still powered by its ST-LINK interface through a USB cable.

For further information, visit: https://wiki.segger.com/Connecting_to_STM32_Nucleo_boards

Below is a photography of a J-Link probe connected by wires to a Nucleo board.

3. J-Link nodes

Two nodes are dedicated to J-Link:

acqjlinkout.png Allow to define and/or select a J-Link probe configuration (probe name), open and close the connection and send commands to the selected probe.

acqjlinkin.png Allow to define and/or select a J-Link probe configuration (probe name), and receive data from the selected probe.


4. Import the basic J-Link flow

Import the following flow into the STM32CubeMonitor workspace:

[{"id":"7b9ed63e.2138f8","type":"tab","label":"Basic_Jlink_Flow","disabled":false,"info":"# Basic flow to start with STM32CubeMonitor."},{"id":"1ebbb430.dac7dc","type":"ui_chartst","z":"7b9ed63e.2138f8","group":"f9c34dde.1e2f4","name":"myChart","order":4,"width":15,"height":9,"chartType":"line","curveType":"linear","duration":"10","ymin":"","ymax":"","x":600,"y":220,"wires":[]},{"id":"d59587ff.cd1748","type":"variables","z":"7b9ed63e.2138f8","groupname":"myVariables","accesspoint":0,"execonfig":"897b911b63836df1","variablelist":[],"triggerstartmode":"manual","triggername":"SystemCoreClock","triggerthreshold":"30000","frequency":"","frequencyType":"0","snapshotheader":"","mode":"direct","lastImportedTime":1705497951818,"openStatus":true,"x":330,"y":120,"wires":[["89aa67caea52677b"],["f14d0398.f1861"]]},{"id":"fc00295e.79ada8","type":"ui_button","z":"7b9ed63e.2138f8","name":"","group":"f9c34dde.1e2f4","order":3,"width":5,"height":1,"passthru":false,"label":"Clear Graphs","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"clear","x":470,"y":320,"wires":[["1ebbb430.dac7dc"]]},{"id":"5fd51c96.2330e4","type":"ui_button","z":"7b9ed63e.2138f8","name":"","group":"f9c34dde.1e2f4","order":1,"width":5,"height":1,"passthru":false,"label":"START Acquisition","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"start","x":110,"y":80,"wires":[["d59587ff.cd1748"]]},{"id":"52eadfe3.2c8cc","type":"ui_button","z":"7b9ed63e.2138f8","name":"","group":"f9c34dde.1e2f4","order":2,"width":5,"height":1,"passthru":true,"label":"STOP Acquisition","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"stop","x":110,"y":160,"wires":[["d59587ff.cd1748"]]},{"id":"a7c3e070.5a6c","type":"processing","z":"7b9ed63e.2138f8","groupname":"myVariables","groupid":"d59587ff.cd1748","expressions":[],"statistics":[],"logmode":"no","logformat":"stcm","x":330,"y":220,"wires":[["1ebbb430.dac7dc"],[]]},{"id":"f14d0398.f1861","type":"ui_toast","z":"7b9ed63e.2138f8","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":630,"y":160,"wires":[]},{"id":"89aa67caea52677b","type":"acquisition jlink out","z":"7b9ed63e.2138f8","name":"ProbeJlink_out","probeconfig":"caa2ca14406125bf","x":560,"y":60,"wires":[]},{"id":"379cf07d39eef2f4","type":"acquisition jlink in","z":"7b9ed63e.2138f8","name":"ProbeJlink_in","probeconfig":"caa2ca14406125bf","x":90,"y":280,"wires":[["a7c3e070.5a6c"],[]]},{"id":"f9c34dde.1e2f4","type":"ui_group","name":"Chart","tab":"17d09b07.741a55","order":1,"disp":true,"width":15,"collapse":false},{"id":"897b911b63836df1","type":"exe-config","name":"test","exefile":"C:\\Users\\username\\STM32CubeIDE\\workspace_1.13.1\\THIRD\\Debug\\THIRD.elf","exefolder":"C:\\Users\\username\\STM32CubeIDE\\workspace_1.13.1\\THIRD\\Debug\\","exevariablelist":[{"address":"0x20000004","name":"uwTickPrio","type":5,"checked":false},{"address":"0x20000008","name":"uwTickFreq","type":2,"checked":true},{"address":"0x20000028","name":"uwTick","type":5,"checked":true},{"address":"0x20000000","name":"SystemCoreClock","type":5,"checked":true},{"address":"0x080012c0","name":"AHBPrescTable[0]","type":1,"checked":false}],"expand":false,"filename":"THIRD.elf","exeModifiedTime":1692890036290,"configLastUpdate":1705497951482},{"id":"caa2ca14406125bf","type":"probejlink","probeid":"36410082","probename":"Jlink (36410082)","mcuname":"STM32F411RE","nickname":"Jlink"},{"id":"17d09b07.741a55","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Menu > Import > Clipboard and Copy/Paste the .json formatted flow in the area, click on Import. The flow is now imported into the STM32CubeMonitor workspace.

5. Basic J-Link flow

Here you can see an example of a basic flow to perform an acquisition with a J-Link probe. Instead of using ST-LINK acquisition nodes, J-Link acquisition nodes are used.

basic jlink flow.png

The J-Link probe must be configured by selecting it from the picklist and indicating its node's name in the "Name" field.

basic jlink flow nodeconfig.png

The version of the DLL used by the J-Link probe is indicated.

basic jlink flow probe config.png

Unlike the ST-LINK, the user must specify the type of board to monitor. User make this choice by selecting the product. Once he has completed these operations, he can click on deploy and perform an acquisition, just like with an STLink.

selectproduct.png


Troubleshoot

"File not found" appears in the MCU pick list when the SupportedHW.txt file is not present in the stm32cubemonitor-jlink-protocol directory. The file "SupportedHW.txt" is part of the installer Setupxxxxx.zip.