Closed Charry2014 closed 3 days ago
You are the one forcing the load of example.elf from your launch.json
"overrideLaunchCommands": [
"monitor reset init",
"load \"${command:raspberry-pi-pico.launchTargetPath}\""
],
In the debug console, you will see the above translated into
"overrideLaunchCommands": [
"monitor reset init",
"load \"/Users/toby/work/projects/vscfreetos/FreeRTOS-Community-Supported-Demos/CORTEX_M0+_RP2040/OnEitherCore/build/example.elf\""
],
Please contact whoever gave you this template. When you override things, you are on your own and have to understand what is going on.
Thank you, thank you. That is the magic - kicking myself for missing that, but many thanks for your help.
The template doing this most likely is the standard Raspberry Pi extension for VS Code, which I do not understand - but I am learning. Thank you again for your help.
Describe the bug This is more a request for help and explanation than reporting a bug - The debugger is always trying to debug a file called example.elf which does not exist and is not mentioned in any makefile I can find - where is this name coming from? The project does not build this file.
On starting the debugger VS Code presents a dialog - Failed to launch GDB: /Users/toby/work/projects/vscfreetos/FreeRTOS-Community-Supported-Demos/CORTEX_M0+_RP2040/OnEitherCore/build/example.elf: No such file or directory. (from interpreter-exec console "load \"/Users/toby/work/projects/vscfreetos/FreeRTOS-Community-Supported-Demos/CORTEX_M0+_RP2040/OnEitherCore/build/example.elf\"")
This is building a FreeRTOS project for the Pi 2040. The project builds two .elf files - on_core_zero.elf and on_core_one.elf. If one of these is renamed to example.elf then debugging proceeds normally.
To Reproduce Installed plugins are the standard Raspberry Pi plugin for VS Code, and of course Cortex Debug. The required tools (Pico SDK etc.) are all installed. OpenOCD is installed using xPack to work around this issue. To set up the project I cloned the FreeRTOS Kernel and Community Examples into the same folder, and then selected (at random) the FreeRTOS-Community-Supported-Demos/CORTEX_M0+_RP2040/OnEitherCore folder to make the project. Having added this folder to the VS Code workspace the project was created and after setting some environment variables it builds fine.
setup.sh
Expected behavior
The debugger should debug the file mentioned in the executable section of launch.json
"executable": "${workspaceRoot}/build/on_core_zero.elf",
Environment (please complete the following information):
Launch.json:
Attach text from
Debug Console
Additional context This is my first step into debugging Pi FreeRTOS projects in C so any help gratefully received.