2015-12-17 01:06 AM
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.Thanks2015-12-17 07:35 AM
How long do you give the part to settle after reset?
The STM32's typically use a timer to quantify the 0x7F data pattern vs the internal clock, it's not actually trying to receive that data. Likely Input Capture, or PWM Input mode. Not sure there is a more ''accurate'' method.Does the behaviour change if you drive the pin less aggressively, or use a series resistor?If this continues to be problematic, consider using the loader at lower speeds to download your own loader into RAM, and have that take control with external crystals and known transfer rates.2015-12-17 01:32 PM
2019-02-01 08:28 AM
Hi
I have the same problem
My STM32L151 anwers always to the Flash Loader Demonstrator with the same (wrong) baudrate.
So there is always a "unrecognized device" error.
I tested every available baudrate -always the same...
Next I have tested with hyperterminal and send the 7F to the uC - and the correct 0x79 was replied by the uC. ????
When i check the levels of the Rx and Tx lines, there is a difference if i use the hyperterminal (both lines are high in idle) or the Demonstrator (Tx is high and Rx is low) - why this?
Next i tested with another project where a STM32F103 is used. There the Flash Loader Demo works fine - and the levels of the RS232 are like this:
In idle the Rx line is low, the Tx line is high, when i start bootloader mode - the Tx line goes low.
Have you the same situation?
Otmar
2019-02-01 10:22 AM
These are posts from 3+ years ago.
9600 8E1 should work on all platforms. If should be relatively robust, but is a one-shot deal, and will be sensitive to even very brief glitches/pulses.
Determine the loader version you are working with.
Check what pins the loader is monitoring, it usually looks for multiple pins. Check the errata.
Discuss with local FAE or support resources out of the local sales office. Ideally work with someone who can work directly with your hardware, and review the schematic.
The performance on the STM32F4-DISCO is problematic due to a large capacitor on one of the USART1 pins.
2019-02-03 02:18 PM
Hi Clive
Oops - Sorry i haven't noticed this, that this posts are really, really old...
...and thanks for your reply.
my Flash Loader Demo ist v2.8.0 - the latest (i hope) i've found on the website.
did you mean the errata of the L151?
Probably you've right with the Pins. I have tested the bootloader on two different boards (always the same controller)
and there is the same problem on each board.
I dont recognize why the L151 answers, connected to a Hyperterminal , which the correct baudrate ...hhmm..
Do you know if "my" levels, in the idle state, of the Rx line (low) and Tx Line (high) are correct?
Perhaps make it sense to buy an Nucleo 64 -STM32 L152 Board to verify my Flash download via UART?
Is this possible on the eval board?
Thanx for your patience Clive
Otmar