platformio / platform-espressif32

Espressif 32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif32
Apache License 2.0
904 stars 609 forks source link

Espressif 32 2.1.0 broke after reinstalling python #653

Closed jrHernandezSio closed 2 years ago

jrHernandezSio commented 2 years ago

Hi,

I have been using Espressif 32 2.1.0 on VSCODE IDE for a long time wihtout any problem.

I was having some trouble with python at flashing ESP32 devices outside the IDE and I have reinstalled python (from 3.8 to 3.10). So far so good, flashing outside IDE is working ok now.

Then, I opened my IDE. It did some auto-update before I could do anything: image After that I have linking problems.

Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (2.1.0) > Espressif ESP32 Dev Module
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 3.40100.200827 (4.1.0)
 - 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...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 18 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <pinout>

...

Building in release mode
Linking .pio\build\esp32dev\bootloader.elf
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x8): undefined reference to `bootloader_init'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0xc): undefined reference to `bootloader_reset'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x10): undefined reference to `bootloader_utility_load_boot_image_from_deep_sleep'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x18): undefined reference to `bootloader_utility_load_partition_table'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x1c): undefined reference to `esp_log_timestamp'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x24): undefined reference to `bootloader_utility_get_selected_boot_partition'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x28): undefined reference to `bootloader_common_get_reset_reason'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x2c): undefined reference to `bootloader_utility_load_boot_image'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o): in function `call_start_cpu0':
C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:33: undefined reference to `bootloader_init'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:34: undefined reference to `bootloader_reset'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:41: undefined reference to `bootloader_utility_load_boot_image_from_deep_sleep'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o): in function `select_partition_number':
C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:60: undefined reference to `bootloader_utility_load_partition_table'   
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:61: undefined reference to `esp_log_timestamp'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o): in function `selected_boot_partition':
C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:75: undefined reference to `bootloader_utility_get_selected_boot_partition'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:79: undefined reference to `bootloader_common_get_reset_reason'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o): in function `call_start_cpu0':
C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:53: undefined reference to `bootloader_utility_load_boot_image'        
collect2.exe: error: ld returned 1 exit status
Archiving .pio\build\esp32dev\lib2fd\libFOTA.a
Archiving .pio\build\esp32dev\lib3f9\libSCHEDULER.a
Archiving .pio\build\esp32dev\libbd1\libserial_interface.a
Archiving .pio\build\esp32dev\lib466\libSIM7020G.a
*** [.pio\build\esp32dev\bootloader.elf] Error 1
======================================================================================= [FAILED] Took 12.83 seconds =======================================================================================The terminal process "C:\Users\jr.hernandez\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

Anyone have faced anything similar?

Do you recommend to reinstall something on platformio or VSCODE?

Any help would be appreciated.

Regards, Ramon.

jrHernandezSio commented 2 years ago

After re-installing platforms 3.0.0 and 2.1.0 I have noticed that seems to be a build problem with the bootloader.

Linking .pio\build\esp32dev\bootloader.elf
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x8): undefined reference to `bootloader_init'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0xc): undefined reference to `bootloader_reset'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x14): undefined reference to `bootloader_utility_load_partition_table'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x18): undefined reference to `esp_log_timestamp'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x20): undefined reference to `bootloader_utility_get_selected_boot_partition'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x24): undefined reference to `bootloader_common_get_reset_reason'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o):(.literal.call_start_cpu0+0x28): undefined reference to `bootloader_utility_load_boot_image'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o): in function `call_start_cpu0':
C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:33: undefined reference to `bootloader_init'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:34: undefined reference to `bootloader_reset'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o): in function `select_partition_number':
C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:60: undefined reference to `bootloader_utility_load_partition_table'       
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:61: undefined reference to `esp_log_timestamp'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o): in function `selected_boot_partition':
C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:75: undefined reference to `bootloader_utility_get_selected_boot_partition'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:79: undefined reference to `bootloader_common_get_reset_reason'
c:/users/jr.hernandez/.platformio/packages/toolchain-xtensa32@2.80200.200827/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: .pio\build\esp32dev\bootloader\esp-idf\main\libmain.a(bootloader_start.c.o): in function `call_start_cpu0':
C:\Users\jr.hernandez\.platformio\packages\framework-espidf@3.40100.200827\components\bootloader\subproject\main/bootloader_start.c:53: undefined reference to `bootloader_utility_load_boot_image'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\bootloader.elf] Error 1
========================================================================================= [FAILED] Took 40.58 seconds =========================================================================================
The terminal process "C:\Users\jr.hernandez\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

I have tried also with a clean empty project, and same result.

With Espressif 3.0.0 There is no such error, but I am still with 2.1.0.

mbisso64 commented 2 years ago

Hi jrHernandezSio, did you ever get this issue resolved? I am having the exact same problem. And I have not modified anything on my code. After a week, I went back to VSCODE and the linker failed with the same errors. The only thing I can think of is that during the week, I install a logic analyzer software, PulseView, that is Python based and might have broken my Python install. I have removed VSCODE, PlatformIO, Esspressif IDF and Python. Cleaned up all the remaining files in the users directory (for platformio and espressif), restarted the computer and re-installed everything. Same deal...

Let me know if you have a solution. My next step is to re-format the drive and I want to avoid that.

Thanks, Mike.

jrHernandezSio commented 2 years ago

Hi,

I think the problem is related to some mismatch around the booloader source files and cmake, but I could not find the root cause.

At the end, the only thing that made it work was to update Espressif 32 to 3.0.0 or higher. I am currently using 3.3.2 and doing ok so far.

I hope this helps.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions.