cancel
Showing results for 
Search instead for 
Did you mean: 

I am working with STM32F407 to write a text file to Pendrive (USB Host). But i am getting FD_DISC_ERR. When I debugged more i understood that this is due to HOST_DEV_WAIT_FOR_ATTACHMENT issue. Can anyone help why this is happening?

Ajithkumar
Associate II
 
3 REPLIES 3
Ajithkumar
Associate II

These are the pinout and clock config diagram

I am working with STM32F407 to write a text file to Pen drive (USB Host).

f_open(&MyFile, "testfile.txt", FA_CREATE_ALWAYS | FA_WRITE);

getting FD_DISC_ERR. When I debugged more i understood that this is due to HOST_DEV_WAIT_FOR_ATTACHMENT issue. Can anyone help why this is happening?

0693W00000aJjocQAC.png 

0693W00000aJjomQAC.png

Imen.D
ST Employee

Hello @Ajithkumar​ and welcome to the Community ��

Try ClockDiv with 2 or 4.

I advise you to get inspired from the available examples available with STM32CubeF4 MCU package, and you will find more details on this article: Introduction to USB with STM32.

Make sure to use latest versions of STM32CubeMX and STM32CubeF4 MCU package.

Imen

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

Not worked. I tried with multiple clock vales.

I tried with example project in CudeIDE as well as i created new project from scratch but not worked me both.

Is any Size limitation for Flash Drive size ?

I mean I tried with 16GB and 32GB Flash Drive