Test and Update ESP-IDF to Latest Versions

The ESP32 is a new chipset from Espressif Systems that is still under development. This is apparent from the fact that Espressif has not yet released the complete datasheet or technical reference data for the chip as of December 2016. In addition to software or firmware updates, Espressif is also releasing Silicon Erratas which indicate that the chip is yet to be debugged and verified fully. All of this makes it important to update ESP-IDF often.

While the continual releases of ESP-IDF make things easier and convenient by adding in good features, the problem that you may face is obvious - what if old programs fail to work with a newer version of ESP-IDF and what if you can no longer roll back?
Here is what we suggest to stay safe and also enjoy the latest features of the ESP-IDF!

If you are looking for tutorials to install and use ESP-IDF, please jump to our ESP32 Tutorials!

Safely Update ESP-IDF (Download Again)!

Assuming that you have modified your existing version of the ESP-IDF locally, or messed around with the structure of the ESP-IDF, it is not recommended that you pull a newer version of the ESP-IDF from GitHub. That might cause issues.

So we download a new copy of the latest ESP-IDF copy available on GitHub to a new folder:

  • Create a new folder (say, in Desktop):
    mkdir ~/Desktop/idf_new
  • Switch to that folder:
    cd ~/Desktop/idf_new
  • Download a fresh copy of the latest ESP-IDF version to this folder:
    git clone --recursive https://github.com/espressif/esp-idf.git

Now you should have the updated ESP-IDF in the new folder. The next step would be to temporarily switch to this new ESP-IDF for testing purposes.

update-esp-idf

Temporarily Switch to Updated ESP-IDF

A temporary switch to the new version of ESP-IDF is easy. All you have to do is configure the environment to use the files stored in the updated ESP-IDF instead of the stable, old release. To do this, you simply need to alter the ESP-IDF path environment variable!

  • Check the current ESP-IDF path:
    echo $IDF_PATH
    This will return the path of your current (not updated) ESP-IDF. If it returns a blank line, ignore it.
  • Set the new updated ESP-IDF path (new esp-idf folder in idf_new!) to this variable:
    export IDF_PATH=~/Desktop/idf_new/esp-idf

You are now set to use the new ESP-IDF for compiling your existing projects! You will see some new features as well when you go on to compile your existing projects. Some functions may no longer work, but you can simply close the terminal to switch back to your "stable" ESP-IDF without issues!

update-esp-idf-new-ethernet-secure-boot

Compile Programs with new ESP-IDF

Compilation procedure for compiling an example will be determined by the new version of ESP-IDF.
You may not need to use make menuconfig or some other commands. Some new commands may be added, please check Espressif ESP-IDF GitHub for more updated info.

Roll Back to old ESP-IDF Version

Something no longer works with the new ESP-IDF? A function definition has disappeared?
All you need to do to roll back to your old environment is - close the Linux terminal window!

Note that the process here requires that you set the variable IDF_PATH to the IDF location every time you open a new terminal to override the default value set in the bashrc file.

Found this article useful? SUBSCRIBE to our blog!

Ads:
 



Leave a Reply