adafruit / Adafruit_nRF52_Bootloader

USB-enabled bootloaders for the nRF52 BLE SoC chips
MIT License
445 stars 401 forks source link

Incorrect cluster calculations #133

Closed henrygab closed 4 years ago

henrygab commented 4 years ago

https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/79a6a0c4f7f526704d5b47ffd4f6020265e01444/src/usb/uf2/ghostfat.c#L253-L257

Both highStartCluster and startCluster1 are of type uint16_t. Therefore, the math here is wrong, and the wrong starting cluster would be generated for any file that starts at sector 0x100 or higher.

Easy enough to fix. I'll include in my PR to support larger volumes.

hathach commented 4 years ago

I am glad you figure it out, though I have no idea about this :D