Hi
I’ve been testing outboard DFU, and have had success with my hardware setup.
However my firmware image now includes more libraries and is larger, and I’m seeing a failure.
(The binpack file is 622KB rather than 379KB, so I don’t think I’m hitting the 1.5MB limit)
Using Notecard FW 4.4.1.4015700 and CLI version 1.2.1
I’ve pasted the notecard trace output below at the end
The offending line seems to be
S52:54.66 loader: erasing flash for firmware.bin from 0x00010000 len 0x000e3690
As a first line of debug, I tried running a similar command with ESPtool
esptool.py -p /dev/cu.usbserial-556E0262731 erase_region 0x00010000 0x000e3690
This failed with the following error
A fatal error occurred: Size of data to erase must be a multiple of 4096
So I expect the the DFU is failing for the same reason.
Is this a bug? the notecard is trying to erase a length of 0xe3690 (=931472)
Which looks to be what is specified in the binpack (apologies, I’ve edited to show the correct binpack header now!).
/// BINPACK ///
WHEN: 2023-08-08 12:11:43 UTC
HOST: esp32
SNAP: 8192
LOAD: bootloader.bin,4096,17408,17408,15577,5ec4bbd3bb1f2dc36232cc1c8f1d3ee2
LOAD: partitions.bin,32768,3072,3072,294,118cbdbfce82eb12bbdeb7c59af2fce8
LOAD: firmware.bin,65536,931472,931472,606031,a29df4453f7258e65a38360a625ae549
/// BINPACK ///
S52:31.00 _health.qo: starting outboard DFU of esp32 firmware
S52:33.12 loader: 994ms timeout waiting for reply
S52:34.23 loader: 994ms timeout waiting for reply
S52:35.33 loader: 994ms timeout waiting for reply
S52:35.48 loader: reading source offset 0x00000000 len 0x00002000 leaving 0x00095e8a remaining
S52:37.42 binpack created 2023-08-08 12:11:43 UTC
S52:37.42 binpack compression frame length: 8192
S52:37.43 binpack will load bootloader.bin at 00001000 for 17408 bytes
S52:37.43 binpack will load partitions.bin at 00008000 for 3072 bytes
S52:37.44 binpack will load firmware.bin at 00010000 for 931472 bytes
S52:37.44 loader: resetting source offset to 0x0000013c to align image to page boundary
S52:37.44 loader: reading source offset 0x0000013c len 0x00002000 leaving 0x00095d4e remaining
S52:39.19 loader: processing bootloader.bin off 0 (15577/8192/613710 remaining)
S52:39.19 loader: erasing flash for bootloader.bin from 0x00001000 len 0x00004400
S52:39.53 loader: bootloader.bin frame compressed len 7096
S52:39.53 loader: bootloader.bin frame decompressed from 7096 to 8192
S52:39.54 loader: writing flash for bootloader.bin len 0x00000800 6144 remaining
S52:40.19 loader: writing flash for bootloader.bin len 0x00000800 4096 remaining
S52:41.14 loader: writing flash for bootloader.bin len 0x00000800 2048 remaining
S52:41.97 loader: writing flash for bootloader.bin len 0x00000800 0 remaining
S52:42.66 loader: loaded bootloader.bin 0x00002bbc off 7100 len 00007100 (8477/1092/613710 remaining)
S52:42.66 loader: processing bootloader.bin off 7100 (8477/1092/613710 remaining)
S52:42.67 loader: bootloader.bin frame compressed len 7452
S52:42.67 loader: loaded bootloader.bin 0x00003000 off 8192 len 00001092 (7385/0/613710 remaining)
S52:42.67 loader: reading source offset 0x0000213c len 0x00002000 leaving 0x00093d4e remaining
S52:44.93 loader: processing bootloader.bin off 8192 (7385/8192/605518 remaining)
S52:44.93 loader: bootloader.bin frame decompressed from 7452 to 8192
S52:44.94 loader: writing flash for bootloader.bin len 0x00000800 6144 remaining
S52:45.75 loader: writing flash for bootloader.bin len 0x00000800 4096 remaining
S52:46.99 loader: writing flash for bootloader.bin len 0x00000800 2048 remaining
S52:47.90 loader: writing flash for bootloader.bin len 0x00000800 0 remaining
S52:48.86 loader: loaded bootloader.bin 0x000048dc off 14556 len 00006364 (1021/1828/605518 remaining)
S52:48.86 loader: processing bootloader.bin off 14556 (1021/1828/605518 remaining)
S52:48.86 loader: bootloader.bin frame compressed len 1017
S52:48.87 loader: bootloader.bin frame decompressed from 1017 to 1024
S52:48.87 loader: writing flash for bootloader.bin len 0x00000400 0 remaining
S52:49.59 loader: loaded bootloader.bin 0x00004cd9 off 15577 len 00001021 (0/807/605518 remaining)
S52:49.63 loader: flash verified for bootloader.bin
S52:49.63 loader: end-to-end bin verified for bootloader.bin
S52:49.64 loader: programming completed for bootloader.bin
S52:49.64 loader: resetting source offset to 0x00003e15 to align image to page boundary
S52:49.64 loader: reading source offset 0x00003e15 len 0x00002000 leaving 0x00092075 remaining
S52:51.70 loader: processing partitions.bin off 0 (294/8192/598133 remaining)
S52:51.70 loader: erasing flash for partitions.bin from 0x00008000 len 0x00000c00
S52:51.83 loader: partitions.bin frame compressed len 290
S52:51.84 loader: partitions.bin frame decompressed from 290 to 3072
S52:51.84 loader: writing flash for partitions.bin len 0x00000800 1024 remaining
S52:52.45 loader: writing flash for partitions.bin len 0x00000400 0 remaining
S52:53.07 loader: loaded partitions.bin 0x00008126 off 294 len 00000294 (0/7898/598133 remaining)
S52:53.09 loader: flash verified for partitions.bin
S52:53.09 loader: end-to-end bin verified for partitions.bin
S52:53.10 loader: programming completed for partitions.bin
S52:53.10 loader: resetting source offset to 0x00003f3b to align image to page boundary
S52:53.10 loader: reading source offset 0x00003f3b len 0x00002000 leaving 0x00091f4f remaining
S52:54.65 loader: processing firmware.bin off 0 (606031/8192/597839 remaining)
**S52:54.66 loader: erasing flash for firmware.bin from 0x00010000 len 0x000e3690**
S52:57.74 loader: 2994ms timeout waiting for reply
S52:57.74 loader: programming error: esp: erasing flash failed (reason #2)
S52:58.46 _health.qo: outboard DFU of esp32 firmware: esp: erasing flash failed (reason #2)
S52:58.47 dfu: disabled DFU mode
S52:58.48 sync: wakeup: dfu disabled
S52:58.48 dfu: cannot update host: esp: erasing flash failed (reason #2)
S52:58.49 dfu: retry #1