ADALM PLUTO - firmware DFU flashing fails at 22-23MB

Hi Ez-team and other, happy to join!

I am very happy with my Pluto since months, learning a lot. Yes it's a learning SDR tool, well documented.

I flashed several firmwares, and compiled my own running since few weeks. Very instructive, robust device, never had an issue.

Few days ago I released a version and user contact me over internet to report DFU flashing failing at around 22-23 MB.

I must admit my firmware is big (31MB) but tested with no issue on several Plutos.

Thanks to this patient guy, we finally rejected all problems regarding cables, OS windows vs linux, and dfu-util version 0.8 vs 0.9, because I finally was able to reproduce the issue on my side using a brand new unboxed pluto.

This pluto was running firmware 0.28, upgraded to 0.29 then to my own firmware.

So, depending on the pluto, flashing over 22MB is working (or not)... from the same computer.

Result after flashing a 26MB size firmware file (never fail at same point):

dfu-util -a firmware.dfu -D pluto.dfu
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Match vendor ID from file: 0456
Match product ID from file: b673
Opening DFU capable USB device...
ID 0456:b674
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #1 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 4096
Copying data from PC to DFU device
Download [====================== ] 88% 23044096 bytes failed!
state(10) = dfuERROR, status(14) = Something went wrong, but the device does not know what it was

After looking around fit_size parameter on NVRAM, obviously reflashing uboot.dfu ... lot of hours later I found this difference on the startup:

- Faulty unit: (failed at 23MB, then dowgraded to AD firmware).

Jan 1 00:00:02 (none) user.info kernel: m25p80 spi32765.0: SPI-NOR-UniqueID 104473222a870010ffff0c003eadd519ee
Jan 1 00:00:02 (none) user.info kernel: m25p80 spi32765.0: n25q256a (32768 Kbytes)
Jan 1 00:00:02 (none) user.notice kernel: 4 ofpart partitions found on MTD device spi32765.0
Jan 1 00:00:02 (none) user.notice kernel: Creating 4 MTD partitions on "spi32765.0":
Jan 1 00:00:02 (none) user.notice kernel: 0x000000000000-0x000000100000 : "qspi-fsbl-uboot"
Jan 1 00:00:02 (none) user.notice kernel: 0x000000100000-0x000000120000 : "qspi-uboot-env"
Jan 1 00:00:02 (none) user.notice kernel: 0x000000120000-0x000000200000 : "qspi-nvmfs"
Jan 1 00:00:02 (none) user.notice kernel: 0x000000200000-0x000002000000 : "qspi-linux"

- Working unit ( 31MB flashed)

Jan 1 00:00:04 (none) user.info kernel: m25p80 spi32765.0: SPI-NOR-UniqueID 104400b8399100151500080041ef64d7bc
Jan 1 00:00:04 (none) user.warn kernel: m25p80 spi32765.0: found n25q512a, expected n25q256a
Jan 1 00:00:04 (none) user.info kernel: m25p80 spi32765.0: n25q512a (65536 Kbytes)
Jan 1 00:00:04 (none) user.notice kernel: 4 ofpart partitions found on MTD device spi32765.0
Jan 1 00:00:04 (none) user.notice kernel: Creating 4 MTD partitions on "spi32765.0":
Jan 1 00:00:04 (none) user.notice kernel: 0x000000000000-0x000000100000 : "qspi-fsbl-uboot"
Jan 1 00:00:04 (none) user.notice kernel: 0x000000100000-0x000000120000 : "qspi-uboot-env"
Jan 1 00:00:04 (none) user.notice kernel: 0x000000120000-0x000000200000 : "qspi-nvmfs"
Jan 1 00:00:04 (none) user.notice kernel: 0x000000200000-0x000002000000 : "qspi-linux"

Seems the flash model and block-size are not the same, this is confirmed from diagnostic reports coming from 2 plutos. All these boards are revB (working and not working over 22MB).

Discussing with a third guy who owns two pluto , he realized the second pluto can be flashed over 22MB ...thinking until now it  was the maximum limit.

Could this explain the flashing failure.? Any workaround for this issue ? Did I miss an important patch or a message here ? (Vivado 2017.4 here)

Joining the bad and good diagnostics reports.

BTW I'm not used to play on uboot, and don't have JTAG cable ;)

Ask if you need more information. Thanks a lot !

 3113.flash_fails_DR.zip