Revision as of 15:37, 1 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.

JLink is a probe distributed by Segger. STM32CubeMonitor is compatible with JLink probe. We will describe here how to use JLink probe with STM32CubeMonitor.

2. JLink connection

J-Link probe have to be connected to STM32 board using the SWD connector. Jumper wires could be used. Hereafter, the mapping between JlinkProbe and CN4 (SWD) connector on Nucleo Board. Please note that in this configuration Nucleo board is still powered by ST-Link using USB cable.

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

Below is a photography of a JLink probe connected by wire to a Nucleo board.

3. JLink nodes

Two nodes are dedicated to JLink:

acqjlinkout.png Allow to define and/or select a Jlink 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 Jlink probe configuration (probe name), and receive data from the selected probe.

4. Basic Jlink Flow

Here you can see an example of a basic flow to perform an acquisition with a Jlink probe. Instead of using STlink acquisition nodes, JLink acquisition nodes are used.

[{"id":"89aa67caea52677b","type":"acquisition jlink out","z":"7b9ed63e.2138f8","name":"ProbeJlink_out","probeconfig":"caa2ca14406125bf","x":560,"y":60,"wires":[]},{"id":"caa2ca14406125bf","type":"probejlink","probeid":"36410082","probename":"Jlink (36410082)","mcuname":"STM32F411RE","nickname":"Jlink"}]

4.1. Import the flow

Import the following flow into the STM32CubeMonitor workspace:

