Reporting ESP IDF Version

Hello all,

I have recently updated my project to support the latest v4.0 ESP IDF release. The original project had been specifying the use of the espressif32 platform version 1.11.1. I have modified the platformio.ini file to now specify 1.12.4.

I noticed a few issues with the latest migration…

First, the call to esp_get_idf_version() is now returning the string “HEAD-HASH-NOTFOUND”. Apparently the latest framework is not capable of building the release version string.

Secondly, in an attempt to circumvent the first issue, I modified the code to reference the ESP_IDF_VERSION_MAJOR, ESP_IDF_VERSION_MINOR, and ESP_IDF_VERSION_PATCH definitions. I then noticed that the code is reporting a version of 4.0.0, when I expected it to report 4.0.1 according to the release documentation for the v1.12.4 framework. Is this a bug?

I began to investigate the nuances between each of the versions associated with a specifically selected framework. I believe the following illustrates the relationship between the components:

Espressif 32 Platform: 1.11.1 1.12.4
PlatformIO Repo Version: 3.30300.190916 3.40001.200521
Espressif ESP-IDF: 3.3 (LTS) 4.0

Since the currently supported version of the Espressif ESP-IDF is merely one component of a larger platform package, it would be nice to report the version of the Espressif 32 platform and/or the PlatformIO repository version on a splash screen of my firmware. This would leave no doubt as to which version of code was utilized to build the image. Is there another way to glean these details from the code programmatically, or do we simply need to wait for the issue with the esp_get_idf_version() call to be fixed?

Thanks in advance!
Mark

Hi @mark.blaha!

First, the call to esp_get_idf_version() is now returning the string “HEAD-HASH-NOTFOUND”. Apparently the latest framework is not capable of building the release version string.

The ESP-IDF build system retrieves this info using git describe command and we ship ESP-IDF package without internal .git folder that results in HEAD-HASH-NOTFOUND message. You can manually create a file called version.txt in the root of the ESP-IDF package and write the version in that file.

Secondly, in an attempt to circumvent the first issue, I modified the code to reference the ESP_IDF_VERSION_MAJOR, ESP_IDF_VERSION_MINOR, and ESP_IDF_VERSION_PATCH definitions. I then noticed that the code is reporting a version of 4.0.0, when I expected it to report 4.0.1 according to the release documentation for the v1.12.4 framework. Is this a bug?

It looks like the Espressif team forgot to increase the version in configuration files, so 4.0.1 is reported as 4.0.0

Hello valeros,

Thank you so much for the explanations for these issues!

While I could circumvent the short-comings of the recent release by modifying / adding files which were not included, these manual changes are very risky. If the system chooses to update the directory contents on the next build, the manual changes can be either lost or worse - they could remain and provide an inaccurate assessment of the true version used in a build.

Is there a plan to correct these issues with the next release?

Best Regards,
Mark