2018-03-26 05:33 AM
Hi,
I have STM32L4 based board NUCLEO-L476RG
I have initialised it USB Device Only Mode with Mass Storage Class IP and a microSD Card interfaced on SDIO (1-bit) and from CubeMX.
I am using MSI RC at 48MHz to clock USB.
STM32Cube_FW_L4_V1.8.1\Projects\STM32L476G_EVAL\Applications\USB_Device\MSC_Standalone.
Based on this example, I have made all the necessary modification in usbd_storage_if.c file.
I am able to get the USB enumerated on the PC when I connect the USB cable, the device appears in Unspecified category.
No new removable drive appears in the system window.
I have checked all the blogs I could and I have gone through the
UM1734 User manual
STM32Cube USB device library
for more than 2 weeks
I have implemented a mouse before this and as well with the same sd config I have initialised FatFS on SD Card I didn't face any problem so I don't think there's some hardware issue.Any help ?
How can I debug or if something more needs to be done?
Thanks & regards
Farhan
st.mcu
‌,ELMHIRI.Syrine
DAHMEN.IMEN
ELMHIRI.Syrine
#sdcard-fatfs #usb #stm32l4 #clive-one #usbmsc2018-03-26 06:09 AM
You'd likely need to instrument the USB interactions, and at the SCSI/ATAPI command processing level. Use the serial port or SWV so as not to interfere with the real-time operation.
2018-03-27 01:07 AM
I have an another board stm32f4-discovery, I ported the above code to it and this is what I get
2018-03-27 04:41 AM
On further looking for information this is what I got
2018-03-29 11:29 PM
Update :
After plugin the usb, and I am powering through USB VBUS I get a popup and I can see the removable drive in file explorer but it's not able to detect or access it
Any suggestions or help?
________________ Attachments : usbd_storage_if.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxr4&d=%2Fa%2F0X0000000b1P%2FK36HgwhzvAJpaqN..0D7BixAuAhWJ3TOCKxo.whRqv8&asPdf=false2018-03-30 03:00 AM
Update :
I am able to copy and delete files but can't write something.
Any suggestions?
________________ Attachments : usbd_storage_if.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxqz&d=%2Fa%2F0X0000000b1O%2Fduxs9hGpZqKi8AZbldypTMepStTrBvv3.U05prOISVo&asPdf=falsemain.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxqu&d=%2Fa%2F0X0000000b1N%2F2lccUh10p7hM__NXW_0TwELxGmFjHm1um64XILEkr0o&asPdf=false2018-04-03 04:53 PM
The MSC example code I started from was missing some critical code that broke writes. See here:
https://community.st.com/0D70X000006SyvdSAC
Perhaps this is the problem you are seeing too?
James
2018-04-03 11:26 PM
Thanks for your reply.
I was able to resolve it eventually.
SD card was detected I used to get the popup and it used to appear in removable device, but the PC wasn't able to access the SD card.
After completing sd fatfs and usb initialisation.
I again called sd_init and it worked