This function was using apb1 for quite a few families instead of apb2. This only mattered for L1 and F3, and for USART1/USART6, and only if apb1 speed != apb2 speed. Instead of using families explicitly, just check for the peripherals themselves. On F0,F1,F2,F3,F4,F7,H7,L0,L1,L4, usart1/6 are _always_ in the rcc_apb2 register and the other uarts are all on apb1. (F0 doesn't actually _have_ apb2, but it's still called the apb2 register)