If I understand, I can use ESP-IDF 5.3.1 APIs, but I got compiling errors when trying to do it.
I tried :
Serial.println("ESP-IDF version is: " + String(esp_get_idf_version()));
and I got
ESP-IDF version is: v4.4.7-dirty
Then I tried APIs from ESP-IDF 4.4.7 but they also gave a compile error.
I finally tried the APIs from ESP-IDF 3.3 and they worked. So, my question is, how can I set up the correct ESP-IDF version? I want to use the latest one.
Would you be able to provide your complete platformio.ini file? Also if you want help with the compile error, please provide that as well.
When you define your platform as espressif32@6.9.0 inside of your platformio.ini file that enables you to use framework as arduino, espidf, or arduino, espidf. I suspect you are aiming to use just Arduino, which will lock you to using V4.4.7 of ESP-IDF.
If you want to have support for more recent versions of ESP-IDF, you can look into using the open source platform pioarduino.
When using framework = arduino and platform = espressif32@6.9.0, you indeed get Arduino Core 2.0.17 which is based on ESP-IDF v4.4.7. That doesn’t meane that all components from there are included though. So which v.4.4.7 APIs have you tried exactly?
Also, when using framework = arduino, it’s best to use Arduino APIs for everything before resorting to ESP-IDF.