cancel
Showing results for 
Search instead for 
Did you mean: 

Windows error "insert disk" with USB MSC device application !

TKou
Associate II

I am working on a USB MSC device application that exposes the content of an sd card with SPI communication.

The application works fine with a Sandisk Class 4 32Go card

But does not work with class 10 16Go sd cards. I've tried with two cards

I've tried changing the SPI communication speed, the sector sizes ... but nothing works

I have another application where these cards work fine with FATFS.

I think the problem is with usb enumuration, but I don't know what to change.

Any help ?

13 REPLIES 13
dbgarasiya
Senior II

just add some line in along with your code............int8_t STORAGE_IsReady_FS(uint8_t lun) function

static int8_t prev_status = 0;

int8_t ret = -1;

if(BSP_SD_IsDetected() != SD_NOT_PRESENT)

{

if(prev_status < 0)

{

BSP_SD_Init();

prev_status = 0;

}

if(BSP_SD_GetCardState() == SD_TRANSFER_OK)

{

ret = 0;

}

}

else if(prev_status == 0)

{

prev_status = -1;

}

return ret;

you have to changes accoding to your requirement, this is for SDIO configuration ,

Thank you but this doesn't help,

TKou
Associate II

As far as I studied The problem isn't with the class of the sd card,

The difference here is with the start sector, the cards with a start sector = 0, are read with the usb msc but others aren't

I've found this detail while studying FATFS there is what's called VOLBASE or start sector that is determined when f_mount is called. I tried formatting my sd cards that have a start sector != 0 but the start sector never changes,

The question now is what does FATFS do with this start sector and how to interpret future interactions with the sd card in my msc application inorder to make it work ...

I'm still looking for answers ...

svii
Associate III

Hi i am trying to implement the same on a 16GB class 10 sd card, sd spi interface working well using the same driver and tested ,as you described the msc usb is not working need some guidance was the above problem resolved ,could you share the usbd_storage_if.c file .Thank you