ESPIDF framework will not build with ESP32S33

Hi
A couple of us using UM_ProS3 boards are trying to get into ESP-IDF on PIO.
We are able to build the example ‘espidf-aws-iot’ ok with the esp32dev, but when adding an environment for any ESP32-S3 we get the same error message:

  C:/Users/mick/.platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-gcc.exe
  version 12.2.0 is not the supported version 8.4.0.  Check Getting Started
  documentation or proceed at own risk.

yet in plaformio.ini we have:

[env:esp32dev]
platform = espressif32
framework = espidf
board = esp32dev
monitor_speed = 115200
monitor_filters = colorize
board_build.embed_txtfiles = 
	src/certs/private.pem.key
	src/certs/certificate.pem.crt
	src/certs/aws-root-ca.pem
platform_packages = 
	framework-espidf @ ~3.40403.0
	toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5

[env:um_pros3]

platform = espressif32
board = um_pros3
framework = espidf
monitor_speed = 115200
monitor_filters = colorize
board_build.embed_txtfiles = 
	src/certs/private.pem.key
	src/certs/certificate.pem.crt
	src/certs/aws-root-ca.pem
platform_packages = 
	framework-espidf @ ~3.40403.0
	toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5

Both specifically require

toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5

Yet we get the following pass and fail messages:

Building .pio\build\esp32dev\bootloader.bin
esptool.py v4.5.1
Creating esp32 image...
Merged 1 ELF section
Successfully created esp32 image.
Linking .pio\build\esp32dev\firmware.elf
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   9.3% (used 30488 bytes from 327680 bytes)
Flash: [=======   ]  70.5% (used 738977 bytes from 1048576 bytes)
Building .pio\build\esp32dev\firmware.bin
esptool.py v4.5.1
Creating esp32 image...
Merged 25 ELF sections
Successfully created esp32 image.
============================================================================================================================================================================= [SUCCESS] Took 608.58 seconds =============================================================================================================================================================================

Processing um_pros3 (platform: espressif32; board: um_pros3; framework: espidf)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/um_pros3.html
PLATFORM: Espressif 32 (6.5.0) > Unexpected Maker PROS3
HARDWARE: ESP32S3 240MHz, 320KB RAM, 16MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, 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 @ 3.40403.0 (4.4.3)
 - tool-cmake @ 3.16.4
 - tool-esptoolpy @ 1.40501.0 (4.5.1)
 - tool-idf @ 1.0.1
 - tool-mconf @ 1.4060000.20190628 (406.0.0) 
 - tool-ninja @ 1.9.0
 - tool-riscv32-esp-elf-gdb @ 11.2.0+20220823
 - tool-xtensa-esp-elf-gdb @ 11.2.0+20230208
 - toolchain-esp32ulp @ 1.23500.220830 (2.35.0)
 - toolchain-riscv32-esp @ 12.2.0+20230208
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
 - toolchain-xtensa-esp32s3 @ 12.2.0+20230208
Reading CMake configuration...
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s3
-- Project sdkconfig file C:/Users/mick/Documents/PlatformIO/Projects/240317-153505-espidf-aws-iot/sdkconfig.um_pros3
Loading defaults file C:/Users/mick/Documents/PlatformIO/Projects/240317-153505-espidf-aws-iot/sdkconfig.defaults...

-- Configuring incomplete, errors occurred!
See also "C:/Users/mick/Documents/PlatformIO/Projects/240317-153505-espidf-aws-iot/.pio/build/um_pros3/CMakeFiles/CMakeOutput.log".

fatal: not a git repository (or any of the parent directories): .git
CMake Warning at C:/Users/mick/.platformio/packages/framework-espidf@3.40403.0/tools/cmake/crosstool_version_check.cmake:8 (message):
  Toolchain
  C:/Users/mick/.platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-gcc.exe
  version 12.2.0 is not the supported version 8.4.0.  Check Getting Started
  documentation or proceed at own risk.

