zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
9.91k stars 6.1k forks source link

Fix the temperature ADC_STM32_Die_Temp_Read value getting incorrect for nucleo_h743zi in Zephyr 3.6.0 #72835

Open ShubhadaHarkut-eaton opened 4 weeks ago

ShubhadaHarkut-eaton commented 4 weeks ago

nucleo_h743zi: incorrect ADC_STM32_Die_Temp_Read temperature value. Zephyr 3.2.0

nucleo_h743zi.overlay /{ zephyr,user { / adjust channel number according to pinmux in board.dts /

io-channels = <&adc3 18>;

}; };

... To Reproduce Steps to reproduce the behavior: To Build: west build -b nucleo_h743zi ./ --pristine To Flash: west flash

  1. See error *** Booting Zephyr OS build v3.6.0 STM32 Die temperature sensor test Current temperature: -173.3 �°C Current temperature: -126.2 �°C Current temperature: -128.2 �°C Current temperature: -128.8 �°C Current temperature: -128.8 �°C Current temperature: -126.9 �°C Current temperature: -126.2 �°C Current temperature: -126.5 �°C Current temperature: -126.9 �°C Expected behavior positive value

Impact High

Logs and console output

STM32 Die temperature sensor test Current temperature: -173.3 �°C Current temperature: -126.2 �°C Current temperature: -128.2 �°C Current temperature: -128.8 �°C Current temperature: -128.8 �°C Current temperature: -126.9 �°C Current temperature: -126.2 �°C Current temperature: -126.5 �°C Current temperature: -126.9 �°C

Environment (please complete the following information):

OS: zephyr-v3.6.0 Toolchain zephyr-sdk-0.16.5 Commit SHA or Version used

FRASTM commented 3 weeks ago

@ShubhadaHarkut-eaton can you please check the boards DTS. With sha1 adeb19b30cbfb3552cb2d19c6c6676a872afe6c0 , we see a correct valu when running
west build -p -b nucleo_h743zi samples/sensor/die_temp_polling/

*** Booting Zephyr OS build v3.6.0-4280-g105fc792675c ***
CPU Die temperature[dietemp]: 28.4 °C