Two diferents versions de esp-idf in diferents directories

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

Two diferents versions de esp-idf in diferents directories

Postby Nespressif » Wed Aug 23, 2023 5:51 pm

Hi all, I would like to know if I would have any problem if I install another version of esp-idf on my ubuntu computer (I am interested in testing with 5.1 stable). I think that if I save the repository in another directory, for example esp-idf51 and when I want to compile with this version I load the environment variables from that directory (having the correct version of python), I shouldn't have any problem.

This way I could continue working on my projects with the current 4.2 version and try things with 5.1.

Would there be any problem doing this?

Thanks
Last edited by Nespressif on Thu Aug 24, 2023 11:02 am, edited 2 times in total.

locustcox
Posts: 20
Joined: Tue Sep 04, 2018 9:36 pm

Re: Two version de esp-idf in diferents directories

Postby locustcox » Thu Aug 24, 2023 1:40 am

I’d highly recommend doing this inside a docker container. I just upgraded a large code base from 4.4 to 5.1 by using a devcontainer that was set up for esp-idf 5.1. Going back and forth between different IDF versions can be a big pain because of all the tool chain and python dependency issues.

ESP_frhr
Posts: 8
Joined: Tue Jan 10, 2023 10:41 am

Re: Two diferents versions de esp-idf in diferents directories

Postby ESP_frhr » Fri Aug 25, 2023 7:13 am

Hello,

I believe there should be no problem. Tools are properly versioned and python env is also based on esp-idf version. Meaning there should be no collision.

Let's say I have the esp-idf repository already cloned in the esp-idf directory.

Code: Select all

git clone --reference esp-idf --single-branch --branch release/v5.1 https://github.com/espressif/esp-idf.git esp-idf-v5.1
This will clone the release/v5.1 branch into esp-idf-v5.1 directory. The --reference option points to an existing esp-idf cloned reposiotry, to speed up the cloning. If you don't need the history, you can also --depth 1 to create a shallow clone. You can do this for multiple branches and have each release in separate repo/directory.

With this just change to the directory/version you want to work with(e.g. esp-idf-v5.1), run

Code: Select all

./install.sh && . ./export.sh
and it should be all set. At least this seems to be working for me. HTH

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

Re: Two diferents versions de esp-idf in diferents directories

Postby Nespressif » Fri Aug 25, 2023 11:36 am

All right, I'll give it a try, I think it should be fine too.

Thank you both very much for your answers.

Best regards,

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

Re: Two diferents versions de esp-idf in diferents directories

Postby Nespressif » Thu Sep 28, 2023 8:59 am

Hi all, for what it's worth, I have managed to install the esp-idf-v5.1 environment in another directory and make it work independently from the 4.2 version I had before. When I want to use one and the other I run . ./export.sh from the directory of the chosen version.
I have had to upgrade python to 3.8 and cmake to 3.29, but everything seems to be fine.
My OS is ubuntu 18.
Greetings to all.

Who is online

Users browsing this forum: Gaston1980 and 230 guests