JianyuWang0623 opened a new pull request, #3903:
URL: https://github.com/apache/nuttx-apps/pull/3903

   ## Summary
   
   Fix three bugs in the sparse chunk walk of `fastboot_flash_program()`:
   
   * DONT_CARE now advances the output offset.
   * CRC32 now skips its 4-byte payload.
   * FILL now reads its pattern with `le32toh()`; the sparse format is 
little-endian.
   
   ## Impact
   
   Sparse images flashed via fastbootd are no longer corrupted. No API or build 
change.
   
   ## Testing
   
   `sim:nsh` + `CONFIG_SYSTEM_FASTBOOTD=y` builds clean. Flashed on
   `lckfb-szpi-esp32s3:fastboot` with `fastboot flash ram1 sparse_test.img`, 
then
   read back with `hexdump`.
   
   Test image (`blk_sz` 4096): RAW, DONT_CARE, FILL `0x11223344`, CRC32, RAW.
   Expected: RAW1 at 0, hole at 4096, FILL at 8192, RAW2 at 12288.
   
   Before:
   
   ```
   nsh> hexdump /dev/ram1 count=16
   0000: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
   nsh> hexdump /dev/ram1 skip=4096 count=16
   0000: 11 22 33 44 11 22 33 44 11 22 33 44 11 22 33 44
   nsh> hexdump /dev/ram1 skip=8192 count=16
   0000: de ed df df f8 12 18 50 df f1 17 a7 4d f3 7f fd
   nsh> hexdump /dev/ram1 skip=12288 count=16
   0000: 48 28 06 d4 a9 67 df e7 05 8d 90 02 9c 51 17 42
   ```
   
   After:
   
   ```
   nsh> hexdump /dev/ram1 count=16
   0000: 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
   nsh> hexdump /dev/ram1 skip=4096 count=16
   0000: fe fe 67 21 51 1c b9 6a 81 31 76 93 7c 8b f7 ff
   nsh> hexdump /dev/ram1 skip=8192 count=16
   0000: 44 33 22 11 44 33 22 11 44 33 22 11 44 33 22 11
   nsh> hexdump /dev/ram1 skip=12288 count=16
   0000: 0d 14 1b 22 29 30 37 3e 45 4c 53 5a 61 68 6f 76
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to