2024-01-15 12:19 AM
Hello,
I try to add MSC feature to my app. MCU is L452.
To avoid side effects, I started a brand new app with cubeIDE/Mx.
I activated USB_DEVICE feature.
I declared the USB_DEVICE as mass storage class.
I had a look to the MSC_standalone example from G0 cube library and did not see more calls to the usb lib from the main (except PD features that are not relevant for me) than the call to MX_USB_DEVICE_Init(); Nothing in the intrerrupt file too.
For this reason, I was expecting my device to appear in windows explorer as an external storage (of course with no data because nothing is implemented at this level) but it's not the case. I put some breakpoints in usbd_storage_if.c but none of the functions is called.
Are there some more calls I should do to make my PC discover my device as usb storage? or should I suspect a hardware failure?
Thanks
Julien
2024-01-15 01:01 AM - edited 2024-01-15 01:59 AM
Hi,
You should look at examples , like here :
for L4xx ->
+
When plug in USB , get some ding-dong (windows) or can see device connected (linux) ?
If not - you do "nothing" on the usb bus ... something like this :
*/
static void USBH_UserProcess(USBH_HandleTypeDef *phost, uint8_t id)
{
switch (id)
{
case HOST_USER_SELECT_CONFIGURATION:
break;
case HOST_USER_DISCONNECTION:
Appli_state = APPLICATION_DISCONNECT;
if (f_mount(NULL, "", 0) != FR_OK)
{
LCD_ErrLog("ERROR : Cannot DeInitialize FatFs! \n");
}
if (FATFS_UnLinkDriver(USBDISKPath) != 0)
{
LCD_ErrLog("ERROR : Cannot UnLink FatFS Driver! \n");
}
break;
case HOST_USER_CLASS_ACTIVE:
Appli_state = APPLICATION_READY;
break;
case HOST_USER_CONNECTION:
if (FATFS_LinkDriver(&USBH_Driver, USBDISKPath) == 0)
{
if (f_mount(&USBH_fatfs, "", 0) != FR_OK)
{
LCD_ErrLog("ERROR : Cannot Initialize FatFs! \n");
}
}
break;
default:
break;
}
}
You have it in your program - or not yet ?
+++ read here, how to do:
2024-08-15 02:05 AM
Hi, @JulienD
Have you resolved this problem, I am here too...