2024-02-04 06:33 PM
Hi,
I am Using an stm32f205 on our board. All the Uarts works fine at room temperature. But when the temp increases above 58 degress, messages started get missed in the uarts or sometimes it completely stops sending messages.
I am running the board at 120MHZ Here is my clock setup
2024-02-04 07:21 PM
HSI is not a particularly accurate source, especially over temperature. That's likely the cause of communication problems. Consider using an external crystal instead or other accurate clock source.
You can also adjust RCC_HSICALIBRATION_DEFAULT if you have a means of measuring/calibrating it.
2024-02-04 07:55 PM
Thanks for the response. Currently we don't have any source for measuring/calibrating HSI.
Is there any other hack around without using an external clock
2024-02-05 12:25 AM
Well, the UART works asynchronously and the bits are already sampled with oversampling when UART signals are read in, so as @TDK mentioned, a clock with a corresponding accuracy is required. If you absolutely want to use UART, you must have an appropriate clock; stable communication cannot be guaranteed with internal clock sources.
Unfortunately, the STM32F2 does not yet have an ABR (Automatic Baud Rate, AN4908) function.
Regards
/Peter
2024-02-05 01:23 AM
As the others have said, UART communication absolutely relies upon the accuracy of the clock - an uncalibrated RC really isn't going to be good enough over a wide temperature range.
This is nothing specifically to do with STM32 - the same applies to any microcontroller.
BTW:
Use this button to properly post source code:
To get that extra row of icons, press this button:
2024-02-05 02:41 AM
Try to lower the baud rate, if nothing else works.
HSI is ... terrible...
2024-02-05 02:53 AM
A lower baud rate will not help because the frequency stability of the HSI is relative and has the same effect on all derived baud rates. Only a stable clock can help here, which is unfortunately only available from HSI in a limited temperature range.
2024-02-05 03:14 AM
Our board has an esp32 also which is used to connect to internet. Would it be possible to use the Epoch timestamp to calibrate the HSI?
2024-02-05 06:02 AM
Adjust RCC_HSICALIBRATION_DEFAULT randomly until it works.
2024-02-05 12:28 PM
Yes thats what I am thinking, create a lookup table with calibration value and temperature/stm32 uptime variation