cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 low temperature problem

‪tsur.1
Associate II

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

12 REPLIES 12

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
Associate II

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

so who can I do this recalibrating for low temperature? 

TDK
Guru

> 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

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
Senior III

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
Principal III

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.

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 III

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
Principal III

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