You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I've been doing some tests writing (a lot of) data to an SD card using mynewt_glue.c.
I found a bug the corrupts the entire FS if we cross the 4GB addressing space.
The issue:
in mynewt_glue.c:
disk_read() and disk_write() both pass to dops->read() address = sector * 512.
Both sector and address being 32 bits, that's an issue if we cross sector 8388607 which is 4GB.
Behind, mmc_write() and mmc_read() (called by dops->read()/write() in mmc case) both proceed to divide the address by BLOCK_LEN (defined as 512 in mmc.c).
One solution would be to change mmc_write() and mmc_read() to expect a 64bits address (and change mynewt_glue accordingly).
Or to just remove this addr*512 and addr/512 parts (which is not very optimized...)
I can do the modifications myself and PR as soon as we agree on which way to fix this issue.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
I've been doing some tests writing (a lot of) data to an SD card using mynewt_glue.c.
I found a bug the corrupts the entire FS if we cross the 4GB addressing space.
The issue:
in mynewt_glue.c:
Both sector and address being 32 bits, that's an issue if we cross sector 8388607 which is 4GB.
One solution would be to change mmc_write() and mmc_read() to expect a 64bits address (and change mynewt_glue accordingly).
Or to just remove this addr*512 and addr/512 parts (which is not very optimized...)
I can do the modifications myself and PR as soon as we agree on which way to fix this issue.
Thanks!
The text was updated successfully, but these errors were encountered: