Installing several different versions of ESP-IDF in VS Code - particularly the tools!

Siddle34
Posts: 7
Joined: Mon Jul 01, 2024 4:37 am

Installing several different versions of ESP-IDF in VS Code - particularly the tools!

Postby Siddle34 » Tue Jul 30, 2024 9:13 am

Hello,

I am trying to install several different versions of the ESP-IDF framework in the VS Code IDE. This seems fairly trivial. I am installing them in different directories, naturally.

However, after each ESP-IDF framework download, I am asked whether I want to install the corresponding toolsets too, or use the existing toolset (typically saved in C:\Users\monster\.espressif).

Ideally, I want access to all the different versions of the toolsets that come with all the different versions of the ESP-IDF frameworks - because it seems obvious that one would want to match the toolset version to framework version, right? So what do I do? If, each time I'm asked whether I want to "install the tools, or use the existing tools" and I select "install the tools", will this simply overwrite the existing tools, thereby losing me access to whichever existing tools I'd already downloaded?

Should the toolsets therefore be saved in different directories? e.g. C:\Users\monster\.espressif-v5.3, C:\Users\monster\.espressif-v5.2.2, C:\Users\monster\.espressif-v5.1.4 and so on?

Thanks.

uC_Jon
Posts: 18
Joined: Fri Jan 05, 2024 7:03 pm

Re: Installing several different versions of ESP-IDF in VS Code - particularly the tools!

Postby uC_Jon » Tue Jul 30, 2024 4:20 pm

I'm fairly sure that you will get a different version of the python environment for each version of ESP-IDF in vscode.

And as as far as the tools (compilers/debugger/etc.) are concerned it may re-use some of them and/or create versions in the subdirectories under each tool such as .espressif/toolname/esp-longversionnumber.

The specific version(s) will then be pulled in by things such as the idf.paths or cpp compilerPath in a combination of the user; workspace; .vscode folder files.

As I work with the bleeding edge version of the idf I tend to rename the idf folder (using .bk and a number) and the .espressif folder and re-clone/re-install them every couple of months or so... occasionally this has meant that I have to manually edit the vscode settings to point to new .espressif/tool/version folders (because I clean slate). I guess I could have left the .espressif folder alone, but then it wouldn't flag up that the installed tools have changed (except for new project creations).

I think, but am not 100% sure, that the version of the tools (compiler etc) are less important as they are on the whole backwards compatible (excluding things like bug fixes) and older versions of the idf will (or can) use newer tools (breaking changes excepted).

It is also possible to store them in specific directories and access them using idf.CustomExtraPaths and idf.toolsPath (also not forgetting to change things like C_cpp_properties.json entries).

At the very least make a backup of your C\Users\monster\.espressif directory along with the directories for vscode (on linux, which I use, they are /home/username/.config/Code/ and /home/username/Code). I tend to backup/rename the three folders above and the esp-idf directory every time before updating. I also keep my code directories standalone outside of the esp-idf directory (I'm not sure if esp-idf handles in tree projects like some other code libraries do, but if it does: dont! Nothing worse than deleting an "old" development library and then realizing that your project was inside it).

Siddle34
Posts: 7
Joined: Mon Jul 01, 2024 4:37 am

Re: Installing several different versions of ESP-IDF in VS Code - particularly the tools!

Postby Siddle34 » Tue Jul 30, 2024 9:51 pm

Thanks.

Sounds sensible. I suspect I'll have to see how often the tools break. I've noticed it's not too bad with the main frameworks (the ESP-IDF frameworks), but I've been struggling to build examples from the likes of https://github.com/espressif/esp-iot-bridge and https://github.com/espressif/esp-iot-solution. The instructions for these projects/entities/thingummyjigs/whatchamacallits just do not work if interpreted literally.

They are obviously meant figuratively. Or perhaps I am not quite spiritually enlightened enough to grasp that the truly important question is not how but huh?

rbhagwat62
Posts: 3
Joined: Tue Jul 30, 2024 1:18 pm

Re: Installing several different versions of ESP-IDF in VS Code - particularly the tools!

Postby rbhagwat62 » Wed Jul 31, 2024 12:49 pm

I have installed two IDF version 4.3.1 and 5.2.1 in my VS code. I have given separate path for IDF and tool for particular version while installing it.

When I want switch between IDF I will go to configure ESP-IDF extension -> select existing setup it shows me two IDF version, selecting any one will get configured on VS code. I tried attaching image of VS code but I am unable to attach it here.

So selecting different path while installation should solved your issue. You can use one IDF version at a time though you created one more instance of VS code.

username
Posts: 526
Joined: Thu May 03, 2018 1:18 pm

Re: Installing several different versions of ESP-IDF in VS Code - particularly the tools!

Postby username » Wed Jul 31, 2024 1:10 pm

There is a portable version of VSC. You will want to use that.
This way you can create your own separate folders. Say ESP32_v4.4 & ESP32_v5.3.
Copy the portable version into each of these folders, and when you add the Espressif plugin choose the advanced install so you can choose what folder and version to install to. When you run VSC from that folder it will keep everything separate from other VSC installations.

Siddle34
Posts: 7
Joined: Mon Jul 01, 2024 4:37 am

Re: Installing several different versions of ESP-IDF in VS Code - particularly the tools!

Postby Siddle34 » Thu Aug 01, 2024 11:18 am

Thanks to all for clearing up my confusion. I see a pathway ahead.

Who is online

Users browsing this forum: No registered users and 74 guests