cancel
Showing results for 
Search instead for 
Did you mean: 

SD Card and USB problems.

MBolo.1
Associate III

Hi, I'm working with an STM32F446VET MCU. The goal of the F446 is to get data from some sensors and store it on an SD Card and send it at the same time to a COM port. I was able to make Windows to recognize the USB/COM port (https://community.st.com/s/question/0D53W000016p8LxSAI/some-help-with-the-usb-on-the-stm32f446vet-) but when I enable the SDIO and flash the code on the chip I'm getting a Errors :

  1. I'm getting the window message that "USB device not recognized"

Problem is : I need it to bee seen as a COM port. Any help and suggestion would be appreciated.

5 REPLIES 5
Imen.D
ST Employee

Hello @MBolo.1​ ,

Have a look at this FAQ: USB device not recognized (st.com), it may help you.

When your question is answered, please close this topic by choosing Select as Best.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Imen.D
ST Employee

Hi @MBolo.1​ ,

Were you able to resolve the issue you initially described here?

If yes, it will be interesting to share with us the solution you found.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
MBolo.1
Associate III

Hi, so there was no issue, sorry for commotion. The message was from an USB stick that for some reason was giving that message from time to time. After removing the stick from PC USB port the message was gone. Initially I thought that problem was that the windows was seeing that the SD card and the F446 as a whole removable memory card.

Now I get the "f_mount" equals FR_OK, but when it comes to initialize the card in the "f_mkfs" I'm getting FR_NOT_READY. Working on that issue now, when I will find a solution I will update.

MBolo.1
Associate III

Update!!

I was able to trace the error to the HAL library, and it comes from "stm32f4xx_hal_sd.c" line 404 HAL_SD_InitCard , errorstate=3 or sometimes 4, continue to dig deeper.

MBolo.1
Associate III

Update 2 !

Hi @Imen DAHMEN​ 

Today I think I got to the root of the problems. It looks like that during the initiation of the card it has problems figuring out what voltage the SD Card is using, or the card is not responding during that process.

In the fille stm32fxx_hal_sd.c at method SD_PowerON() it tries to figure out the voltage, at line 2805 is calling SDMMC_CmdAppCommand() from file stm32fxx_II_sdmmc.c at line 861, at line 877 is called SDMMC_GetResp1() method located in the same file at line 1168, this methode at line 1191 returns SDMMC_ERROR_CMD_RSP_TIMEOUT .