Running different ESP-IDF versions side-by-side

RMandR
Posts: 75
Joined: Mon Oct 29, 2018 3:13 pm

Running different ESP-IDF versions side-by-side

Postby RMandR » Mon Dec 06, 2021 10:13 pm

What's the process for running multiple versions of the ESP-IDF on the same machine?

We'd like to start the upgrade process to 4.3.1 but don't want to break the existing production build env.

I was told it was as simple as having a separate ESP-IDF directory and path env. Don't think things are that simple anymore.

I get errors when trying to build which maybe related to the "Not using..." lines below:

Code: Select all

Setting IDF_PATH: C:\Users\user\esp\ESP-IDF-4.3

Adding ESP-IDF tools to PATH...
Not using an unsupported version of tool xtensa-esp32-elf found in PATH: esp-2019r2-8.2.0.
Not using an unsupported version of tool esp32ulp-elf found in PATH: 2.28.51.20170517.
Not using an unsupported version of tool cmake found in PATH: 3.13.4.
Not using an unsupported version of tool openocd-esp32 found in PATH: v0.10.0-esp32-20190313.
Not using an unsupported version of tool ninja found in PATH: 1.9.0.
    C:\Users\user\.espressif\tools\xtensa-esp32-elf\esp-2021r1-8.4.0\xtensa-esp32-elf\bin
    C:\Users\user\.espressif\tools\xtensa-esp32s2-elf\esp-2021r1-8.4.0\xtensa-esp32s2-elf\bin
    C:\Users\user\.espressif\tools\xtensa-esp32s3-elf\esp-2021r1-8.4.0\xtensa-esp32s3-elf\bin
    C:\Users\user\.espressif\tools\riscv32-esp-elf\esp-2021r1-8.4.0\riscv32-esp-elf\bin
    C:\Users\user\.espressif\tools\esp32ulp-elf\2.28.51-esp-20191205\esp32ulp-elf-binutils\bin
    C:\Users\user\.espressif\tools\esp32s2ulp-elf\2.28.51-esp-20191205\esp32s2ulp-elf-binutils\bin
    C:\Users\user\.espressif\tools\cmake\3.16.4\bin
    C:\Users\user\.espressif\tools\openocd-esp32\v0.10.0-esp32-20210401\openocd-esp32\bin
    C:\Users\user\.espressif\tools\ninja\1.10.2\
    C:\Users\user\.espressif\tools\dfu-util\0.9\dfu-util-0.9-win64
    C:\Users\user\.espressif\python_env\idf4.3_py3.7_env\Scripts
    C:\Users\user\esp\ESP-IDF-4.3\tools

Checking if Python packages are up to date...
Python requirements from C:\Users\user\esp\ESP-IDF-4.3\requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

  idf.py build


ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Running different ESP-IDF versions side-by-side

Postby ESP_igrr » Mon Dec 06, 2021 10:49 pm

Hi RMandR,

Having multiple versions of IDF installed side by side should generally be possible. If you are on Windows, the installer will create a shortcut to launch each version of ESP-IDF which you install.

If you are still having issues, please post the errors which you are getting during the build (a full log as an attachment is preferred).

RMandR
Posts: 75
Joined: Mon Oct 29, 2018 3:13 pm

Re: Running different ESP-IDF versions side-by-side

Postby RMandR » Wed Dec 08, 2021 8:57 pm

Having multiple versions of IDF installed side by side should generally be possible. If you are on Windows, the installer will create a shortcut to launch each version of ESP-IDF which you install.

@ESP_igrr the old cmd shortcut for 4.0 looked like this:

Code: Select all

C:\Windows\system32\cmd.exe /k ""C:\Users\user\.espressif\idf_cmd_init.bat" "C:\Users\user\AppData\Local\Programs\Python\Python37\" "C:\Program Files\Git\cmd\""
The 4.3.1 shortcut looks like:

Code: Select all

C:\WINDOWS\system32\cmd.exe /k ""C:\Users\user\.espressif\idf_cmd_init.bat" esp-idf-69104666954ee17650e4a0fa19c8d28c"
It looks like the structure of idf_cmd_init.bat has changed and expecting different command args. When I run the old shortcut I get the following error:

Code: Select all

The syntax of the command is incorrect.
And obviously, I can no longer build in V4.0.

RMandR
Posts: 75
Joined: Mon Oct 29, 2018 3:13 pm

Re: Running different ESP-IDF versions side-by-side

Postby RMandR » Wed Dec 08, 2021 9:20 pm

Added a new manual entry for idf_env and it seems to be going now.

phatpaul
Posts: 109
Joined: Fri Aug 24, 2018 1:14 pm

Re: Running different ESP-IDF versions side-by-side

Postby phatpaul » Wed Jul 13, 2022 6:49 pm

I prefer to have esp-idf as a git submodule within my projects so I can control the exact version between projects and across build machines.

On idf 3.x with make I have a bash script within each project which sets the IDF_PATH and runs the build.
esp-idf is checked out as git submodule at:
repo-root\tools\esp-idf\
build script:
repo-root\project\BUILD.sh"

Code: Select all

export IDF_PATH=${PWD}/tools/esp-idf
Is there a suggested workflow like this on idf 4.x with Cmake and the new idf.py? Is there a good reason not to do it this way?

Who is online

Users browsing this forum: Majestic-12 [Bot] and 129 guests