cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX+STM32L476RET6+MSC+SD. Windows 7 Can Read/Write file,but can not format.Anyone can help me?

gfeng
Associate

0690X00000ARKfeQAH.jpg

1 REPLY 1
gfeng
Associate

I don't know, right? The test Windows 7 is readable, written and formatted.

In usbd_msc_scsi.c file SCSI_Write10() function

Before:

  /* check if LBA address is in the right range */

  if(SCSI_CheckAddressRange(pdev, lun, hmsc->scsi_blk_addr,

               hmsc->scsi_blk_len) < 0)

  {

   return -1; /* error */

  }

Modified:

  /* check if LBA address is in the right range */

  if(SCSI_CheckAddressRange(pdev, lun, hmsc->scsi_blk_addr-1,

               hmsc->scsi_blk_len) < 0)

  {

   return -1; /* error */

  }