Skip to main content
LPrat.3
Associate
Sep 25, 2021 10:39 PM UTC
Solved

STM32F411CE USB CDC BlackPill

I have a blackpill board with STM32F411 48 pins IC and CubeMX/CubeIDE at lastest versions. The USB is configured as device CDC, no Vbus.

​

When I flash the board with generated code ​and plug USB in Windows 10 I get an error "invalid device descriptor". I have increased heap to 0x1000 without success.

​

It not seems a hardware issue because I can enter the board in DFU and flash or erase device using CubeProgrammer.

​

Any help will be apreciated.

​

Leonardo​

This topic has been closed for replies.
LPrat.3
LPrat.3Best answer
Associate
Sep 26, 2021 12:06 PM UTC

I found the solution, I have to increase the heap (0x1000), but this isn't enough to solve. I need to change the automatic clock configs of CubeMX that use internal 16MHz clock as source to core.

The image bellow show the way that works.

0693W00000FARupQAH.jpg 

3 replies

Pavel A.
Sep 26, 2021 12:49 AM UTC

> It not seems a hardware issue 

Then there's an invalid device descriptor. Check with a bus analyzer.

LPrat.3
LPrat.3Author
Associate
Sep 26, 2021 11:40 AM UTC

But the automatic code generated by CubeMX isn't reliable?

LPrat.3
LPrat.3AuthorBest answer
Associate
Sep 26, 2021 12:06 PM UTC

I found the solution, I have to increase the heap (0x1000), but this isn't enough to solve. I need to change the automatic clock configs of CubeMX that use internal 16MHz clock as source to core.

The image bellow show the way that works.

0693W00000FARupQAH.jpg