Problems with ESP32 IDF old versions and CMake configuration when upgrating

Hello,

I am starting with platformio with the ESP32 IDF Framework. I have updated everything with PIO update and PIO upgrade to I guess everything is up to date.

I start noticing that non of the examples in the web for Esp32 IDF was working to me since I was running a very old framework version. Many defines are not included in the old versions of the framework and things like that.

On the other hand the included platformio examples were working and compiling properly.

Now I am running the esp-idf example and I want to add some i2s functions. Facing that I have and old framework version. I have updated to the version 4.0 and I get this errors:

CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/wemos_d1_mini32.html
PLATFORM: Espressif 32 (2.1.0) > WeMos D1 MINI ESP32
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-espidf 1.1.0+sha.5630b17
 - tool-cmake 3.16.4
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - tool-idf 1.0.1
 - tool-mconf 1.4060000.20190628 (406.0.0)
 - tool-ninja 1.9.0
 - toolchain-esp32ulp 1.22851.191205 (2.28.51) 
 - toolchain-xtensa32 2.80200.200827 (8.2.0)
Reading CMake configuration...
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Configuring incomplete, errors occurred!
See also "C:/Users/Jose/Documents/PlatformIO/Projects/esp32_i2c/.pio/build/wemos_d1_mini32/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Jose/Documents/PlatformIO/Projects/esp32_i2c/.pio/build/wemos_d1_mini32/CMakeFiles/CMakeError.log".

CMake Error at CMakeLists.txt:2 (include):
  include could not find load file:

    C:\Users\Jose\.platformio\packages\framework-espidf@src-189c8163b4bbf6bc160fabd68811c850/tools/cmake/project.cmake


CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_C_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

My CmakeList.txt is:

# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(sd_card)

and plaformio.init is:

[env]
platform = espressif32
framework = espidf
monitor_speed = 115200

[env:esp32thing]
board = esp32thing

Any idea what is happening?

Thanks!

I have the same problem!!!
After updated to esp-idf V4.0

Any ideas?

TIA

Solved: in my case it was easy: the folder of the esp-idf was not the correct in the IDF_PATH environment variable.
Hope it helps.