Im trying to debug STM32 code using VSCode and OpenOCD. If the start address of the code is 0x0800000 it works fine, but when I move it to account for my bootloader, vscode will not locate the start of the code after the debug button is pressed. Oddly, the Eclipse based IDE works perfectly. I looked at the terminal output of both Eclispe and VSCode when debugging starts and GDB and OpenOCD output looks identical. Here is my launch.json:
{
"configurations": [
{
"cwd": "${workspaceFolder}",
"executable": "app.elf",
"name": "OPENOCD",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"serverpath":"/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.openocd.macos64_2.3.200.202312181736/tools/bin/openocd",
"servertype": "openocd",
"searchDir": [
"/Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.debug.openocd_2.2.0.202401261111/resources/openocd/st_scripts"
],
"serverArgs": [
"-c", "gdb_port 50000",
"-c", "gdb_report_data_abort enable" ,
"-c", "tcl_port 50001",
"-c", "telnet_port 50002"
],
"device": "STM32L452xx",
"interface": "swd",
"showDevDebugOutput": "parsed",
"configFiles": [
app.cfg",
],
"svdFile": "${workspaceFolder}/STM32L4X2.svd"
}
]
}