Skip to main content
Visitor II
May 10, 2025
Solved

Which internal temperature is correct in STM32Cube FW_G4 V1.6.1

  • May 10, 2025
  • 2 replies
  • 497 views

 

I want to use Macro "__LL_ADC_CALC_TEMPERATURE" to calculate the chip's temperature. But there is a difference here.

 

SourFish_0-1746894897106.png

SourFish_1-1746894916843.png

As mentioned above, in datasheet, TS_CAL2 corresponds to 130 ℃.

But in STM32Cube FW_G4 V1.6.1, file "stm32g4xx_ll_adc.h", line 386, TEMPSENSOR_CAL2_TEMP corresponds to 110 ℃.

 

Which one is ture?

    This topic has been closed for replies.
    Best answer by TDK

    It is 130 and is correct in the GitHub version, but a library release has not yet been made which includes this fix.

    stm32g4xx-hal-driver/Inc/stm32g4xx_ll_adc.h at 1a4f1ca138a19dfe42becc50975f11a1e7554e31 · STMicroelectronics/stm32g4xx-hal-driver

    Solved: Re: STM32G431 TS_CAL2 temperature - STMicroelectronics Community

     

    This issue was fixed a few years ago, then broken, and now fixed but not yet released.

    2 replies

    Graduate II
    May 10, 2025

    Please tell us what your exact MCU model you have, what datasheet version you used and what version STM32CubeMX and version of firmware pack you use(FW_G4 V1.6.1?).

    TDKAnswer
    Super User
    May 10, 2025

    It is 130 and is correct in the GitHub version, but a library release has not yet been made which includes this fix.

    stm32g4xx-hal-driver/Inc/stm32g4xx_ll_adc.h at 1a4f1ca138a19dfe42becc50975f11a1e7554e31 · STMicroelectronics/stm32g4xx-hal-driver

    Solved: Re: STM32G431 TS_CAL2 temperature - STMicroelectronics Community

     

    This issue was fixed a few years ago, then broken, and now fixed but not yet released.

    Graduate II
    May 10, 2025

    @TDK wrote:

    This issue was fixed a few years ago, then broken, and now fixed but not yet released.


    That's bad. How can something like that happen? Does nobody review pull requests at ST?

    Super User
    May 10, 2025

    Do 99 things right and 1 thing wrong and people will always focus on the 1. People are human, mistakes happen. Nobody bats 100%.