2014-04-29 11:23 PM
Hi Everybody,
I'm trying to get a basic USB communications device class device project working using the STM32F429I-Disco board. I'm using smt32cube application to generate the code for the Keil uVision environment. When I run the code on my board and plug the user usb port into my laptop I get a device not recognized error from windows. I don't think its enumerating correctly because I don't see the device or vendor ids in the device id box when I look at the driver properties. Basically I just use the cube software to generate a project (configure usb, & clock), compile it, and run it. Everything compiles fine, and seems to run ok (no hard faults) on hardware. I don't do any configuration of the cube generated firmware because it's not really clear to me what else I need to configure. Could anybody give me a hint as to what I might be missing? Attached is my stm32cube configuration file so you can recreate my project. Thanks,John #stm32f4-discovery-429-usb-cube2014-06-23 02:49 PM
Hi,
I am wondering if anyone out there can report this working? I just got CUBE and an F4 Discovery board and followed about this same process as described here. The resulting generated project was missing some functions when it linked. I fixed that by adding 'stm32f4xx_hal_pcd_ex.c' to the project. It now compiles (using Keil uVision4) and runs. The PC however does not know what to make of the device. I added a COM port '.inf' file to the PC that is keyed to the exact VID/PID of the device but no improvement. Any input on this would be appreciated. Dave2014-06-25 08:12 AM
Updates to question.
I have since gone back to an older, working ST USB CDC project and compaired all the Descriptor blocks byte by byte. The only change I made was the DeviceClass from 0x00 to 0x02 (CDC) in the main descriptor. The PC now acts somewhat better. It detects the device and shows its description string, goes to search Windows Update, appears to find a driver, and FAILS on driver install! I have kept the CUBE generated code settings of VID=0483 and PID=5740. Any ideas?2014-06-25 09:12 AM
Hi
I have not used the Cube generated code, worked with the discontinued Peripheral Libraries. One common cause of un-recognised USB device is the STM USB peripheral is being clocked at the wrong freq. Double check the clock config for AHB bus2014-06-25 10:45 AM
Thanks for the suggestion.
Part of my mission here is to learn and gain confidence in the CUBE tool. So far the confidence part is a little short. I am attaching an image of the cube provided clock settings. It appears that the special 48MHz clock is being properly configured. I realize that USB starts slow and can increase speed based on device capabilities. Would the PC be able to show the Device Description string from the device if the clock is wrong? That string is appearing on the PC correctly. Dave ________________ Attachments : CUBE-Clock.TIFF : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I04Z&d=%2Fa%2F0X0000000bT6%2FdeFb8cAeM1_wzCnuZlVHvVuMmDD4NhjC7wi7y0Fe3gw&asPdf=false2014-06-26 01:49 AM
Hi
As I said, I have not used the Cube code generator - so I cannot help with regards configuring STMCube. ''Would the PC be able to show the Device Description string from the device if the clock is wrong?'' No. USB specification for data clocking are very specific. Hence, my suggestion about checking the STM32 USB peripheral clock. I found at the start of my project that the USB peripheral clock had not been set correctly and I could not get the PC to enumerate the STM32 USB device.