-
Notifications
You must be signed in to change notification settings - Fork 241
STM32CubeCLT Specific Configuration (using ST‐Link)
Bryce Schober edited this page Nov 16, 2024
·
2 revisions
These settings were extracted by using the new STM32 VS Code extension's generated launch configuration. That extension currently only supports CMake
projects, so using it for development isn't yet appropriate for all use cases (i.e. STM32duino).
-
Download and install the latest STM32CubeCLT installer from https://www.st.com/en/development-tools/stm32cubeclt.html
-
Restart Windows in order to reload your system environment variables.
On Linux, you might need to manually define the appropriate environment variable yourself, something like this, but making sure you have the correct installation path:
echo "export STM32CLT_PATH=/opt/st/stm32cubeclt_1.16.0" >> ~/.bashrc
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "Debug w/ ST-Link",
"cwd": "${workspaceFolder}",
"type": "cortex-debug",
"executable": "myproject.elf", // Change to your .elf executable
"request": "launch",
"servertype": "stlink",
"device": "STM32H563ZITx", // Change to your MCU used
"interface": "swd",
"serialNumber": "", // Set ST-Link ID if you use multiple at the same time
"runToEntryPoint": "main",
"svdFile": "${env:STM32CLT_PATH}/STMicroelectronics_CMSIS_SVD/STM32H563.svd", // Change based your MCU used
"v1": false, // Change it depending on ST Link version
"serverpath": "${env:STM32CLT_PATH}/STLink-gdb-server/bin/ST-LINK_gdbserver",
"stm32cubeprogrammer": "${env:STM32CLT_PATH}/STM32CubeProgrammer/bin",
"stlinkPath": "${env:STM32CLT_PATH}/STLink-gdb-server/bin/ST-LINK_gdbserver",
"armToolchainPath": "${env:STM32CLT_PATH}/GNU-tools-for-STM32/bin",
"gdbPath": "${env:STM32CLT_PATH}/GNU-tools-for-STM32/bin/arm-none-eabi-gdb",
"serverArgs": [
"-m",
"1",
],
//"preLaunchTask": "Build + Flash"
},
{
"name": "Attach w/ ST-Link",
"cwd": "${workspaceFolder}",
"type": "cortex-debug",
"executable": "myproject.elf", // Change to your .elf executable
// Let CMake extension decide executable: "${command:cmake.launchTargetPath}"
// Or fixed file path: "${workspaceFolder}/path/to/filename.elf"
"request": "attach",
"servertype": "stlink",
"device": "STM32H563ZITx", // Change to your MCU used
"interface": "swd",
"serialNumber": "", // Set ST-Link ID if you use multiple at the same time
"runToEntryPoint": "main",
"svdFile": "${env:STM32CLT_PATH}/STMicroelectronics_CMSIS_SVD/STM32H563.svd", // Change based your MCU used
"v1": false, // Change it depending on ST Link version
"serverpath": "${env:STM32CLT_PATH}/STLink-gdb-server/bin/ST-LINK_gdbserver",
"stm32cubeprogrammer": "${env:STM32CLT_PATH}/STM32CubeProgrammer/bin",
"stlinkPath": "${env:STM32CLT_PATH}/STLink-gdb-server/bin/ST-LINK_gdbserver",
"armToolchainPath": "${env:STM32CLT_PATH}/GNU-tools-for-STM32/bin",
"gdbPath": "${env:STM32CLT_PATH}/GNU-tools-for-STM32/bin/arm-none-eabi-gdb",
"serverArgs": [
"-m",
"1",
],
}
]
}