-
Notifications
You must be signed in to change notification settings - Fork 124
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 2.0.4, PlatformIO 5.1.0, LittleFS is corrupted #278
Comments
Please have a look at what I do in ESPEasy to generate the bin files. (a newer version of what you've been using) It is using esptool.py to generate a bin file. I also reverted to version 3.3 of esptool.py since version 4 does by default add some checksum which may become invalid if the used flash tool decides to set the flash size and frequency based on what it detects instead of what is set in the board definition. About QIO being needed... Are you sure about that its actually needed? |
Hi @TD-er thank you for your very kind answer, I really appreciate it. my
I copied and pasted your python script here this is the output of your script:
It generates the factory.bin but once I try to flash it with esp web tools 9.0.3 I got a boot loop:
I tried it with many devices like the Lolin D32, ESP32 dev kit and TinyPICO. Any suggestions? :) Thanks!!!!! |
Can you flash it directly from PlatformIO and check the esptools.py output to see what flags it sets (e.g. 0x0340 or something like this, not behind my dev PC right now) |
@TD-er I narrowed the problem. TinyPICO works only with QIO 80000000L when flashing using PlatformIO Esp Web Tools does not work with QIO 80000000L at all in my case. here the output of the flash from platformio when using DIO 40000000L
If I use QIO 80000000L it's the same but the flash params, this are the flash params: If I use QIO 80000000L I can flash Lolin D32, ESP32 dev kit, quindor esp32 and TinyPICO without problems using PlatformIO. the solution seems to use QIO 80000000L everywhere but Esp Web Tools works with DIO 40000000L but in this way I can't flash TinyPICO for example... is there a solution to have a firmware that can run on all ESP32 4MB boards? |
When you flash using esptool.py, the tool detects what is available and patches the flags while flashing. Flash mode 0x02 = dio. So my advice is to write the firmware to a device using PlatformIO and then use esptool.py to read the entire flash back into a single file. You can also try to use these flash mode and frequency settings to generate the bin file using the PIO script which uses esptool to generate the combined bin file and see if that will work. |
My build are triggered via a git tag and they publish factory binaries to the server via a GitHub Action. If I flash via PlatformIO using QIO, 80MHz, 4MB, Flash params is set to 0x002f QIO, 80MHz, 4MB seems to be the best bet to target most of the 4MB boards with this new arduino core. Does ESP Web Tools support 0x002f (QIO, 80MHz, 4MB) ??? |
webtools does support anything and nothing, as it does not patch the bin while flashing.
That's exactly what I intended, it is for debugging and validating the hypothesis about what's causing these issues. |
@TD-er we've switched to esptool.js, which is a port of esptool.py maintained by Espressif. It mimics the esptool.py logic. @sblantipodi can you confirm that you run the latest version of ESP Web Tools? |
OK, so the latest version (which I have not yet tried) should be able to patch the bin again on the fly while flashing? |
@TD-er @balloob sure, I update on every new release. using 9.0.3 now. thanks a billion for all the kind help. |
@TD-er yes. It should follow the same logic as esptool.py. Espressif wants to keep the esptool.js port 1:1 the same as esptool.py (including how functions are broken out etc). |
Great! |
@TD-er I tried what you suggested. I then uploaded the downloaded your hypothesis was correct. |
Great! |
@TD-er thank you so much for all the help! I really appreciate it. I wrote a simple java program to detect the difference between the two firmware:
it seems that the first 10_000 bytes are identical. this is the output of the program:
is this what you expect? am I following a red herring? if this is what you expect, what should I change in platformio.ini to try to match that byte? the only flash params I know that I can change are these ones:
are there something else that I can try to change to match that bytes? |
@TD-er the minimum common denominator for all my 4MB boards to work well when uploading from PlatformIO is DIO does not work well on TinyPICO now I changed my platformio.ini from QIO to DIO, in any case the produced firmware with DIO does not work on TinyPICO but works well on Lolin D32 (tried it from the ESP Web Tools). |
Based on the partition table you posted:
Starting at 0x1000 (4096 decimal) is this:
So this does suggest your build is assuming 40 MHz flash As I said before, it makes little sense why you must use QIO and DIO should not work. |
@TD-er if I use DIO 40MHz, I see this: I don't understand why TinyPICO does not work with DIO but only works with QIO. the strange thing is that the problem happen only when using ESP Web Tools never work well with firmware that uses QIO neither by using I think that we have multiple problems here... the only solution I have at the moment is to use but this is not a solution to me. |
I just looked at the Espressif32 PIO 5.1.0 release notes
So I guess there is something seriously different here. |
done it here: |
there is still a problem. |
Well, i had to update how the factory Tasmota firmware is build for core 2.0.4. Since 2.0.4. there is NO default setting anywhere for flash mode and frequency. So if no tool does set here valid values it will 100% end in a crash. So i highly recommend to use esptool.py and let do the firmware generating job. esptool.py needs to be feed with ALL settings here. |
@sblantipodi With the change i added (this is done in platformio code the same way) It is "just" building the factory firmware correct. |
@balloob It is not 1:1, i had to revert to v8.x since espressif.js is not able to recognize/flash device via CDC/JTAG (inbuilt "USBmodem") connection. |
Can you open an issue on esptool.js to track that, and note what errors you see. |
Will do, back on PC not until tomorrow. |
I see a lot of beautiful minds on this issue, except for mine obviously. xD I reduced the Jason2866 script to be more "compliant" with smaller projects like mine.
It now works awesome! I'm honored to be helped by you guys! Bye! |
PS: I'll wait to see if there is something else from you before closing the issue :) |
Hi all,
as soon as I update Arduino Core from 2.0.3 to 2.0.4 and PlatformIO from 5.0.0 to 5.1.0
my Little FS is corrupted after flashing my firmware with esp web tools.
this is my simple json:
and this is the script that I use to create a factory bin.
It worked well before but now it is broken...
As soon as I flash the firmware with Arduino core 2.0.4, LittleFS got corrupted.
It works well with Arduino core 2.0.3.
I think that this can be related to flash mode (QIO is now needed for some boards),
is there a way to specify the flash mode with esp web tools?
Any suggestions will be really appreciated :)
Thanks
Davide
The text was updated successfully, but these errors were encountered: