cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 internal temperature sensor wrong. simple offset vs full calibration?

Cor
Visitor

Hello,

we are seeing a systematic offset when using the internal temperature sensor of the STM32G031G8U6.

Over the years we have tested ~50 SoCs (different production batches), and all devices show a very consistent temperature reading that is about 2–3 °C too high at room temperature compared to an external reference, higher temperatures weren't tested.

Because of this, we are considering programming a temperature offset during flashing. Before doing so, we would like to better understand whether a single-point offset calibration is sufficient, or if the internal slope accuracy is not reliable enough, requiring a full two-point calibration.

Example:
If the MCU reports 24 °C but the real temperature is 21 °C, can we simply apply a +3 °C offset globally?
Or is the internal temperature slope not guaranteed well enough, meaning that a two-point calibration is required?

More specifically, regarding the factory calibration values on STM32G0:

  • TS_CAL1:
    ADC raw value measured at 30 °C
    Tolerance: ±5 °C

  • TS_CAL2:
    ADC raw value measured at 130 °C
    Tolerance: ±5 °C

My question is about how to interpret these tolerances.

Does the ±5 °C tolerance mean that both calibration points share the same temperature offset (e.g. TS_CAL1 measured at 27 °C and TS_CAL2 measured at 127 °C)?
Or is it possible that the errors are independent (e.g. TS_CAL1 at 25 °C and TS_CAL2 at 135 °C)?

If the second case is possible, then the effective slope could be significantly off, and a user two-point calibration would be required.
If the first case is true (correlated offset), then a simple offset correction would likely be sufficient — especially since the datasheet specifies a linearity of around ±1 °C.

Could someone from ST please clarify how these tolerances should be interpreted, and whether a single-point offset correction is considered acceptable for STM32G0 internal temperature sensing?

Thank you very much.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

> Does the ±5 °C tolerance mean that both calibration points share the same temperature offset (e.g. TS_CAL1 measured at 27 °C and TS_CAL2 measured at 127 °C)?
> Or is it possible that the errors are independent

It means the latter. However, chips are all tested in the same standardized testing and you shouldn't see large differences between chips produced at the same time, as your observations have shown.

If you need a 100% guarantee on temperature accuracy, you will need to test at the full range. You won't get guarantees beyond what the datasheet says. But for most applications a single point at ambient to eliminate the offset is more than enough.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
LCE
Principal II

The STM's internal temperature sensor shows the IC's internal temperature, getting from that the ambient temperature would very much depend on the complete device, from PCB placement and layout up to case design.

IMO, that would be a good estimation in the best case, far from any accurate measurement.

I like using the internal temperature sensor, but mainly as a safety net / information if it's getting too hot, which might show that something's very wrong - or the customer uses the device out of spec.

TDK
Super User

> Does the ±5 °C tolerance mean that both calibration points share the same temperature offset (e.g. TS_CAL1 measured at 27 °C and TS_CAL2 measured at 127 °C)?
> Or is it possible that the errors are independent

It means the latter. However, chips are all tested in the same standardized testing and you shouldn't see large differences between chips produced at the same time, as your observations have shown.

If you need a 100% guarantee on temperature accuracy, you will need to test at the full range. You won't get guarantees beyond what the datasheet says. But for most applications a single point at ambient to eliminate the offset is more than enough.

If you feel a post has answered your question, please click "Accept as Solution".