AnsweredAssumed Answered

STM32L151 bootloader autobaud issues

Question asked by nilsson.daniel.002 on Dec 17, 2015
Latest reply on Dec 17, 2015 by nilsson.daniel.002
Hi,

We are working on a design utilizing the STM32L151 MCU, which is to be programmed over a UART link using the internal bootloader. Selected baudrate for programming is 115200 (with even parity).

The issue we are having is that the baudrate on the UART link from the MCU varies a lot from one reset to the next. We understand that the MCU has an internal autobaud algorithm, but the output from this algorithm seems inaccurate. Measuring the baudrate of the initial 0x7F byte sent as "init" to the MCU we measure 115741 baud (0.47% off ideal 115200) and this baudrate is exactly the same on each MCU reset. The resulting baudrate of the "ack" command back from the MCU (0x79) varies between 114750 and 121950 baud (~6%) , this variation is larger than what our receiving UART can handle which results in communication errors.

Is there anything that can be done to increase the precision of the autobaud algorithm in the bootloader? Edge-rates of the UART signal to the MCU is around 200ns, which seems to be fast enough to give a reasonable edge detection in the autobaud detection.

When the STM32 MCU is programmed with the real application the baudrate is programmed to 115200 in code, which results in a measured baudrate of 115980 baud. This confirms that internal clocks etc are working as expected.

Thanks

Outcomes