esp-web-tools: Arduino 2.0.4, PlatformIO 5.1.0, LittleFS is corrupted
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:
{
"name":"Glow Worm Luciferin FULL",
"version":"5.6.3",
"new_install_improv_wait_time":40,
"builds":[
{
"chipFamily":"ESP32",
"parts":[
{
"path":"GlowWormLuciferinFULL_ESP32_firmware-factory.bin",
"offset":0
}
]
},
{
"chipFamily":"ESP8266",
"parts":[
{
"path":"GlowWormLuciferinFULL_ESP8266_firmware.bin",
"offset":0
}
]
}
]
}
and this is the script that I use to create a factory bin.
def esp32_create_factory_bin(source, target, env):
print("Generating factory bin for genuine esp units")
#offset = 0x1000
offset = 0x0
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}-factory.bin")
sections = env.subst(env.get('FLASH_EXTRA_IMAGES'))
new_file = open(new_file_name,"wb")
for section in sections:
sect_adr,sect_file = section.split(" ",1)
source = open(sect_file,"rb")
new_file.seek(int(sect_adr,0)-offset)
new_file.write(source.read());
source.close()
firmware = open(env.subst("$BUILD_DIR/${PROGNAME}.bin"),"rb")
new_file.seek(0x10000-offset)
new_file.write(firmware.read())
new_file.close()
firmware.close()
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 30 (20 by maintainers)
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!
Will do, back on PC not until tomorrow.
Great! Then I can think of a few more feature requests 😉
@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).