DFU SPIFFS issue

cpumaster
Posts: 1
Joined: Sun Jan 09, 2022 2:59 pm

DFU SPIFFS issue

Postby cpumaster » Sun Jan 09, 2022 3:31 pm

Hello Everyone,
i'm using a ESP32S2-WROOM module with 4MB(32Mb) flash on my custom board. I can flash through native USB with DFU. (idf.py dfu and dfu-flash commands)
My partition table looks like this (copy from flasher_args.json):
"flash_files" : {
"0x1000" : "bootloader/bootloader.bin",
"0x10000" : "MBComm.bin",
"0x8000" : "partition_table/partition-table.bin",
"0xd000" : "ota_data_initial.bin",
"0x210000" : "storage.bin"
},

After the flashing, the application is running good but the SPIFFS section can't mount and I got the error.
I dump the full 4MB flash through UART0 with esptool.py dump_memory and I saw from 0x210000 just 0xFF.
So my storage.bin file didn't write to flash but in the merged dfu.bin I see the storage.bin content but not the right address. I think that the dfu solve this inside.

When I upload my project with esptool.py through UART0 the flash section will be written with the valid SPIFFS section data.

I uploaded my full build directory (link under). Can everyone help me? What is the problem with the DFU? Has it a file limit for flash? I don't think so.
https://ufile.io/7q0hkb28 <-- my build dir.

I use the latest master IDF:
Commit: 9f303290d8cb77c932efdaed889ce67ff58b6dea [9f30329]
Parents: 7d43be9675, 1056a7da64
Author: morris <maoshengrong@espressif.com>
Date: 2022. január 8., szombat 6:34:27
Committer: morris

Thanks,
Tamas

ESP_Sprite
Posts: 9594
Joined: Thu Nov 26, 2015 4:08 am

Re: DFU SPIFFS issue

Postby ESP_Sprite » Mon Jan 10, 2022 4:32 am

Fyi, an ESP32 DFU file is a CPIO archive. If you want to check what's in there, rename it to e.g. 'dfu.cpio' and something like winzip should be able to open it. The cpio file contains dfuinfo0.dat which has a list of where each file is supposed to go, with the first 4 bytes of each entry indicating the (little) endian address. Looking at it like that, it looks to me that the address is correct.

Still, no idea how your SPIFFS doesn't mount... can you try dumping the flash immediately after DFU upload, without running the program ever? I'm wondering if your program erases the SPIFFS if it can't mount it...

gamgee
Posts: 5
Joined: Wed Apr 07, 2021 2:20 pm

Re: DFU SPIFFS issue

Postby gamgee » Fri Mar 18, 2022 11:52 am

Hi,

I have the exact same issue.

My flash command looks like this:

Code: Select all

--flash_mode dio --flash_freq 80m --flash_size 4MB
0x1000 bootloader/bootloader.bin
0x20000 myfw.bin
0x8000 partition_table/partition-table.bin
0xf000 ota_data_initial.bin
0x220000 config.bin
partition.csv

Code: Select all

# ESP-IDF Partition Table
# Name,   Type, SubType, Offset,  Size, Flags
nvs,      data, nvs,     0x9000,  0x6000,
otadata,  data, ota,     0xF000,  0x2000,
phy_init, data, phy,     0x11000,  0x1000,
ota_0,    app,  ota_0,   0x20000, 0x100000,
ota_1,    app,  ota_1,   0x120000, 0x100000,
config,   data, spiffs,  0x220000, 0xE9000,
log,      data, spiffs,  0x3EA000, 0x8000,


If I flash the dfu file onto a new module the config partition fails to mount.
Once i upload the config.bin with

Code: Select all

 esptool.py --chip esp32s2 --port COM17 write_flash 0x220000 .\build\config.bin
it works.

Is this the intended behavior? Is it possible to flash spiffs paritions via dfu?

My IDF Version is 4.4

Who is online

Users browsing this forum: No registered users and 113 guests