Custom Board using STM32Duino | SerialUSB + PB0

Post Reply
HarrisonDragoon
Posts: 3
Joined: Tue Aug 29, 2023 4:21 pm

Custom Board using STM32Duino | SerialUSB + PB0

Post by HarrisonDragoon »

Hello,

I have a custom board with STM32F405 using PlatformIO with STM32Duino core (not maple).

I have several pin conflicts. I need to use PB0, PB5, PB1, PA5 as analog inputs. However, I have a SerialUSB (USBC) which is setting them up as USB_OTG_HS. Which doesn't let me read those pins as analog inputs.

How can I get those pins working correctly? I would appreciate any ideas or help.
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Custom Board using STM32Duino | SerialUSB + PB0

Post by ag123 »

if I'm not wrong, usb is normally at PA11 USB DM, PA12 USB DP
and that to be 'safe', ADCs are normally used at PA0-PA7
HarrisonDragoon
Posts: 3
Joined: Tue Aug 29, 2023 4:21 pm

Re: Custom Board using STM32Duino | SerialUSB + PB0

Post by HarrisonDragoon »

Yea, PA11 is USB DP and PA12 is USB DM.

Per the datasheet, PB0 for example has an alternate function OTG_HS_ULPI_D1 and its additional function ADC12.

For some reason PB0 is getting assigned to OTG_HS_ULP1_D1 when USB should only take up A11, 12.
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Custom Board using STM32Duino | SerialUSB + PB0

Post by fpiSTM »

I guess you use the generic. Simply redefine the pinmap USB array to only configure the 2 pins PA11 and PA12. See the wiki to known how to do this.
Post Reply

Return to “STM32F4 based boards”