2016-06-22 03:51 AM
Hi,
I have STM32L4 based board having USB OTG Connector.I have microSD Card interfaced on SDIO (4-bit) and am using the FatFS by Chen from CubeMX.I have used the code from CubeMX to configure the STM32L4 as USBD MSC.I am able to get the USB enumerated on the PC when I connect the USB cable.But I observed that if any write/open calls to Filesystem are ongoing when this enumeration of USB is happening, then the Filesystem operations are stuck.After debugging, I found that when the USBD_Connect() is called, and the USB cable is already connected to the PC, the HAL_PCD_IRQHandler() is called multiple times.It takes around ~2.914 seconds after which this HAL_PCD_IRQHandler() is not called and the USB is detected on the PC as Mass Storage.So if I put a delay of 3 seconds after the USBD_Connect() call, then all the Filesystem related operations work fine.So is there any other way by which I can avoid to put this delay of 3 seconds ?Thanks,Sunny #stm32l4 #usbd #msc2016-06-22 08:58 PM
Hi,
Can anybody please confirm the same and give a possible solution ?Thanks,Sunny