ESP32 xtensa-esp32-elf/bin/ld.exe fails on windows

Hi there!

I get this on windows: (VSCODE)

Linking .pio\build\esp32_omotor_drv_r14\bootloader.elf
c:/users/glmne/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find -lUsersglmne.platformiopackagesframework-espidf@3.40001.200521componentsxtensaesp32libhal
collect2.exe: error: ld returned 1 exit status
Archiving .pio\build\esp32_omotor_drv_r14\lib99c\libota_logs.a
Archiving .pio\build\esp32_omotor_drv_r14\libe5b\libota_server.a
*** [.pio\build\esp32_omotor_drv_r14\bootloader.elf] Error 1
=========================================================== [FAILED] Took 12.39 seconds ===========================================================
Environment           Status    Duration
--------------------  --------  ------------
esp32_omotor_drv_r14  FAILED    00:00:12.391

platformio.ini relevant parts are:

[env]
platform = espressif32@1.12.2
framework = espidf
board = esp32doit-devkit-v1
monitor_speed = 115200
monitor_filters = time, esp32_exception_decoder
board_build.partitions = partitions.csv
upload_speed = 921600

[env:esp32_omotor_drv_r14]
build_flags =
    ${env.build_flags}
    -DPESPAGV_OMOTOR_DRV
    -DPESPAGV_IP=192.168.2.21
    -DPESPAGV_PORT=4081
    -DPESPAGV_BOARD_REV=14

It does work on windows wsl2 ubuntu 20 (clean pio cli only install)

I reproduced this issue in two windows machines. I tried deleting the %USER%/.platformio folder and even uninstalling the Platformio IDE plugin from VSCODE

This version is two major versions behind the current 3.4.0 platform and >1,5 years old. Maybe recent PlatformIO core versions have accidentally broke compatibility with it.

Per Releases · platformio/platform-espressif32 · GitHub there are two minor versions without a change of the ESP-IDF version, 1.12.4. Does that fail in the same way?

If it’s not acceptable to make your project use the newest platform-espressif32 version with ESP-IDF 4.3.1, you should open an issue at Issues · platformio/platform-espressif32 · GitHub and describe your problem there.

Thanks for the idea, unfortunately it gives the same result. I have a clean project which works with latest espressif@3.4.0 so will upgrade my project to work with that.