Serial terminal
Hi, I am seeking some guidance.
With the new release STM32CubeIDE for Visual Studio Code 3.8.0, it says it comes with new features including
" Serial terminal: Enabling developers to easily setup serial communication for example leveraging the ST-LINK virtual com port."
In the docs, there is not much explanation on how to get this working. I only see:
"If the serverPort attribute is defined, two ports are used by the ST-LINK GDB server: one for the debug session and serverPort + 1 for the SWO connection.
These ports are reserved even if SWO is not activated in the debug configuration."
How would one activate the SWO in the launch.json? I went through all the options with completition and none seem to activate or configure the SWO.
I know that with the extension "Cortex-Debug" provided by marus25 we could configure the SWO as so:
"swoConfig": {
"enabled": true,
"cpuFrequency": 275000000, // must match -a (Hz) :contentReference[oaicite:4]{index=4}
"swoFrequency": 1375000, // 2MHz example (Hz) :contentReference[oaicite:5]{index=5}
// This is the key: read SWO from a socket (ST-LINK_gdbserver -z)
"source": "socket",
"swoPort": "localhost:61235",
"decoders": [
{
"label": "ITM Port 0 (printf)",
"type": "console",
"port": 0
}
]
}My actual configuration is (I am using a STM32H735G-DK board):
{
"type": "stlinkgdbtarget",
"request": "launch",
"name": "STM32Cube: STM32 Launch ST-Link GDB Server",
"origin": "snippet",
"cwd": "${workspaceFolder}",
"preBuild": "${command:st-stm32-ide-debug-launch.build}",
"runEntry": "main",
"imagesAndSymbols": [
{
"imageFileName": "${command:st-stm32-ide-debug-launch.get-projects-binary-from-context1}",
}
],
"serverExtLoader": [
{
"loader": "${env:CUBE_BUNDLE_PATH}\\programmer\\2.22.0+st.1\\bin\\ExternalLoader\\MX25LM51245G_STM32H735G-DK.stldr",
"initialize": false
}
],
"liveWatch": {
"enabled": true,
"samplesPerSecond": "4"
},
/*"serverRtos": {
"enabled": true,
"port": "60000",
"driver": "freertos"
},*/
"serverPort": "61234",
},So, if I understand correctly the docs, if we set a serverPort to 61234, it will reserve this port for ST-LINK GDB server and 61235 for SWO connection.
Any guidance on how to make this work and display the SWO strings to a terminal within VSCode?
Thank you!
