In stable branch 21.11.x and 21.6.x (and maybe in earler) reconfiguration the baudrate scenario is broken because in function serial_lld_start is called the function usart_init with variable clock which is not setted when serial driver already is in READY state:
Code: Select all
\stable_21.11.x\os\hal\ports\STM32\LLD\USARTv2\hal_serial_lld.c
694 /**
965 * @brief Low level serial driver configuration and (re)start.
996 *
697 * @param[in] sdp pointer to a @p SerialDriver object
698 * @param[in] config the architecture-dependent serial driver configuration.
699 * If this parameter is set to @p NULL then a default
700 * configuration is used.
701 *
702 * @notapi
703 */
704 void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) {
705 uint32_t clock = 0U;
706
707 if (config == NULL)
708 config = &default_config;
709
710 if (sdp->state == SD_STOP) {
711 #if STM32_SERIAL_USE_USART1
712 if (&SD1 == sdp) {
713 clock = STM32_USART1CLK;
714 rccEnableUSART1(true);
715 }
716 #endif
...
765 }
766 usart_init(sdp, config, clock);
767 }