Problem with Installing toolchain-riscv32-esp on Windows 64-bit using PlatformIO for ESP32-WROOM-32 with ESP-IDF

Problem with Installing toolchain-riscv32-esp on Windows 64-bit using PlatformIO for ESP32-WROOM-32 with ESP-IDF

Hi everyone,

I am trying to build a project using PlatformIO with the ESP-IDF framework targeting the ESP32-WROOM-32 (board: esp32dev). However, I keep encountering the following error during build:

Tool Manager: Installing espressif/toolchain-riscv32-esp @ 8.4.0+2021r1
UnknownPackageError: Could not find the package with 'espressif/toolchain-riscv32-esp @ 8.4.0+2021r1' requirements for your system 'windows_amd64'

Why I am Doing This

  • I have some existing code that was working perfectly with older versions of PlatformIO and ESP-IDF.
  • I want to run that same code without modifying it.
  • The older versions did not require the RISC-V toolchain for ESP32-WROOM-32.
  • Therefore, I want to build using the older PlatformIO espressif32 platform version (like 3.4.0 or 4.3.0) to keep compatibility and avoid this toolchain error.

What I Have Tried

  • Specifying only the Xtensa toolchain explicitly in platformio.ini
  • Removing any RISC-V related components or libraries from the project
  • Clearing the PlatformIO cache and .pio folders
  • Reinstalling the espressif32 platform at various versions (including 3.4.0, 4.7.0)
  • Updating PlatformIO and its packages

Despite all these attempts, PlatformIO still tries to download and install the toolchain-riscv32-esp package, which is not available for Windows 64-bit.


Why This Is a Problem

  • The toolchain-riscv32-esp package is needed for ESP32-C3, ESP32-S2, and ESP32-H2 chips (which use RISC-V cores).
  • The ESP32-WROOM-32 chip uses the Xtensa architecture, and therefore should not require the RISC-V toolchain.
  • However, PlatformIO’s tool manager seems to forcibly install the RISC-V toolchain even when building for the ESP32-WROOM-32, causing the build to fail on Windows.

My platformio.ini

[env:esp32dev]
platform = espressif32@3.4.0
board = esp32dev
framework = espidf

platform_packages =
    toolchain-xtensa-esp32 @ 8.4.0+2021r1

Request for Help

  • How can I prevent PlatformIO from trying to install the RISC-V toolchain when building for ESP32-WROOM-32 on Windows?
  • Is there a known fix or workaround to avoid this error?
  • Should I downgrade or upgrade to a specific version of PlatformIO or the ESP-IDF platform to fix this?
  • Any suggestions on project structure or dependencies to avoid pulling in RISC-V components?

Thank you in advance!


Additional Information:

#Note

  • After uploading the projects from the GitHub link, the build succeeds but at runtime ESP32 shows continuous software reset (SW_CPU_RESET).
  • The same code was tested before and worked fine (outside PlatformIO).

Feel free to suggest any debugging steps or configuration changes!


If you want, I can also provide my full platformio.ini or project structure for further help.


Thank you! :folded_hands:

The currently available toolchains are listed in https://registry.platformio.org/tools/espressif/toolchain-riscv32-esp/versions.

On my computer, it already suffices to force

platform = espressif32@3.5.0

and put

platform_packages =
  espressif/toolchain-riscv32-esp@8.4.0+2021r2-patch5

at the end of the platformio.ini to install the next closest version, then ch2/my_first_project builds without errors. If the toolchain goes unused, there’s no need for that to be correct anyway. The way I read espidf.py, it’s only used for ESP32-C3 boards, so it’s actually a bug in those ealier versions that the RISC-V toolchain was still activated.

Linking .pio\build\az-delivery-devkit-v4\firmware.elf
Retrieving maximum program size .pio\build\az-delivery-devkit-v4\firmware.elf
Checking size .pio\build\az-delivery-devkit-v4\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   2.4% (used 12896 bytes from 532480 bytes)
Flash: [==        ]  15.6% (used 163353 bytes from 1048576 bytes)
Building .pio\build\az-delivery-devkit-v4\firmware.bin
esptool.py v3.1
Merged 2 ELF sections
=================================== [SUCCESS] Took 59.17 seconds =================================== 

Forcing the platform version onto a specific one is always a good idea for reproducability.