PlatformIO Community

Can't build for ESP32S3

Hi, I am having issues compiling for a new esp module ESP32-WROOM-1U. Looks like this is a S3 module.

I can build just fine using idf.py build

I am using esp-idf.

This is the output:

> Executing task: C:\Users\Someone\.platformio\penv\Scripts\platformio.exe run --target upload --target monitor --environment esp32s3box <

Processing esp32s3box (platform: espressif32; board: esp32s3box; framework: espidf)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32s3box.html
PLATFORM: Espressif 32 (4.4.0) > Espressif ESP32-S3-DevKitC-1
HARDWARE: ESP32S3 240MHz, 512KB RAM, 8MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, 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.40302.0 (4.3.2)
 - tool-cmake @ 3.16.4
 - tool-esptoolpy @ 1.30300.0 (3.3.0)
 - tool-idf @ 1.0.1
 - tool-mconf @ 1.4060000.20190628 (406.0.0)
 - tool-mkfatfs @ 2.0.1
 - tool-mklittlefs @ 1.203.210628 (2.3)
 - tool-mkspiffs @ 2.230.0 (2.30)
 - tool-ninja @ 1.9.0
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch3
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch3
KeyError: 'toolchain-xtensa-esp32':
  File "C:\Users\Someone\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 184:
    env.SConscript("$BUILD_SCRIPT")
  File "C:\Users\Someone\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\Someone\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\Someone\.platformio\platforms\espressif32\builder\main.py", line 283:
    target_elf = env.BuildProgram()
  File "C:\Users\Someone\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Util.py", line 742:
    return self.method(*nargs, **kwargs)
  File "C:\Users\Someone\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 63:
    env.ProcessProgramDeps()
  File "C:\Users\Someone\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Util.py", line 742:
    return self.method(*nargs, **kwargs)
  File "C:\Users\Someone\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 126:
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "C:\Users\Someone\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Util.py", line 742:
    return self.method(*nargs, **kwargs)
  File "C:\Users\Someone\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 346:
    SConscript(env.GetFrameworkScript(f), exports="env")
  File "C:\Users\Someone\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py", line 660:
    return method(*args, **kw)
  File "C:\Users\Someone\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py", line 597:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\Someone\.platformio\packages\tool-scons\scons-local-4.3.0\SCons\Script\SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\Someone\.platformio\platforms\espressif32\builder\frameworks\espidf.py", line 58:
    TOOLCHAIN_DIR = platform.get_package_dir(
  File "C:\Users\Someone\.platformio\penv\lib\site-packages\platformio\platform\_packages.py", line 32:
    pkg = self.get_package(name)
  File "C:\Users\Someone\.platformio\penv\lib\site-packages\platformio\platform\_packages.py", line 29:
    return self.pm.get_package(spec or self.get_package_spec(name))
  File "C:\Users\Someone\.platformio\penv\lib\site-packages\platformio\platform\_packages.py", line 21:
    owner=self.packages[name].get("owner"),
====================================================================================== [FAILED] Took 0.66 seconds ======================================================================================
The terminal process "C:\Users\Someone\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload', '--target', 'monitor', '--environment', 'esp32s3box'" terminated with exit code: 1.

This is the board file:

{
  "build": {
    "arduino":{
      "ldscript": "esp32s3_out.ld",
      "memory_type": "qspi_qspi"
    },
    "core": "esp32",
    "extra_flags": "-DBOARD_HAS_PSRAM",
    "f_cpu": "240000000L",
    "f_flash": "80000000L",
    "flash_mode": "dio",
    "mcu": "esp32s3",
    "variant": "esp32s3"
  },
  "connectivity": [
    "wifi"
  ],
  "debug": {
    "openocd_target": "esp32s3.cfg"
  },
  "frameworks": [
    "arduino",
    "espidf"
  ],
  "name": "Espressif ESP32-S3-DevKitC-1",
  "upload": {
    "flash_size": "16MB",
    "maximum_ram_size": 524288,
    "maximum_size": 8388608,
    "require_upload_port": true,
    "speed": 460800
  },
  "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html",
  "vendor": "Espressif"
}

Looks like some compiler package is corrupt. Remove all folders within C:\Users\Someone\.platformio\packages\ and retry. Does it throw the same error?

I’ve tried removing the whole .plartformio folder and reinstalling and it didn’t help.

I also tried removing esp-idf and python from the system but it looks like platformio don’t use that.

If I use esp32s2 and esp32 it passes that step, only happens with esp32s3.

I see. Then there is probably a bug in the builder script for ESP-IDF.

Just to confirm, when use open a CLI and execute pio platform update espressif32 and try and rebuild, the error is the same? If yes → issue to Issues · platformio/platform-espressif32 · GitHub

Since I just installed platformio there’s nothing to update. I tried the command, removed platformio cache, pio folder and build. Same error happens.

I’ll open a ticket in GitHub.

Thanks Max!

> pio platform update espressif32

WARNING!!! This command is deprecated and will be removed in the next releases.
Please use `pio pkg` instead.

Platform espressif32
--------
Platform Manager: espressif32@4.4.0 is already up-to-date
Tool Manager: framework-espidf@3.40302.0 is already up-to-date
Tool Manager: tool-cmake@3.16.4 is already up-to-date
Tool Manager: tool-esptoolpy@1.30300.0 is already up-to-date
Tool Manager: tool-idf@1.0.1 is already up-to-date
Tool Manager: tool-mconf@1.4060000.20190628 is already up-to-date
Tool Manager: tool-mkfatfs@2.0.1 is already up-to-date
Tool Manager: tool-mklittlefs@1.203.210628 is already up-to-date
Tool Manager: tool-mkspiffs@2.230.0 is already up-to-date
Tool Manager: tool-ninja@1.9.0 is already up-to-date
Tool Manager: toolchain-esp32s2ulp@1.22851.191205 is already up-to-date
Tool Manager: toolchain-esp32ulp@1.22851.191205 is already up-to-date
Tool Manager: toolchain-riscv32-esp@8.4.0+2021r2-patch3 is already up-to-date
Tool Manager: toolchain-xtensa-esp32@8.4.0+2021r2-patch3 is already up-to-date
Tool Manager: toolchain-xtensa-esp32s2@8.4.0+2021r2-patch3 is already up-to-date
Tool Manager: toolchain-xtensa-esp32s3@8.4.0+2021r2-patch3 is already up-to-date