cancel
Showing results for 
Search instead for 
Did you mean: 

[Solved] Discovery f429 USB Host (usb stick not working)

raph
Associate
Posted on May 12, 2015 at 00:20

Hi,

I worked for several weeks on a dictaphone project with the board F429 discovery. The goal is to write the values ​​of the ADC to a file on a USB key.

My ADC works with DMA, everything is ok.

However, I generated my file with CubeMX (for Keil), I added the content in the ''USBH_LL_DriverVBUS'' function.

The problem is: Appli_state never changes to ''Ready'' and the LED of the USB key does not light.

In debug mode, the microcontroller starts, then I plug the USB key, gstate = Host_Iddle. Then gstate = HOST_ENUMERATION RequestState and remains at ''CMD_Wait'' ... And USB Status is always ''busy'' ...

I tried the example ''FW upgrade USB'' and ''USB-FATFS'' but I find no difference between them and my project.

What to add / change the code generated by Cube for the USB key working?

My board works at 168MHz, I included USB Host, FATFS support, etc ...

Thank you in advance, I can not see what to try ...

The problem was that :

 

#define USBH_MAX_SIZE_CONFIGURATION      512 //255 by default in CubeMX

 

#define USBH_KEEP_CFG_DESCRIPTOR      0  //1 by default in CubeMX

 

3 REPLIES 3
jbeck17
Associate II
Posted on October 26, 2015 at 16:13

Hi,

I have been working on implementing USB MSC on the F401 discovery. I could also find no difference between my cube output code vs. the working example. I added(and slightly modified for naming) the code from the example that utilizes the FATFS commands to write a file. Is this really the solution to the issue, config descriptor and keep config desc? After changing them to 512, and disabled does this solve the problem of writing to a USB drive?

Thanks,

Joe

Posted on October 26, 2015 at 16:59

A post from >5 months ago from a single post user, I think you'd be better off just trying the suggested fix and making your own determination.

The F4-Disco series usually have a ''FW Upgrade'' example in SPL that uses a USB MSC to load the firmware.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jbeck17
Associate II
Posted on October 27, 2015 at 14:00

I did try the proposed solution with no success. I have found several places where people mention having issues with the cube and getting hung at f_mount() and I cannot find why the example does not have problems over the cube generated code. I am starting to think it is in the setup of the USB. I have been told by tech support to take the example in the FW package and build my application around that, which I can do. I would prefer to use the cube since ST suggests using it and I like it for quick and simple setup(I am more of a HW engineer so SW is not something I wish to spend excessive amounts of time debugging before it even works). Any suggestions?