STM32 UART stops At High Temperature
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-04 6: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
- Labels:
-
STM32F2 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-04 7: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-04 7: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-05 1: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:
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-05 2:41 AM
Try to lower the baud rate, if nothing else works.
HSI is ... terrible...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-05 2: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-05 3: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-05 6:02 AM
Adjust RCC_HSICALIBRATION_DEFAULT randomly until it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-05 12:28 PM
Yes thats what I am thinking, create a lookup table with calibration value and temperature/stm32 uptime variation