Call Stack (most recent call first):
  C:/Users/mick/.platformio/packages/framework-espidf@3.40403.0/components/esp_common/project_include.cmake:6 (gcc_version_check)
  C:/Users/mick/.platformio/packages/framework-espidf@3.40403.0/tools/cmake/build.cmake:325 (include)
  C:/Users/mick/.platformio/packages/framework-espidf@3.40403.0/tools/cmake/build.cmake:532 (__build_process_project_includes)
  C:/Users/mick/.platformio/packages/framework-espidf@3.40403.0/tools/cmake/project.cmake:384 (idf_build_process)
  CMakeLists.txt:6 (project)


CMake Error at C:/Users/mick/.platformio/packages/framework-espidf@3.40403.0/tools/cmake/crosstool_version_check.cmake:37 (message):
  

  Toolchain:
  C:/Users/mick/.platformio/packages/toolchain-xtensa-esp32s3/bin/xtensa-esp32s3-elf-gcc.exe,
  crosstool-ng version esp-12.2.0_20230208 doesn't match supported version
  esp-2021r2-patch5

  Please try to run 'idf.py fullclean' to solve it quickly.

  Check Getting Started documentation if the error continues.

  You can override this error and proceed with build by defining the
  IDF_MAINTAINER environment variable.

Call Stack (most recent call first):
  C:/Users/mick/.platformio/packages/framework-espidf@3.40403.0/components/esp_common/project_include.cmake:7 (crosstool_version_check)
  C:/Users/mick/.platformio/packages/framework-espidf@3.40403.0/tools/cmake/build.cmake:325 (include)
  C:/Users/mick/.platformio/packages/framework-espidf@3.40403.0/tools/cmake/build.cmake:532 (__build_process_project_includes)
  C:/Users/mick/.platformio/packages/framework-espidf@3.40403.0/tools/cmake/project.cmake:384 (idf_build_process)
  CMakeLists.txt:6 (project)



============================================================================================================================================================================== [FAILED] Took 27.98 seconds ==============================================================================================================================================================================

Environment    Status    Duration
-------------  --------  ------------
esp32dev       SUCCESS   00:10:08.585
um_pros3       FAILED    00:00:27.983

I have deleted and reloaded ESP32 packages and done clean builds with no improvement

You see that? The ESP32S3 based environment (board = um_pros3) has both toolchains in it, the first one from your injected one

And the latter one from what the platform (espressif32) wants to use.

You would have to overwrite toolchain-xtensa-esp32s3 in that environment, see here.

However, all of this seems very weird. You’re explicitly downgrading the ESP-IDF and compiler version. Are you sure you don’t just want to work with the current version, ESP-IDF v5.1.2?

A safer way to use the older 4.4.3 version would be to pick a matching espressif32 platform version that uses that ESP-IDF version, that is, 5.3.0

So, in any of these two cases I would suggest refactoring it to become

; common settings
[env]
; @5.3.0: ESP-IDF v4.4.3 (old)
; @6.5.0: ESP-IDF v5.1.2 (latest)
platform = espressif32@5.3.0
framework = espidf
monitor_speed = 115200
monitor_filters = colorize
board_build.embed_txtfiles = 
	src/certs/private.pem.key
	src/certs/certificate.pem.crt
	src/certs/aws-root-ca.pem

[env:esp32dev]
board = esp32dev

[env:um_pros3]
board = um_pros3

Hi Max
Thank you so much! Great work as always!
As a newb to this environment/framework, I guessed the examples would work/be up to date - perhaps I missed an update earlier!?

Ohh I now see where you’re coming from. You’re looking at

It may be that they didn’t want to remove the example from the platform because you technically can use an older ESP-IDF version in the even the most current platform. However, I would consider that outdated, since the latest version of espressif/esp-aws-iot explicitly added IDF v5 support. The example hasn’t been touched in a year, but is still valid stand-alone, and for ESP32S3 ones if you manage toolchain-xtensa-esp32s3 correctly.

Thanks again Max!
I recreated the example and saw the warning - I don’t know how I missed it and deleted it!

# IDF v5 is not supported by ASW-IoT SDK