<syntaxhighlight lang="json">[{"id":"5442c1fe.bae16","type":"subflow","name":"Group variables in a .csv file","info":"","category":"STMicroelectronics","in":[{"x":60,"y":80,"wires":[{"id":"76ed82a.aeea47c"}]}],"out":[{"x":840,"y":360,"wires":[{"id":"e2840a46.67f638","port":0}]}],"env":[{"name":"nbVar","type":"num","value":"","ui":{"icon":"font-awesome/fa-cogs","label":{"en-US":"Number of Variables"},"type":"input","opts":{"types":["num"]}}},{"name":"delete_time","type":"bool","value":"false","ui":{"icon":"font-awesome/fa-clock-o","label":{"en-US":"Single Time"},"type":"input","opts":{"types":["bool"]}}}],"color":"#3CB4E6","icon":"node-red/join.svg"},{"id":"4eb816e2.08f228","type":"function","z":"5442c1fe.bae16","name":"Associate values with same timestamp","func":"let i = 0;\nlet j = 0;\nlet n = 0;\nlet msg1; \nlet msgArray = new Array();\nlet nbVar = msg.payload.length;\n//node.error(\"test\" + nbVar)\n//node.error(msg.payload);\n\nfor(i = 0; i < nbVar; i++){\n \n let underArrayLength = msg.payload[i].length;\n \n for(j = 0; j < underArrayLength; j++){\n \n for(n = 0; n < nbVar; n++){\n msg1 = msg.payload[n][j];\n msgArray.push(msg1);\n }\n }\n msg.payload = msgArray;\n return msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":80,"wires":"3090a095.2eb79"},{"id":"3090a095.2eb79","type":"split","z":"5442c1fe.bae16","name":"","splt":"\\n","spltType":"str","arraySplt":"${nbVar}","arraySpltType":"len","stream":false,"addname":"","x":870,"y":80,"wires":"9d83ccf1.3555"},{"id":"f131f71e.41cae8","type":"function","z":"5442c1fe.bae16","name":"Format data","func":"let output=\"\";\n\nif(typeof msg.payload == 'number') {\n output = msg.payload;\n \n}else if(typeof msg.payload == 'string'){\n output = msg.payload;\n}else{\n output = msg.payload.x + \";\"+ msg.payload.y;\n}\n\nmsg.payload = output ;\n\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":200,"wires":"e2840a46.67f638"},{"id":"e2840a46.67f638","type":"join","z":"5442c1fe.bae16","name":"Join consecutive messages from the number of monitored variables","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":";","joinerType":"str","accumulate":false,"timeout":"","count":"${nbVariables}","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":380,"y":360,"wires":[[]]},{"id":"76ed82a.aeea47c","type":"join","z":"5442c1fe.bae16","name":"Join [nbVar] consecutives messages","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":";","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":290,"y":80,"wires":"4eb816e2.08f228","31884232.12fbbe"},{"id":"9d83ccf1.3555","type":"function","z":"5442c1fe.bae16","name":"Delete duplicate timestamps if user wants","func":"let i;\nlet delDup = env.get(\"delete_time\");\nlet nbVar = env.get(\"nbVar\");\nlet msgArray = new Array();\n\nif(delDup === false){\n return msg;\n}else{\n \n msgArray.push(msg.payload[0]);\n \n for(i=1; i < nbVar; i++){\n if (msg.payload[i].y!==undefined) {\n msgArray.push(msg.payload[i].y);\n } else {\n msgArray.push(\" \");\n }\n \n }\n \n msg.payload = msgArray;\n return msg;\n \n}\n\n\n","outputs":1,"noerr":0,"x":260,"y":200,"wires":"f8ba82c4.b6fc1"},{"id":"f8ba82c4.b6fc1","type":"split","z":"5442c1fe.bae16","name":"","splt":"\\n","spltType":"str","arraySplt":"1","arraySpltType":"len","stream":false,"addname":"","x":570,"y":200,"wires":"f131f71e.41cae8"},{"id":"31884232.12fbbe","type":"debug","z":"5442c1fe.bae16","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":620,"y":40,"wires":[]},{"id":"34072f28.a29b6","type":"tab","label":"Convert .stcm to .csv ","disabled":false,"info":"This flow is used to convert stcm file in csv file\n\nThe file name must be entered in the \"set file name\" node\n\nThe csv output format is variable Name, x, y\nNote : the data may be processed by group, so the x value may not be in time order. The csv file may be sorted on the x value to ensure order coherency. "},{"id":"4c64fe53.6ea08","type":"file in","z":"34072f28.a29b6","name":"Read file","filename":"","format":"lines","chunk":false,"sendError":false,"encoding":"none","x":140,"y":360,"wires":"ca9d918c8c2d291f"},{"id":"a30d1a30.036c68","type":"inject","z":"34072f28.a29b6","name":"Start","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":110,"y":160,"wires":"d126afb4.cd9c5"},{"id":"9f1676e1.60b388","type":"json","z":"34072f28.a29b6","name":"Parse each line","property":"payload","action":"","pretty":false,"x":520,"y":360,"wires":"fc5b68a9.d4a3b8"},{"id":"6605dcb4.d756c4","type":"function","z":"34072f28.a29b6","name":"add a line escape after each payload","func":"let output=\"\";\n\noutput= msg.payload + \"\\n\";\n\nmsg.payload = output ;\n\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":540,"wires":"51f5a040.55bc5"},{"id":"6d6c1729.9217b8","type":"file","z":"34072f28.a29b6","name":"Write csv","filename":"","appendNewline":false,"createDir":false,"overwriteFile":"false","encoding":"none","x":960,"y":540,"wires":[[]]},{"id":"d126afb4.cd9c5","type":"change","z":"34072f28.a29b6","name":"Set file name","rules":[{"t":"set","p":"filename","pt":"msg","to":"C:\\Users\\frq09421\\log\\Log_myVariables_2022-11-04_12h00m52s.stcm","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":160,"wires":"4c64fe53.6ea08","907372c9.774d7"},{"id":"9f00f046.f52ca","type":"comment","z":"34072f28.a29b6","name":"Enter your filename here","info":"","x":330,"y":120,"wires":[]},{"id":"51f5a040.55bc5","type":"change","z":"34072f28.a29b6","name":"Set csv extension in filename","rules":[{"t":"change","p":"filename","pt":"msg","from":"stcm","fromt":"str","to":"csv","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":700,"y":540,"wires":"6d6c1729.9217b8"},{"id":"a50548d8.3bfa38","type":"file","z":"34072f28.a29b6","name":"Eraze csv","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":780,"y":160,"wires":[[]]},{"id":"907372c9.774d7","type":"change","z":"34072f28.a29b6","name":"Format csv header ","rules":[{"t":"change","p":"filename","pt":"msg","from":"stcm","fromt":"str","to":"csv","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"Timestamp_g_counter1; g_counter1; Timestamp_Data2; Data2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":160,"wires":"a50548d8.3bfa38"},{"id":"bc597112.a249b","type":"comment","z":"34072f28.a29b6","name":"Process the stcm file","info":"","x":510,"y":280,"wires":[]},{"id":"14ea3272.6b64ee","type":"comment","z":"34072f28.a29b6","name":"Write the csv file","info":"","x":1000,"y":460,"wires":[]},{"id":"fc5b68a9.d4a3b8","type":"change","z":"34072f28.a29b6","name":"Keep only values","rules":[{"t":"set

basic jlink flow.png

The Jlink probe must be configured by selecting it from the picklist and indicating its name in the "Name" field.

basic jlink flow nodeconfig.png

The version of the DLL used by the Jlink probe is indicated.

basic jlink flow probe config.png

Unlike the STLink, the user must specify the type of board to monitor. They 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 directory xxxxxxxxx. The file "SupporedHW.txt" is part of the installer Setupxxxxx.zip.