cancel
Showing results for 
Search instead for 
Did you mean: 

USB_DEVICE code can't work!

Junde
Senior III

Hi there,

I am using STM32F429BIT6 and want to show the SDcard(connect with MCU by SDIO) as a Udisk on PC.

I can normally read/write the SD card by MCU with FATFS.

But after I added the USB config in CubeMx, the code is something wrong.

My CubeMX config is as follows:

Junde_0-1723691539237.png

Junde_1-1723691568096.pngJunde_2-1723691618953.pngJunde_3-1723691695548.png

Junde_4-1723692170702.png

As we can see, I enabled the USB log, but nothing output.

After debugging, I found the MCU is blocked in the while loop in USBD_GetEpDesc().

I don't know what that means, please help me. Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @FBL 

Thanks for your reply.

Finally I know the reason of mine project.

I am compiler the project with MDK compiler V6, this is NOT work for USB_DEVICE source code,

after I change to MDK compiler V5, everything is work well.

 

View solution in original post

2 REPLIES 2
FBL
ST Employee

Hi @Junde 

The issue with USBD_GetEpDesc() might be due to incorrect endpoint configuration. Would you share your endpoint descriptor config? Could you share a minimum project to reproduce?  USBD_MAX_STR_DESC_SIZ should be adjusted to accommodate the longest string descriptor you plan to use. A typical value might be 256 bytes to ensure USB stack can handle the string descriptors without buffer overflows. Also, it seems FH_mount(&sDisk[0]) is your custom initialization. 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


I'm out of offce with limited access to my emails.
Happy New Year!

Hi @FBL 

Thanks for your reply.

Finally I know the reason of mine project.

I am compiler the project with MDK compiler V6, this is NOT work for USB_DEVICE source code,

after I change to MDK compiler V5, everything is work well.