cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX F3 USB code generation bug

ZGomo
Associate

Hi,

I'm trying to use the current CubeMX to generate USB CDC code for SMT32F303RE. The generated code doesn't connect to my Windows 10 machine. The device not even appear.

I did almost the same on STM32F411RE and STM32F407VG, both works perfectly.

Looking into the code I realized that the GPIO initialization code is not generated, I added it, but still no success.

I'm using the following components:

CubeMX v4.26.1

STM32F3 Series driver package v1.10.0

STM32F4 Serias driver package v1.21.0

Atollic TrueStudio v9.0.1

Thanks

Zoltan

5 REPLIES 5
Imen.D
ST Employee

Hello @ZGomo​ ,

Try to increase the heap and stack sizes.

Please, follow this FAQ "USB device not recognized", this may helps you:

https://st-microelectronics.jiveon.com/docs/DOC-1821-faq-usb-device-not-recognized

With Regards,

Imen

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

Hi,

i have the same problem and observed the same thing that the GPIOs are not initialized for the usb cdc. Tried the same and it doesnt work. Also tried increasing the heap size but for me it didn't change anything.

I hope we can resolve this!

Best regards

ZGomo
Associate

Hello @Imen DAHMEN​ ,

Unfortunately it doesn't help here.

The problem is not the "USB device not recognized", but the device doesn't show up. It is same like I didn't connect anything to my computer.

Actually I don't have enough time to dig deeper now as it started to work with F407VG, and I'm at early stage of the design, it has a few additional features what can be handy, so I simply switched to F407VG.

Maybe later I can work on a bit. This post mainly want to be a bug report, to enhance the code of the CubeMX, maybe someone can test it, and find out, if there is a problem or not.

Regards,

Zoltan

Try validating the hardware using the HAL examples.

Try also known working hardware like the F3-DISCO

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Bench
Associate III

Hi Clive,

I checked the hardware with the avail​able HID example for the stm32f303ze board. This worked. So I don't think it is a hardware problem. I would guess that it is a software /configuration problem in cubeMX. Is that possible? I also think that the GPIO configuration is missing in the generated code.

​thank you!