cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeF7 v1.6.0 USB MSC Device Example bug(incorrect total sector number)

Posted on April 04, 2017 at 17:15

Dear ST support team,

I found minor bug on CubeF7 v1.6.0.

Bug found at ./STM32Cube_FW_F7_V1.6.0/Projects/STM32746G-Discovery/Applications/USB_Device/MSC_Standalone/Src/usbd_storage.c

diff -urN b/usbd_storage.c a/usbd_storage.c
--- b/usbd_storage.c 2016-12-31 02:35:58 +0900
+++ a/usbd_storage.c 2017-04-04 23:57:44 +0900
@@ -124,7 +124,7 @@
 {
 BSP_SD_GetCardInfo(&info);
 
- *block_num = info.LogBlockNbr - 1;
+ *block_num = info.LogBlockNbr;
 *block_size = info.LogBlockSize;
 ret = 0;
 }�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

In STORAGE_GetCapacity(),it should return ''total sector number''. Thus it is not suitable to return ''last sector address''(by info.LogBlockNbr - 1) here. 0690X00000606afQAA.png

''Last sector address'' returns on SCSI_ReadCapacity10() or SCSI_ReadformatCapacity() in

./STM32Cube_FW_F7_V1.6.0/Middlewares/ST/STM32_USB_Device_Library/Class/MSC/Src/usbd_msc_scsi.c

I noticed this bug while evaluating industrial SDCard with S.M.A.R.T.

AFAIK,CubeF4 also have this bug(maybe other Cubes...). Please fix until next release.

Best regards,

Nemui. #usb-msc
2 REPLIES 2
Imen.D
ST Employee
Posted on April 04, 2017 at 18:44

Hi

Nemui.Trinomius

,

Thank you for your reported issue. I will check this and report it internally if confirmed.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee

Hello,

This issue is confirmed on the project file MSC_Standalone/Src/usbd_storage.c, and it will be fixed in the coming releases of the CubeF7 firmware package.

With Regards,

Imen.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen