platformio / platform-espressif32

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

Example espidf-arduino-blink sketch not compiling #592

Closed AmberElferink closed 2 years ago

AmberElferink commented 3 years ago

The espidf-arduino-blink sketch will not compile: https://github.com/platformio/platform-espressif32/tree/develop/examples/espidf-arduino-blink

Steps to reproduce: Clone the platform-espressif32 github. Open the espidf-arduino-blink folder via PlatformIO in Visual Studio Code. Try to build the project by hitting the Build button in PlatformIO. No other changes were made.

Expected result: It compiles

Actual result:

.....
Compiling .pio\build\esp32dev\bootloader\xtensa\trax.o
Archiving .pio\build\esp32dev\bootloader\esp-idf\efuse\libefuse.a
Archiving .pio\build\esp32dev\bootloader\esp-idf\log\liblog.a
C:\Users\eempi\.platformio\packages\toolchain-xtensa32\bin\xtensa-esp32-elf-objdump: 'C:/CodeRepositories/SenseGlove/Arduino_ESP_merge/platform-espressif32/examples/espidf-arduino-blink/.pio/build/esp32dev/esp-idf/framework-arduinoespressif32-src-a8a830ef46fb935b080bfdf62a3092dd/libframework-arduinoespressif32-src-a8a830ef46fb935b080bfdf62a3092dd.a': No such file
Traceback (most recent call last):
  File "C:\Users\eempi\.platformio\packages\framework-espidf@3.40001.200521\tools\ldgen\ldgen.py", line 150, in <module>
    main()
  File "C:\Users\eempi\.platformio\packages\framework-espidf@3.40001.200521\tools\ldgen\ldgen.py", line 106, in main
    dump = StringIO(subprocess.check_output([objdump, "-h", library]).decode())
  File "C:\Users\eempi\.platformio\python3\lib\subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Users\eempi\.platformio\python3\lib\subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['C:\\Users\\eempi\\.platformio\\packages\\toolchain-xtensa32\\bin\\xtensa-esp32-elf-objdump', '-h', 'C:/CodeRepositories/SenseGlove/Arduino_ESP_merge/platform-espressif32/examples/espidf-arduino-blink/.pio/build/esp32dev/esp-idf/framework-arduinoespressif32-src-a8a830ef46fb935b080bfdf62a3092dd/libframework-arduinoespressif32-src-a8a830ef46fb935b080bfdf62a3092dd.a']' returned non-zero exit status 1.
*** [.pio\build\esp32dev\esp32.project.ld] Error 1
============================================================== [FAILED] Took 99.60 seconds ==============================================================

Environment    Status    Duration
-------------  --------  ------------
esp32dev       FAILED    00:01:39.599
========================================================= 1 failed, 0 succeeded in 00:01:39.599 ========================================================= 
The terminal process "C:\Users\eempi\.platformio\penv\Scripts\platformio.exe 'run', '--environment', 'esp32dev'" terminated with exit code: 1.
MikaelFerland commented 3 years ago

You can try to add that in your platformio.ini:

build_flags = 
    -D ARDUINO=100
    -D ESP32=1

Be careful if you make it works because you will get also this warning: Warning! Arduino framework as an ESP-IDF component doesn't handle the variant field! The default esp32 variant will be used.

So the depending on which board you are using the pins definition could be wrong. Also you may have other side effects.

I'm curious if anyone as a better solution. I mean by using the example out of the box with no build_flags and having the right pins definition.

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.