AnsweredAssumed Answered

STM32Cube_FW_F7_V1.5.x USB-MSC Example bug(Calculation Overflow)

Question asked by Nemui Trinomius on Dec 28, 2016
Latest reply on Aug 3, 2017 by piovesan.marco

I found seriously bug on CubeF7 v1.5.0/v1.5.x

Bug found at ./STM32Cube_FW_F7_V1.5.0/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Inc/usbd_msc.h


diff -urN b/usbd_msc.h a/usbd_msc.h
--- b/usbd_msc.h 2016-09-14 17:48:24 +0900
+++ a/usbd_msc.h 2016-12-29 00:37:02 +0900
@@ -101,7 +101,7 @@
uint16_t scsi_blk_size;
uint32_t scsi_blk_nbr;

- uint32_t scsi_blk_addr;
+ uint64_t scsi_blk_addr;
uint32_t scsi_blk_len;

"scsi_blk_addr" is also used sector-to-byte address exchange calcuration.
But that causes data corruption above 4GB address datas.

I found this bug when implementing USB-SDCard Reader on STM32F746G-Discovery.

I suspect that exists similar bug on USB-Libraries.
Please fix this bug until next release.

Best regards,