2015-05-11 03:20 PM
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
2015-10-26 08:13 AM
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,Joe2015-10-26 08:59 AM
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.2015-10-27 06:00 AM
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?