New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arduino-esp32 2.0.4 breaks esp-web-tools #288
Comments
What version of ESP Web Tools are you using? |
I knew I left out something -- 9.0.3 The setup is over here: https://github.com/jameszah/ESP32-CAM-RocketCam
|
Can you try flashing it with https://espressif.github.io/esptool-js/ ? If that doesn't work, it's an upstream bug in https://github.com/espressif/esptool-js/ |
When I flash on the just 2.0.4 bootloader.bin at 0x1000 onto a esp32 flashed with 2.0.3 version , it fails with the
Then I flash the 2.0.3 bootloader.bin, and it works again. 2.0.3 bootloader is 18,560 bytes May 4, 2022 So esptool (esptool_py\3.3.0/esptool.exe) that Arduino uses knows how to do it, but not esptool_js? |
Can you flash it to an ESP node using the IDE and then read the flashed data back from it using esptool.py. If that does work, then it is very likely the same bug/issue as is being discussed in various issues when searching for "qio" or any of the other flash modes. In short: |
Flashing individual files with esp-web-tools for ESP32x is always a more or less wrong way. Doing this way you just have one correct variant for flash mode, flash size and flash mode!!. Since core 2.0.4. does not have set any default value for any of these, it will fail if you try to flash. You have to create a combined (merged) firmware. Esptool.py can be used to do this. |
@Jason2866 we should add some guidance to our README maybe. Should we just always encourage using a single firmware that is a merged file? |
@balloob Yes, a single firmware file is the only way to get predictable working installs. |
So I switched back to 2.0.4, re-flashed it with Arduino, ... and then used this to read it off the flash.
... which seemed to work. But when I used esp-web-tools to flash that big file using this:
... it would always timeout at 98%. And it did the same thing when using https://espressif.github.io/esptool-js/. I tried it all again with a 3mb file -- I'm using 3mb Huge App, and not using the spiffs of littlefs. But it times out again at 98%. Although the program does run correctly. Although I was re-flashed to a previously working chip. But not elegant. Is there a merge procedure for bootloader, partitiion,s ino.bin plus boot_app0.bin into a single file? Or any advice on this timeout business? |
This is what I use to generate a single bin file using PlatformIO: https://github.com/letscontrolit/ESPEasy/blob/mega/tools/pio/post_esp32.py For example for my 16M module: (DIO mode 40 MHz, which is set in both the bootloader file and DIO flash mode)
In short, it does generate a command line for esptool.py with explicitly setting the flash parameters and using the But this might still be different from flashing to a node and reading it back as initially the flash settings changed on the fly using esptool (or ArduinoIDE) are based on what the flash tool detects. The combined bin file is based on what you're setting. Oh and you can still split your raw bin file if it is giving timeouts. Just use the offset positions at for example 0, 1M, 2M, 3M and split your bin file in 4 parts of 1M each. |
No, it is not. It has to be here Thats why @TD-er uses for Espeasy this script and we (Tasmota) a similar one to create the one file firmware. The ESP32-S3 with OPI flash introduces new issues. Only the 100% correct combination of Flash and PSRAM type will result in a booting S3 with PSRAM. |
Hi, thanks for the info - I had never touched that qio/dio/... setting before. The speed/method of writing the flash would depend on hardware, but I would have thought that what gets written would end up the same. My workaround was to use the the traditional 4 file esp-web-tools method, but replace the bootloader with the version generated by 2.0.3. It will flash and run correctly. The issue seems to be on the table over at arduino-esp32. Thanks. |
I would not do this. You probably run in issues. You have fixed magic bytes settings which will not work for all devices which do differ in flash size and flash frequency. In IDF this problem does not occur since the bootloader is compiled WITH the project settings together with the project source. And the needed flash size correction is done via esptool.py when flashing. |
ok, that wasn't too hard esptool command line with the 4 files from the 2.0.4 compile
And drop the output for esp-web-tools to write as 1 file
|
Given that esptool.js, aims to be a port of esptool.py, I would still consider this a bug upstream 👍 If esptool.py can figure it out, so should esptool.js |
@balloob Please keep in mind that esptool.py when run from the IDE does have other bootloader bin files at its proposal. |
@balloob @TD-er is right. When compiling Arduino firmware there all variants of the precompiled bootloader files forr the different MCU types in this folders These files are Arduino specific! If a firmware is compiled with IDF the files will be different and builded new with the specific options set in IDF. There are NO bootloaders precompiled at all in IDF. Esptool.py "just" uses thes files to flash the device correctly (and does header patching). But when the wrong file is provided header patching is useless! |
I’ve opened a PR for the README #298 |
I was trying to implement this (as I have done before) when kept getting these errors after the esp32 reboot.
Arduino 1.19 with arduino-esp32 2.04 and 2.03 will both program the esp32 fine, but when I grab the 4 files for esp32-web-tools, then the 2.04 files do not work -- they produce the stuff above.
Arduino produces the same programming strings here:
The files are slightly different sizes for bootloader.bin and ino.bin, and the other two are the same files.
And I'm using the identical manifest.json
2.0.3 files work and 2.0.4 files do not.
This looks like a similar issue to this one (here):
#278
... and this one over at arduino-esp32
espressif/arduino-esp32#7212
There seems to be discussion about qio, dio, dout programming and the 40/80 flash frequency. The two arduino esptool strings are both dio above, even though Arduino is set to qio. Arduino can program it fine at 40 or 80.
Here is the 2.03 40 listing if there is something in there that a wise-man can see:
Any ideas ... other than stick with 2.03?
The text was updated successfully, but these errors were encountered: