STM32H743XX MCU Temperature

I have a question how to add the stm32 temperature sensor in klipper?

Easy peasy, add the following statement to your printer.cfg:

[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100

I’ve defined the controller as “mcu”, as in:

serial: /dev/serial/by-id/usb-Klipper_stm32f407xx_##UNIQUE#USB#SERIAL#HERE##-if00
1 Like

Thank you but I tried this already. I have a BTT SKR3 and when i add the sensor it answers ADC_TEMPERATURE not found.

Please post your klippy.log

klippy.log (372.9 KB)

You have:

[temperature_sensor mcu_temp]
sensor_type = temperature_mcu
min_temp = 0
max_temp = 100

I believe it should be:

[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100

It looks like you’re using an equals sign (“=”) when you should be using a colon (“:”). It seems like you use equals everywhere - I think you need to go through your .cfg files and make sure you have the correct statement assignment character.

Thats strange when I look in my printer.cfg I have (“:“).

And that is the Klipper error:

Pin ‘ADC_TEMPERATURE’ is not a valid pin name on mcu ‘mcu’

Once the underlying issue is corrected, use the “RESTART”
command to reload the config and restart the host software.
Printer is halted

It seems that at some point the colons are replaced. Sorry about that.

Now, your rPi temperature_sensor looks funny. Mine is:

[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 10
max_temp: 100

Could that be the problem?

With deleting the RPI Sensor the problem is still the same. I dont now why the MCU Temp Sensor dont work but its not so important for me. Maybe a Klipper patch in future can fix it.

Function-wise both are treat equal. As “configuration policy” the colon is preferred

1 Like

WRT to the H7 MCU temperature, there seem to be some discussions in various pull requests, e.g.

1 Like

The solution is to change two files, wich @Sineos found on GitHub:

Here are the two files if anyone need it: (4.7 KB)
One file is located in /home/pi/klipper/src/stm32 and the other one in /home/pi/klipper/klippy/extras.

Thanks for your help! :slight_smile: