Espressif 32 3.3.5 -> 4.3.1

I probably don’t understand something, please help.
In PIO home i see Espressif 32 platform with the most recent IDF version 3.3.5. But there’s 4.3.1 available: Release ESP-IDF Release v4.3.1 · espressif/esp-idf · GitHub
Are these different versions? How could I check? I tried printf("IDF version: %s\n", esp_get_idf_version()); and got IDF version: v3.3.5-1-g85c43024c
Also, in the “updates” I observe:

Updating platformio/contrib-piohome           3.3.4 @ ~3.3.4                     [Up-to-date]
Updating platformio/tool-scons                4.40200.0 @ ~4.40200.0             [Up-to-date]

Platform Manager
================
Platform espressif32
--------
Updating platformio/espressif32               3.3.2                              [Up-to-date]
Updating platformio/toolchain-xtensa32        2.50200.97 @ ~2.50200.0            [Up-to-date]
Updating platformio/framework-arduinoespressif32 3.10006.210326 @ ~3.10006.0        [Up-to-date]
Updating platformio/tool-esptoolpy            1.30100.210531 @ ~1.30100.0        [Up-to-date]
Updating platformio/tool-mkspiffs             2.230.0 @ ~2.230.0                 [Up-to-date]

Platform espressif32
--------
Updating git+https://github.com/platformio/platform-espressif32.git 3.3.2+sha.1e0f147                  [Up-to-date]
Updating platformio/toolchain-xtensa32        2.50200.97 @ ~2.50200.0            [Up-to-date]
Updating platformio/framework-arduinoespressif32 3.10006.210326 @ ~3.10006.0        [Up-to-date]
Updating platformio/tool-esptoolpy            1.30100.210531 @ ~1.30100.0        [Up-to-date]
Updating platformio/tool-mkspiffs             2.230.0 @ ~2.230.0                 [Up-to-date]

A small update. Here’s the esp_idf_version.h that comes with PIO package:


/** Major version number (X.x.x) */
#define ESP_IDF_VERSION_MAJOR   3
/** Minor version number (x.X.x) */
#define ESP_IDF_VERSION_MINOR   3
/** Patch version number (x.x.X) */
#define ESP_IDF_VERSION_PATCH   5

Here’s the same file from the latest IDF release:


/** Major version number (X.x.x) */
#define ESP_IDF_VERSION_MAJOR   4
/** Minor version number (x.X.x) */
#define ESP_IDF_VERSION_MINOR   3
/** Patch version number (x.x.X) */
#define ESP_IDF_VERSION_PATCH   1

Please help - how could I use the latest version? I see it mentioned in the “releases”,that PIO esp32 platform uses idf 4. Why there’s 3.3.5 then?

Are you using the Arduino framework for ESP32 or the ESP-IDF framework?

The Arduino framework for ESP32 builds on top of ESP-IDF but is tied to a specific version of it. If you use the Arduino framework, the ESP-IDF version will indeed be 3.3.x. A newer version has been released by Espressif and will likley appear in PlatformIO soon. It is based on ESP-IDF 4.4 (yes, on an unreleased version).

If you do not use the Arduino framework but just the underlying ESP-IDF framework, then PlatformIO will use version 4.3 if you don’t specify anything else.

Well, thank you, got it.
I use both, arduino and espressif idf, but this test has been made using arduino. Will check bare idf as well. Could you please tell me, is it possible to use the latest arduino core version manually? Like, providing link to the repo in the platformio.ini, or something alike?

I’m afraid I don’t know. It often works for minor version upgrades. But this is a major upgrade. So I don’t expect it to work.

Well, guys from the esp32 arduino core team advise to do the following steps:

  1. Add upstream as a platform:
platform=https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
  1. add required framework as a platform package, like:
platform_packages =
   	framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git#2.0.0