Has anyone got a STM32F411CE Blackpill working as a USB Host?

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
Nello
Posts: 1
Joined: Wed May 25, 2022 11:16 am

Has anyone got a STM32F411CE Blackpill working as a USB Host?

Post by Nello »

Hi. I've got about a million questions and may be on conceptually shaky ground, so apologies if this is a bit scattergun.

I've been trying to work this out with the STM32CubeIDE for a few weeks now and am pretty well stumped. I can't even get VBUS power working, so suffice it to say I'm not getting very far. I've tried following most of these, but most of the doc is centred around Nucleo boards:
https://www.youtube.com/watch?v=MlhUG4GsOT0
https://controllerstech.com/stm32-usb-host-hid
https://www.bennettnotes.com/notes/stm3 ... usb-serial

I managed to find this old stm32duino thread, but it doesn't seem to get anywhere that I could see: viewtopic.php?f=62&t=197&p=3001&hilit=b ... host#p3001

Searching avidly through these forums it seems that mostly people are interested in STM32's as HID devices not as USB hosts. Has anyone ever managed to get this working?
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Has anyone got a STM32F411CE Blackpill working as a USB Host?

Post by ag123 »

I'm not familiar with the requirements of USB host, i think host is 'a lot more difficult' vs being a device. among the things, it needs to enumerate buses/devices, poll the buses/devices, power the buses etc.
nevertheless someone has done something, it isn't yet committed, but you could probably pull from the original user's repository
https://github.com/stm32duino/Arduino_C ... /pull/1196
it may not be for the F411 though. I'm not sure about the details.
superedan
Posts: 1
Joined: Wed Feb 01, 2023 3:04 am

Re: Has anyone got a STM32F411CE Blackpill working as a USB Host?

Post by superedan »

The system clock in the default setup comes from the PLL, which is generated from HSE, and is set at 96 MHz, which is the highest frequency that can be used to produce a stable USB clock (48MHz).
1v1 lol
mathew32
Posts: 1
Joined: Wed Feb 15, 2023 7:35 am

Re: Has anyone got a STM32F411CE Blackpill working as a USB Host?

Post by mathew32 »

Have you already tried getting a Nucleo to function with it so you have a reliable starting point?

I'd go in that direction...
sharase
Posts: 1
Joined: Fri Feb 24, 2023 8:44 am

Re: Has anyone got a STM32F411CE Blackpill working as a USB Host?

Post by sharase »

Make sure that all the connections between your STM32 microcontroller and the USB connector are correct and secure. Double-check your wiring to ensure that you haven't reversed any connections or made any other errors.

subway surfers
BennehBoy
Posts: 135
Joined: Sat Jan 04, 2020 2:38 am
Answers: 1

Re: Has anyone got a STM32F411CE Blackpill working as a USB Host?

Post by BennehBoy »

If you get something working, please do share with us - I was wanting to use any form of STM32 as a USB host so I could use USB keyboards with retro hardware. I gave up after much mucking about - but that's over a year ago now.
darkspr1te
Posts: 26
Joined: Tue Jan 07, 2020 4:22 pm

Re: Has anyone got a STM32F411CE Blackpill working as a USB Host?

Post by darkspr1te »

I think you need to look into the stm32f4xx examples packs available from STM website or git hub,
heres a old github example , note that bugs and api changes by stm to the stmcore renders some example code non-compilable so you may have to hunt down a older stm32core or patch to newer api/core

https://github.com/dbridges/stm32f4-dis ... hid_core.c




darkspr1te
deservepodzol
Posts: 1
Joined: Fri Jun 30, 2023 8:12 am

Re: Has anyone got a STM32F411CE Blackpill working as a USB Host?

Post by deservepodzol »

I tried to get a Nucleo working and it worked
Post Reply

Return to “General discussion”