Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alire's toolchain not properly set for debugging in VSCode #1143

Open
Joebeazelman opened this issue Apr 22, 2023 · 5 comments
Open

Alire's toolchain not properly set for debugging in VSCode #1143

Joebeazelman opened this issue Apr 22, 2023 · 5 comments
Assignees

Comments

@Joebeazelman
Copy link

While trying to debug a microcontroller project, VSCode launches the debugger from another toolchain path instead of the project's toolchain path set by Alire. When I inspect the toolchain prefix environment variables in the terminal, it's not set. When I eval $(alr printenv), the debugger launches correctly.

As an added note, I tried to see if it would work by launching vscode using "alr edit" and it didn't open my project. I'm not sure if this is a bug or if there's something wrong with my configuration.

@reznikmm
Copy link
Member

@Joebeazelman What extension do you use for debug?

As a workaround you can set correct PATH environment variable in the workspace

@Joebeazelman
Copy link
Author

I'm using cortex-debug. Is this recommended for debugging microcontroller firmware?

@AnthonyLeonardoGracio
Copy link
Collaborator

I'm using cortex-debug. Is this recommended for debugging microcontroller firmware?

@Joebeazelman we can't help on that unfortunately, it really depends on the microcontrollier.

Regards,

@JCGobbi
Copy link

JCGobbi commented Jan 26, 2024

If you still need this information ...
You need to create a launch.json file inside .vscode occult folder to debug with VSCode. Here is a simple example for the cortex-debug plugin:

{
   // Use IntelliSense to learn about possible attributes.
   // Hover to view descriptions of existing attributes.
   // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
   "version": "0.2.0",
   "configurations": [
      {
         "type": "cortex-debug",
         "name": "Ada: Debug (cortex-debug/ST-Util) main - src/blocking/demo_string.adb",
         "request": "launch",
         "cwd": "${workspaceFolder}",
         "executable": "${workspaceFolder}/exec/string_polling.elf",
         "svdPath": "${workspaceFolder}/STM32F429.svd",
         "servertype": "stutil",
         "v1": false,
         "serverArgs": ["--connect-under-reset --semihosting"],
         "preLaunchTask": "ada: Build current project",
         "armToolchainPath": "",
         "gdbPath": "arm-eabi-gdb",
         "showDevDebugOutput": "raw"
      }
   ]
}

"name" is anyone you choose,
"executable" is the file you will use to flash your program into your board,
"svdPath" is the SVD file of the microprocessor of your board,
"servertype" is the debug server you are using that, in this case, is from ST-Link,
"gdbPath" is the debugger for your microprocessor, that in this case is in the PATH, if not you must put the full path.

You may get full information at cortex-debug.

@Joebeazelman
Copy link
Author

I figured out the problem. There was something wrong with the gdb I was using. I switched to the official ARM gdb and I worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants