Open henriterhofte opened 1 year ago
This does not look correct: framework-arduinoespressif32 @ 0.0.0+sha.caef400
when i update the platformio.ini file to the latest arduino version, this is the output:
- framework-arduinoespressif32 @ 3.20006.221224 (2.0.6)
- tool-esptoolpy @ 1.40400.0 (4.4.0)
- toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 43 compatible libraries
Scanning dependencies...
Dependency Graph
|-- AsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.0.0
| |-- AsyncTCP-esphome @ 2.0.0
| |-- FS @ 2.0.0
| |-- WiFi @ 2.0.0
|-- ESPAsync_WiFiManager @ 1.9.8
| |-- ESP Async WebServer @ 1.2.3
| | |-- FS @ 2.0.0
| | |-- AsyncTCP-esphome @ 2.0.0
| | |-- WiFi @ 2.0.0
| |-- ESP_DoubleResetDetector @ 1.2.1
| |-- DNSServer @ 2.0.0
| | |-- WiFi @ 2.0.0
| |-- WiFi @ 2.0.0
|-- eModbus @ 1.6.0
| |-- AsyncTCP-esphome @ 2.0.0
|-- ESP Async WebServer @ 1.2.3
| |-- FS @ 2.0.0
| |-- AsyncTCP-esphome @ 2.0.0
| |-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
| |-- WiFi @ 2.0.0
|-- Preferences @ 2.0.0
|-- SPIFFS @ 2.0.0
| |-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
Building in release mode
Try deleting the files in the .pio folder, this will let platformio re-download packages
here is my current platformio.ini file for this project:
description = Sensorbox 2 with web interface
default_envs = release
[env]
platform = espressif32
board = esp32dev
framework = arduino
upload_port = COM5
monitor_port = COM5
monitor_speed = 115200
upload_speed = 2000000
board_build.f_flash = 80000000L
board_build.flash_mode = dio
lib_ignore =
AsyncTCP
LittleFS_esp32
Hash
ESP8266WiFi
lib_deps =
esphome/AsyncTCP-esphome @ 2.0.0
esphome/ESPAsyncWebServer-esphome @ 3.0.0
khoih-prog/ESPAsync_WiFiManager@1.9.8
miq19/eModbus @ 1.6.0
monitor_filters = esp32_exception_decoder
board_build.partitions = partitions_custom.csv
[env:release]
build_flags =
-DLOG_LEVEL=5
Short:
Your platformio.ini file (with [platformio]
added as a first line) resolves the framework-arduinoespressif32 @ 0.0.0+sha.caef400
error, but now I'm stuck with the missing bootloader error, which was also reported in issue 36.
I even uninstalled and re-installed PlatformIO and Visual Studio Code and updated esptool.py to version 4.4.0, but I got the same result.
In more detail. Deleting the files in the .pio folder seems to have the same effect as usung the 'Clean All' option in the left PlatformIO menu in VSCode:
* Executing task: C:\Users\henrgi\.platformio\penv\Scripts\platformio.exe run --target cleanall --environment release
Processing release (platform: espressif32; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------
Removing .pio\build\release
Removing .pio\libdeps\release
Done cleaning
======================================================== [SUCCESS] Took 0.76 seconds ========================================================
* Terminal will be reused by tasks, press any key to close it.
After changing the platformio.ini file to this content:
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[platformio]
description = Sensorbox 2 with web interface
default_envs = release
[env]
platform = espressif32
board = esp32dev
framework = arduino
upload_port = COM5
monitor_port = COM5
monitor_speed = 115200
upload_speed = 2000000
board_build.f_flash = 80000000L
board_build.flash_mode = dio
lib_ignore =
AsyncTCP
LittleFS_esp32
Hash
ESP8266WiFi
lib_deps =
esphome/AsyncTCP-esphome @ 2.0.0
esphome/ESPAsyncWebServer-esphome @ 3.0.0
khoih-prog/ESPAsync_WiFiManager@1.9.8
miq19/eModbus @ 1.6.0
monitor_filters = esp32_exception_decoder
board_build.partitions = partitions_custom.csv
[env:release]
build_flags =
-DLOG_LEVEL=5
The proper arduino framework seems to be used, i.e. framework-arduinoespressif32 @ 2.0.6+sha.57b27cd
...
However, I get the error *** [.pio\build\release\bootloader.bin] Source
C:\Users\henrgi.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32\bin\bootloader__80m.elf' not found, needed by target .pio\build\release\bootloader.bin'.
More details:
* Executing task: C:\Users\henrgi\.platformio\penv\Scripts\platformio.exe run --environment release
Processing release (platform: espressif32; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------
Library Manager: Installing esphome/AsyncTCP-esphome @ 2.0.0
Unpacking [####################################] 100%
Library Manager: AsyncTCP-esphome@2.0.0 has been installed!
Library Manager: Installing esphome/ESPAsyncWebServer-esphome @ 3.0.0
Unpacking [####################################] 100%
Library Manager: ESPAsyncWebServer-esphome@3.0.0 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing khoih-prog/ESPAsync_WiFiManager @ 1.9.8
Unpacking [####################################] 100%
Library Manager: ESPAsync_WiFiManager@1.9.8 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing me-no-dev/AsyncTCP @ >=1.1.1
Unpacking [####################################] 100%
Library Manager: AsyncTCP@1.1.1 has been installed!
Library Manager: Installing me-no-dev/ESP Async WebServer @ >=1.2.3
Unpacking [####################################] 100%
Library Manager: ESP Async WebServer@1.2.3 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing khoih-prog/ESP_DoubleResetDetector @ >=1.2.1
Unpacking [####################################] 100%
Library Manager: ESP_DoubleResetDetector@1.3.2 has been installed!
Library Manager: Installing lorol/LittleFS_esp32 @ >=1.0.6
Unpacking [####################################] 100%
Library Manager: LittleFS_esp32@1.0.6 has been installed!
Library Manager: Installing miq19/eModbus @ 1.6.0
Unpacking [####################################] 100%
Library Manager: eModbus@1.6.0 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing git+https://github.com/maxgerhardt/Ethernet.git
git version 2.36.1.windows.1
Cloning into 'C:\Users\henrgi\.platformio\.cache\tmp\pkg-installing-71oiexs7'...
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (47/47), done.
remote: Compressing objects: 100% (40/40), done.
remote: Total 47 (delta 4), reused 19 (delta 0), pack-reused 0
Receiving objects: 100% (47/47), 52.74 KiB | 7.53 MiB/s, done.
Resolving deltas: 100% (4/4), done.
Library Manager: custom-Ethernet@2.0.0+sha.c9399a9 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.3.1+sha.33ff413) > 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-arduinoespressif32 @ 2.0.6+sha.57b27cd
- tool-esptoolpy @ 1.30100.210531 (3.1.0)
- toolchain-xtensa-esp32 @ 8.4.0+2021r1
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 40 compatible libraries
Scanning dependencies...
Dependency Graph
|-- AsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.0.0
| |-- AsyncTCP-esphome @ 2.0.0
| |-- FS @ 2.0.0
| |-- WiFi @ 2.0.0
|-- ESPAsync_WiFiManager @ 1.9.8
| |-- ESP Async WebServer @ 1.2.3
| | |-- FS @ 2.0.0
| | |-- AsyncTCP-esphome @ 2.0.0
| | |-- WiFi @ 2.0.0
| |-- ESP_DoubleResetDetector @ 1.3.2
| |-- DNSServer @ 2.0.0
| | |-- WiFi @ 2.0.0
| |-- WiFi @ 2.0.0
|-- eModbus @ 1.6.0
| |-- AsyncTCP-esphome @ 2.0.0
|-- ESP Async WebServer @ 1.2.3
| |-- FS @ 2.0.0
| |-- AsyncTCP-esphome @ 2.0.0
| |-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
| |-- WiFi @ 2.0.0
|-- Preferences @ 2.0.0
|-- SPIFFS @ 2.0.0
| |-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
Building in release mode
Compiling .pio\build\release\src\main.cpp.o
Compiling .pio\build\release\src\prg_pic.cpp.o
Compiling .pio\build\release\src\radix.cpp.o
*** [.pio\build\release\bootloader.bin] Source `C:\Users\henrgi\.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32\bin\bootloader__80m.elf' not found, needed by target `.pio\build\release\bootloader.bin'.
======================================================== [FAILED] Took 33.12 seconds ========================================================
* The terminal process "C:\Users\henrgi\.platformio\penv\Scripts\platformio.exe 'run', '--environment', 'release'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
I also tested with esptool.py upgraded to version 4.4.0by including the line directly below in platformio.ini, but the error did not go away:
platform_packages = tool-esptoolpy@~1.40400.0
After running the build command with the --verbose
option added, i.e.
C:\Users\henrgi\.platformio\penv\Scripts\platformio.exe run --verbose --environment release
it becoms clear that the FLASH mode option is not used in the toolchain, i.e. the board_build.flash_mode = dio
in the file platformio.ini
is not used by the toolchain when looking for the proper elf file.
The toolchain seems to depend on python; I am running
Python 3.9.10 (tags/v3.9.10:f2f3f53, Jan 17 2022, 15:14:21)
More details:
The linker is looking for C:\Users\henrgi\.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32\bin\bootloader__80m.elf
, which is not available in the folder.
The files that ARE available are:
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8-1-2023 19:27 721460 bootloader_dio_40m.elf
-a---- 8-1-2023 19:27 721488 bootloader_dio_80m.elf
-a---- 8-1-2023 19:27 721460 bootloader_dout_40m.elf
-a---- 8-1-2023 19:27 721488 bootloader_dout_80m.elf
-a---- 8-1-2023 19:27 737204 bootloader_qio_40m.elf
-a---- 8-1-2023 19:27 737232 bootloader_qio_80m.elf
-a---- 8-1-2023 19:27 737204 bootloader_qout_40m.elf
-a---- 8-1-2023 19:27 737232 bootloader_qout_80m.elf
These files seem to have been copied from https://github.com/espressif/arduino-esp32/tree/master/tools/sdk/esp32/bin,
Just issuing the 'Build' command results in:
* Executing task: C:\Users\henrgi\.platformio\penv\Scripts\platformio.exe run --environment release
Processing release (platform: espressif32; board: esp32dev; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.3.1+sha.33ff413) > 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-arduinoespressif32 @ 2.0.6+sha.57b27cd
- tool-esptoolpy @ 1.40400.0 (4.4.0)
- toolchain-xtensa-esp32 @ 8.4.0+2021r1
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 40 compatible libraries
Scanning dependencies...
Dependency Graph
|-- AsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.0.0
| |-- AsyncTCP-esphome @ 2.0.0
| |-- FS @ 2.0.0
| |-- WiFi @ 2.0.0
|-- ESPAsync_WiFiManager @ 1.9.8
| |-- ESP Async WebServer @ 1.2.3
| | |-- FS @ 2.0.0
| | |-- AsyncTCP-esphome @ 2.0.0
| | |-- WiFi @ 2.0.0
| |-- ESP_DoubleResetDetector @ 1.3.2
| |-- DNSServer @ 2.0.0
| | |-- WiFi @ 2.0.0
| |-- WiFi @ 2.0.0
|-- eModbus @ 1.6.0
| |-- AsyncTCP-esphome @ 2.0.0
|-- ESP Async WebServer @ 1.2.3
| |-- FS @ 2.0.0
| |-- AsyncTCP-esphome @ 2.0.0
| |-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
| |-- WiFi @ 2.0.0
|-- Preferences @ 2.0.0
|-- SPIFFS @ 2.0.0
| |-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
Building in release mode
Compiling .pio\build\release\src\main.cpp.o
Compiling .pio\build\release\src\prg_pic.cpp.o
Compiling .pio\build\release\src\radix.cpp.o
Building .pio\build\release\bootloader.bin
Generating partitions .pio\build\release\partitions.bin
usage: esptool elf2image [-h] [--output OUTPUT] [--version {1,2,3}]
[--min-rev-full {0, ... 65535}]
[--max-rev-full {0, ... 65535}] [--secure-pad]
[--secure-pad-v2]
[--elf-sha256-offset ELF_SHA256_OFFSET]
[--dont-append-digest] [--use_segments]
[--flash-mmu-page-size {64KB,32KB,16KB,8KB}]
[--flash_freq {80m,60m,48m,40m,30m,26m,24m,20m,16m,15m,12m}]
[--flash_mode {qio,qout,dio,dout}]
[--flash_size {256KB,512KB,1MB,2MB,2MB-c1,4MB,4MB-c1,8MB,16MB,32MB,64MB,128MB}]
[--spi-connection SPI_CONNECTION]
input
esptool elf2image: error: argument --flash_mode/-fm: expected one argument
Compiling .pio\build\release\libc95\AsyncTCP-esphome\AsyncTCP.cpp.o
Compiling .pio\build\release\libefe\FS\FS.cpp.o
Compiling .pio\build\release\libefe\FS\vfs_api.cpp.o
*** [.pio\build\release\bootloader.bin] Error 2
============================================================ [FAILED] Took 8.82 seconds ============================================================
* The terminal process "C:\Users\henrgi\.platformio\penv\Scripts\platformio.exe 'run', '--environment', 'release'" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.
and indeed, after copying bootloader_dio_80m.elf
to bootloader__80m.elf
the error changes to an error in the arguments used for esptool elf2image
in the toolchain. Using the --verbose option
, I can see that the following the ` -- flash_mode
is not followed by dio
, which seems to cause the error
The crucial line is:
Building in release mode
"C:\Users\henrgi\.platformio\penv\Scripts\python.exe" "C:\Users\henrgi\.platformio\packages\tool-esptoolpy\esptool.py" --chip esp32 elf2image --flash_mode --flash_freq 80m --flash_size 4MB -o .pio\build\release\bootloader.bin C:\Users\henrgi\.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32\bin\bootloader__80m.elf
The error may be related to this change, committed 2 days ago: https://github.com/platformio/platform-espressif32/commit/d0835e994c2af374198cbdf976d6019dc7dafe5f
And indeed, changing the line that specifies the platform in platformio.ini
to the line below finally allowed me to sucesfully complile and upload the Sensorbox-2 firmware!
platform = https://github.com/platformio/platform-espressif32.git#develop
So, it seems commit specified in https://github.com/platformio/platform-espressif32/commit/d0835e994c2af374198cbdf976d6019dc7dafe5f that is currently in the develop branch is needed to compile the firmware properly!?
The fix is incorporatedin release v6.0.0 of the espressif32 platform
So, after pulling v6.0.0 from GitHub, in platform.ini for the platfrm line, you can now simply use the line
platform = espressif32
and then the issue is gone.
Thanks for debugging this issue. Just tried a fresh installation of Ubuntu + VScode + PlatformIO, and i ran into the same issue where the bootloader could not be found.
platform = espressif32 did not work for me. Somehow it did not install the latest version, but instead installed framework-arduinoespressif32 @ 2.0.6 weird...
platform = espressif32 @ 6.0.0
did install the correct platform, framework and esptool
I got a
bad value
error while during linkingfirmware.elf
after cloning this repo yesterday, doing a 'clean all' and building this repo using Visual Studio Code (v1.74.2), PlatformIO (Core: 6.1.5; Home 3.4.3) and Windoes 11 Education (v21H2). I also get the same error when I change the platform line in platromio.ini to espressif32. Similarly, I also get the same error when compiling the source code in the v2.0.0 release. More details below.What could be the problem here?
...
I also tried the solution mentioned in SmartEVSE-3/issues/36, but that did not help either:
...
I also get the same error when compiling the source code in the v2.0.0 release:
...