Skip to main content
‪tsur.1
Associate
January 3, 2021
Question

STM32F401 low temperature problem

  • January 3, 2021
  • 11 replies
  • 3211 views

Hi, I am using STM32F401CCU6 on my circuit and it working well at room temperature. When I was testing the circuit in low-temperature below -10 degrees the RX of UART1 lost messages, when I came back to 0 degrees the circuit is coming back to normal opera

This topic has been closed for replies.

11 replies

waclawek.jan
Super User
January 3, 2021

If you are using internal RC oscillator (HSI) as system clock, then this is normal, the oscillator is temperature dependent. See datasheet.

You may try to mitigate it by recalibrating the HSI on the go, or simply using HSE with a crystal.

JW

‪tsur.1
‪tsur.1Author
Associate
January 3, 2021

I have all design and manufactured my board with no option for out crystal.

so who can I do this recalibrating for low temperature? 

Tesla DeLorean
Guru
January 5, 2021

If the design doesn't work properly in the intended environment you're likely going to have to respin it in a way that does.

Perhaps you can profile the HSI, LSI and internal temp and come up with a curve that works for most or specific devices.

Auto-bauding might be the easiest to implement. If bytes are sent in bursts you could profile the inter-symbol time between interrupts.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
TDK
Super User
January 3, 2021

> who can I do this recalibrating for low temperature? 

You can recalibrate using the HSITRIM bits in the RCC->CR register and you can poll for the internal temperature using the internal temperature sensor. The tolerance range for HSI is quite large.

0693W000006HLJvQAO.png

"If you feel a post has answered your question, please click ""Accept as Solution""."
MM..1
Chief III
January 3, 2021

You have two or maybe more methods:

  1. calibrate from sender , when sender have crystal and you are receiver and can initiate send
  2. calibrate by table when you can in factory set temperature steps and have time todo
  3.  
Jack Peacock_2
Associate II
January 5, 2021

I saw a similar problem placing outdoor units in Canada and Russia during winter, using an STM32L0 part.

Short answer is you have to continually recalibrate the HSI when used in extended temperature regions (you'll see the problem in deserts during summer too). As a prior post pointed out, you can create a table, but this requires testing EVERY SINGLE UNIT in an environmental chamber over the full temperature range (-40c to +50c). This takes considerable time to set up and run. And it likely still won't work because the HSI is also sensitive to humidity. So -20c with blowing snow or freezing fog is substantially different from -20c on a nice sunny day.

The other alternative is to use a known good time source to calibrate the HSI at intervals. I used the die temperature in the STM32 to run calibration after a fixed number of degrees changed. If you don't have an HSE then you will need an LSE with external crystal (i.e. the RTC clock) and a low PPM over an extended range. Most STM32s have a method to internally clock a TIM timer with the SYSCLK (HSI) while triggering timer captures with the LSE. The pulse widths can be used to determine actual HSI frequency and calculate a new calibration factor.

If you don't have an LSE or any type of crystal or TXCO clock source then you have a serious design flaw in your PCB. Without a reference there is no way to solve your problem unless you use something other than a UART for communications (which doesn't rely on a fixed clock rate).

Jack Peacock

Uwe Bonnes
Chief
January 5, 2021

If you can allow some messages from the sender unanswered, you could put the RX signal also on some timer input and capture the edges of the incoming signal edges. With some heuristic you can get the number of ticks for one bit and adjust your baudrate.If you start sending in normal conditions and keep sending, you can track all the way without the fear of message loss.

Vangelis Fortounas
Associate II
January 5, 2021

Hello

if the device is not battery powered, a proper PTC, or normal resitor , or even a small incandescend bulb is a solution to warm the MCU and to keep it in the normal temperature range.

gregstm
Senior II
January 5, 2021

I would check voltage levels as well - especially if a battery is involved or an RS232 convertor (that has an inbuilt charge pump). Perhaps send/loop a test character repeatedly and compare the voltage/timing differences at the temperature extremes.

Uwe Bonnes
Chief
January 5, 2021

Some protocoll that sends ab autobaud pattern first and autobauding on the cold target could work too.

‪tsur.1
‪tsur.1Author
Associate
January 6, 2021

hi guys, thanks a lot for the help, I did calibrate the HSI, and the UART start working at -20 degree.

 The AN5067 Application note is very helpful for this case.

 I am still working on the calibration process with automation in the oven. 

I also read in the reference manual (RM0368) on page 101 that it's possible to make the calibration with the LSI clock and not just with LSE, is someone here know this method?