2025-07-28 8:46 PM
Am I seeing this right? According to the datasheet, the STM32F413xG/H only maps USART3_RX to PB11, PC5, PC11, and PD9. All four happen to not exist in the STM32F413CG/H variants with the UFQFPN48 package!
Bit weird this doesn't seem to be noted anywhere. I guess this 10 UART chip is really a 9.5 (or fewer?) UART chip in the 48 pin package?
Extra keywords: STM32F413C STM32F413CH
2025-07-28 9:22 PM
That’s often the case with the smaller packages. They have the same silicon chip inside, but not all of the pins are bonded out.
I don’t know how ST decide which peripherals to route to which gpio pins, or which gpio pins to exclude as packages get smaller, but they seem to end up with a fairly good compromise.
I’d like to see more flexibility in mapping peripherals to external pins to simplify my pcb layouts. I don’t know if some of the other manufacturers have different solutions.
2025-07-28 10:28 PM - edited 2025-07-28 10:29 PM
Yes, true. I was thrown by TX being available but not RX! It seemed like a nasty gotcha, when there's no quick reference as to which peripherals can actually be used.
In the end I pored through the 48 pin, 64 pin and 100 pin variants trying to figure out what I could use. Some uarts are not available at all on lower pin count variants, which is not too surprising. But others had tricky clashes that seemed a bit wicked to discover. Probably just an unfortunate coincidence of being a particularly high peripheral count device?
To save others the trouble, here's what I found are usable (note I wasn't looking at CK as a first priority):
So a significant ramp up of 4 (ish), 6 and all 10 UARTs available.
2025-07-28 10:52 PM
Consider 1-wire mode.
Not sure if this model supports RX/TX pin swap mode.
Debug/Telemetry might only need TX output.
Frequently bond-out options on smaller packages can be less than optimal.
Some newer/smaller offerings bond some pins together. Check if there are other newer parts with more flexibility, or higher pin count but physically smaller choices.
2025-07-28 11:32 PM - edited 2025-07-28 11:35 PM
Oh yes, I forgot about single-wire mode! Yes, all 10 uarts support it. Good for half-duplex peripherals, which is a lot of them if they play ball.
Reminder to self: it's the RX pin that's not used in that mode, so indeed that would make USART3 usable on the 48 pin variant!
Good point on debug/telemetry. Also, standard GNSS receivers are a good example of the opposite - might only need RX input. But no, I don't believe this family supports TX/RX swap.
PS. I've now gone through the rest of the pin allocation. Boy is that mux table lumpy! No alternative functions on PC13/14/15, and just about every important function on PB3. Makes the smaller pin count variants a real tough juggling act.