Commit b712670
committed
snagflash: fastboot: remove "truncated flash" check
As reported by #85, flashing a wic image generated by Yocto using
fastboot-uboot mode trigger an error when sending the last image chunk
to the target:
ValueError: Truncated flash, only 82944 bytes were flashed instead of 86016 bytes
The same issue is reproduced on another platform (SK-TDA4VM).
[INFO] Flashing to MMC device...
[DEBUG] setting MMC device to 1
[DEBUG] fastboot OKAY
[DEBUG] range start 0x88100000 read size 0x2000
[DEBUG] send size 0x2000 dst offset 0x88100000
[DEBUG] fastboot DATA length: 8192
[INFO] fastboot OKAY
[DEBUG] fastboot OKAY
[INFO] flashed 8192/8192 bytes
[INFO] Flashing sparse range 12/13
[INFO] Flashing to MMC device...
[DEBUG] setting MMC device to 1
[DEBUG] fastboot OKAY
[DEBUG] range start 0x936e0000 read size 0x1c000
[DEBUG] send size 0x1b800 dst offset 0x936e0000 <<< here we have "send size" < "read size"
[DEBUG] fastboot DATA length: 112640
[INFO] fastboot OKAY
[DEBUG] fastboot OKAY
[INFO] flashed 112640/114688 bytes
[DEBUG] range start 0x936fb800 read size 0x800
ValueError: Truncated flash, only 112640 bytes were flashed instead of 114688 bytes
0x936fb800 is actually the size of the wic file (2473572352).
This value is verified by the ImageSize value in .bmap file.
<!-- Image size in bytes: 2.3 GiB -->
<ImageSize> 2473572352 </ImageSize>
So it means that flash_range() reached the end of the file:
blob = file.read(read_size)
bytes_read = len(blob)
if bytes_read == 0:
break
That's why "read size" != "send size" in the Snagflash debug log,
file.read() returned less than requested data.
Removing the bmap file allows to workaround this issue.
This bug was introduced in Snagboot 2.6 when the
"flashing with unspecified file sizes" feature was added.
Indeed, a new "truncated flash" check was added but it expect that the
image file is aligned with a bmap block. This not alway the case.
Remove this "truncated flash" check since Snagflash correctly flash the
end of the file.
Fixes: d499ae2 ("snagflash: fb-uboot: Allow flashing with unspecified file sizes")
Fixes #85
Signed-off-by: Romain Naour <romain.naour@smile.fr>1 parent 99a7409 commit b712670
1 file changed
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | 321 | | |
327 | 322 | | |
328 | 323 | | |
| |||
0 commit comments