Page 1 of 1
(solved) VS Code finding wrong toolchain
Posted: Fri Sep 10, 2021 12:59 am
by mzimmers
Hi -
I'm new to VS Code, and I'm sure I'm doing something wrong, but...in one of my project files, I include stdint.h. When I hover on it and hit F12, it opens a file from an ARM toolchain that I have installed, not the one I want. I realize this is some configuration error, but I can't find it. Can someone please advise?
Thanks...
Re: VS Code finding wrong toolchain
Posted: Fri Sep 10, 2021 6:20 am
by ESP_bignacio
Based on your feedback maybe is a misconfiguration of the C/C++ extension.
Try checking
https://github.com/espressif/vscode-esp ... URATION.md for examples how to configure.
If you are not using the Espressif extension, just {config:idf.*} for the real path or use the compile_commands.json if you are able to successfully build the project.
Re: VS Code finding wrong toolchain
Posted: Fri Sep 10, 2021 4:11 pm
by mzimmers
Thank you, bignacio. I created that file, and it seemed to solve the problem...temporarily. Then, I tried to build (got a bunch of errors that I expected) and now, it's finding the incorrect paths again. Any idea what's going on here?
Thanks...
EDIT: could the problem arise from the fact that I don't have an environment variable for IDF_TOOLS_PATH? I see the default for it (which is the correct path), but does the extension need this explicitly defined?
Re: VS Code finding wrong toolchain
Posted: Fri Sep 10, 2021 6:49 pm
by mzimmers
I found the problem: the default c_cpp_properties.json file that was generated didn't include this:
Code: Select all
"name": "ESP-IDF",
"compilerPath": "/home/mzimmers/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/
I discovered this omission by comparing with the blink project. The intellisense, and the builds, seem to find the correct toolchain now.
Shouldn't this code be included in the default file that is generated within the extension?
Re: VS Code finding wrong toolchain
Posted: Mon Sep 13, 2021 4:44 am
by ESP_bignacio
While the compiler path is not part of the template file within c_cpp_properties.json but it is set when you add the vscode configuration files using the extension when running:
1) Add vscode configuration folder command
2) New Project command
3) Show Examples Projects command
4) Create project from extension template command.
In the c_cpp_properties documentation we should add it though, thanks.