USB problem on STM32F411CEU6

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
uraich
Posts: 56
Joined: Tue Mar 26, 2019 12:24 pm

USB problem on STM32F411CEU6

Post by uraich » Sun Aug 02, 2020 3:52 pm

Hi,
Today I flashed MicroPython on my STM32F411CEU6 board. I tried dfu mode but did not see any dfu device using dfu-util. I managed to flash it with stlink. When connecting it with an USB to serial adapter on PA9, PA10 everything works fine. However, I cannot use the USB type C connector to talk to the board.
stm32error.png
stm32error.png (60.6 KiB) Viewed 4559 times
I am using Ubuntu 20.04.
Has anybody seen and solved this problem?

jsa13
Posts: 2
Joined: Sun Aug 02, 2020 7:19 am

Re: USB problem on STM32F411CEU6

Post by jsa13 » Sun Aug 02, 2020 6:29 pm

There is no DFU boot loader on the board default you have to install it first with your st-link, but there are not much space left on the flash, so I do not know if it is a good idea to use it. I have tested the board once and didn't  have any problems with the USB.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: USB problem on STM32F411CEU6

Post by dhylands » Mon Aug 03, 2020 9:36 pm

The STM32F4 series has a built in DFU bootloader - no need to flash one.

In order to use USB, you should have your PLL frequencies setup so that the system clock is a multiple of 48 MHz, so you should run it at 96 MHz rather than 100 MHz.

shaoziyang
Posts: 363
Joined: Sun Apr 17, 2016 1:55 pm

Re: USB problem on STM32F411CEU6

Post by shaoziyang » Tue Aug 04, 2020 1:08 am

If crystal‘s load capacitance is not match, it will takes a long time before PLL frequencies stable, exceed DFU bootloader detect time.

uraich
Posts: 56
Joined: Tue Mar 26, 2019 12:24 pm

Re: USB problem on STM32F411CEU6

Post by uraich » Wed Aug 05, 2020 8:03 pm

I am using the board specs from https://github.com/mcauser/WEACT_F411CEU6 which say that the board is configured to run at 96 MHz.
stm32.png
stm32.png (24.06 KiB) Viewed 4462 times
Having a look at the issues chapter on this repository it seems that I am not the only one having the problem.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: USB problem on STM32F411CEU6

Post by dhylands » Wed Aug 05, 2020 9:16 pm

What host device are you using?

Have you tried using a hub between your host and the board?

The fact that the REPL works fine on PA9 and PA10 suggests that the clock is being setup properly, otherwise your baud rate wouldn't work out. I would also double check your power/ground connections from the USB-C connector. There are multiples of power and ground and D+/D- which all need to be connected together on your board.

Also try flipping the USB-C cable over. They're supposed to be symmetrical, but I've seen weirder things.

uraich
Posts: 56
Joined: Tue Mar 26, 2019 12:24 pm

Re:USB problem on STM32F411CEU6

Post by uraich » Thu Sep 03, 2020 6:53 pm

Finally I found the culprit: It was the type C USB cable giving problems. I received another cable for test and with that new cable everything works as expected.

Post Reply