insane-adding-machines / unicore-mx

UniCore-MX | Universal Core for ARM Cortex-M0/0+/3/4/7/X
GNU General Public License v3.0
50 stars 8 forks source link

USB MSC: Last block format problem #22

Closed kuldeepdhaka closed 7 years ago

kuldeepdhaka commented 8 years ago

https://github.com/insane-adding-machines/unicore-mx/blob/master/lib/usbd/class/usbd_msc.c#L790 this cause ms->block_count to have the "Last Logical Block Address" _mass_storage.block_count = block_count - 1;

and https://github.com/insane-adding-machines/unicore-mx/blob/master/lib/usbd/class/usbd_msc.c#L345 send the "Last Logical Block Address" to host ("READ CAPACITY Command: 25h")

trans->msd_buf[0] = ms->block_count >> 24;
        trans->msd_buf[1] = 0xff & (ms->block_count >> 16);
        trans->msd_buf[2] = 0xff & (ms->block_count >> 8);
trans->msd_buf[3] = 0xff & ms->block_count;

BUT, https://github.com/insane-adding-machines/unicore-mx/blob/master/lib/usbd/class/usbd_msc.c#L369 for (i = 0; i < ms->block_count; i++) { shouldn't that be <= ms->block_count ?

kuldeepdhaka commented 8 years ago

related? https://github.com/libopencm3/libopencm3-examples/issues/112

danielinux commented 8 years ago

something, test IRCBot

kuldeepdhaka commented 7 years ago

closed: not relevant anymore.