I’m attaching 2 versions (remove the .txt extension to use), the smaller one works, the larger one fails with:
S47:20.51 loader: loaded partitions.bin 0x00008116 off 278 len 00000278 (0/7914/557524 remaining)
S47:20.55 loader: flash verified for partitions.bin
S47:20.55 loader: end-to-end bin verified for partitions.bin
S47:20.55 loader: programming completed for partitions.bin
S47:20.55 loader: resetting source offset to 0x00003459 to align image to page boundary
S47:20.55 loader: reading source offset 0x00003459 len 0x00002000 leaving 0x000880be remaining
S47:20.56 loader: processing firmware.bin off 0 (565438/8192/557246 remaining)
S47:20.56 loader: erasing flash for firmware.bin from 0x00010000 len 0x000ac650
S47:23.92 loader: 2971ms timeout waiting for reply
S47:23.92 *** loader program_begin err esp: erasing flash failed (reason #2) *** (err 0)
S47:23.93 loader: programming error: esp: erasing flash failed (reason #2)
S47:24.63 AUX deactivated
S47:26.14 _health.qo: outboard DFU of esp32 firmware: esp: erasing flash failed (reason #2)
S47:26.25 dfu: disabled DFU mode
S47:26.25 sync: wakeup: dfu disabled
S47:26.25 dfu: cannot update host: esp: erasing flash failed (reason #2)
S47:26.25 dfu: retry #10
My best guess at the root cause is the 2971ms timeout waiting for reply might be too short.
Although I’m noticing messages like U42:25.28 *** WARNING: LARGE ALLOCATION size:72734 remaining:593560 Which might be relevant
I’ve seen some inconsistency when reproducing this error that I can’t explain.
i.e. it does occasionally work with larger firmware.
(As per my last comment on my original topic)
Out of curiosity, I tried this with a Blues Swan host too.
It works OK with a ~920kB firmware, but I did see it fail at ~1344kB
This looks like a completely different error, but I did expect this to work given the DFU limit of 1.5MB and the flash size of 2MB
S04:19.73 sync: advancing last sync time from 11:50:10Z to 11:50:21Z
S04:20.52 dfu user: begin 2024-02-12-114905_audio_1344kB_STM32$20240212114959.binpack (1344407 bytes)
S06:10.38 _health.qo: DFU of host firmware aborted: error appending to local file: error writing file
S06:10.38 _health.qo: can't add note: can't exceed 80% of filesystem (currently 100%) {file-storage-full}
S06:10.70 sync: wakeup: dfu SetStateToError
S06:10.70 env: environment modified
S06:10.73 env: updated _state_vars_dfu
S06:10.73 env: dfu updated
I’m looking into this now and will get back to you when we have some updates. I just wanted to confirm you’re on the latest LTS release (6.1.1) and using only the Notecard WiFi v2?
@calcut Thank you for posting the workaround. We have an ESP32-S3 custom board, and we are seeing the same behavior when the binary is not split up.
With the file split workaround, ODFU works as expected.
It does seem like the Notecard firmware would need to increase the delay when erasing the flash in order to account for the erase time for each page and number of pages.