electrodyssey.net

Odyssey of Electronics and Computers

STM32Cube, STM32F401RE; USB host VBUS and UART1 conflict

January 26, 2021 — Nazim

Spent a significant amount of time trying to figure out why the USB host generated by STM32Cube was halting on STM32F401RE when UART1 was receiving data. It was driving me mad during the last couple of days. The board I'm using got no dedicated VBUS signal controlling the power on a USB interface, so I was assuming it's safe not to configure DriveVBUSFS in STM32Cube -> Middleware -> USB_HOST -> Platform Settings. I was spectacularly wrong. Despite UART1 RX being configured on PA9 pin (which is VBUS by default on STM32F401RE), it was still affecting the USB, so every incoming UART1 transmission was disrupting the USB host.


Alt

Once DriveVBUSFS was configured to an unused GPIO port, the application went on as expected.

Wanna know a lesson learned here? Next time I'm going to use ARM9 and the embedded Linux for a similar application.

Tags: embedded, mcu, usb