Closed ANauzet closed 9 months ago
Maybe the solution is just to add a parameter to tell dbg that it should start at offset. But I could not found any information about it
Maybe the solution is just to add a parameter to tell dbg that it should start at offset. But I could not found any information about it
First of all, we do not do anything to set the start address. It is done by your processor and your reset vector,
Secondly, you have total control over what commands are executed by using pre/post/override options. Please read our Wiki and other documentation
https://github.com/Marus/cortex-debug/blob/master/debug_attributes.md
Finally, can you get all of this working using command line tools? If you can't, neither can we.
My issue is the same. After adding “overrideLaunchCommands”
to the “configurations”
in launch.json
, I am able to debug successfully.
"configurations": [
{
"showDevDebugOutput": "parsed",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}/build/app.elf",
"name": "Debug STM32",
"request": "launch",
"type": "cortex-debug",
"servertype": "openocd",
"preLaunchTask": "CMake: build",
"device": "stm32f407",
"configFiles": [
"openocd.cfg"
],
"overrideResetCommands":[],
"overrideLaunchCommands":[
"cd ${workspaceRoot}/build",
"file app.elf",
"target extended-remote localhost:50000",
"monitor reset halt",
"load",
"set output-radix 16"
],
"svdFile": "${workspaceRoot}/STM32F407.svd"
}
]
Describe the bug Debugging code that is relocated in Flash does not work
I have a Bootloader @0x0800 0000 and an Application relocated @0x0802 0000 by modifying linker script and VECT_TAB_OFF 0x0002 0000. In execution, the bootloader call the application and the application works fine. But when trying to debug the application, impossible to reach main() If the application is relocated to 0x0800 0000, debug is possible
To Reproduce Steps to reproduce the behavior:
Expected behavior
Debug should be possible on application executed from Flash offset
Environment (please complete the following information):
[comment]: <> Whenever possible, please make sure you are using the latest versions of VSCode and our extension
Please include
launch.json
Attach text from
Debug Console
Please enable debug output in your launch.json (
"showDevDebugOutput": "raw"
). It this is too large, please attach it as a fileAdditional context Add any other context about the problem here.