- dogukansahil
- Posts: 14
- Joined: Tue Mar 05, 2024 11:06 am
CM5 IO Board PWM Fan Not Locking / Randomly Stopping (pwm_fan, Bookworm, Kernel 6.12.34)
Hello,
I am using a Compute Module 5 (CM5) inside the official CM5 IO board case with the bundled 8K PWM fan.
Power supply: official Raspberry Pi PSU.
Software: Debian Bookworm, kernel 6.12.34+rpt-rpi-2712 (2025年06月26日), aarch64.
What I am seeing
sensors shows the fan RPM sometimes around 3100–3200 RPM, sometimes suddenly drops to 0 RPM, even though I keep forcing PWM values.
Temperatures are stable (~55–70°C), so cooling works when the fan spins, but the fan control logic seems unstable.
Sometimes after reboot it spins, sometimes not.
Things I tried
Checked /boot/firmware/config.txt and /etc/thermal.d/ configs
Removed custom lines, commented everything out, so no override should exist.
Manual writes to sysfs
echo 1 | sudo tee /sys/class/hwmon/hwmon*/pwm1_enable
echo 255 | sudo tee /sys/class/hwmon/hwmon*/pwm1
→ sometimes works (fan spins full), sometimes reports 0 RPM in sensors while the fan is visibly spinning.
Verified module loaded
lsmod | grep pwm
pwm_fan 49152 0
Blacklisting check
Removed /etc/modprobe.d/blacklist-pwmfan.conf just in case.
Ran update-initramfs -u.
Systemd service approach
Wrote a service + script (fanlock.sh) that continuously forces manual mode and PWM=220.
Added "kick-start" (set 255 for 2s, then drop to 220).
Logs show script running, but still sometimes fan goes to 0 RPM.
Inotifywatch on pwm1
Checked if something else resets the value. Could not clearly identify a culprit.
Sensors output
Example:
pwmfan-isa-0000
Adapter: ISA adapter
fan1: 3151 RPM
...then suddenly:
pwmfan-isa-0000
Adapter: ISA adapter
fan1: 0 RPM
Question
Is this a driver / kernel regression with pwm_fan on CM5 IO board, or am I missing a new overlay/config requirement?
Since I am on CM5 + official IO case + official PSU + bundled fan, I would expect it to "just work".
Any guidance on:
Correct overlay or config.txt setting required?
Known issues with tach feedback on the 8K fan?
Way to permanently force manual PWM without kernel/firmware fighting back?
Thanks in advance for any help!
I am using a Compute Module 5 (CM5) inside the official CM5 IO board case with the bundled 8K PWM fan.
Power supply: official Raspberry Pi PSU.
Software: Debian Bookworm, kernel 6.12.34+rpt-rpi-2712 (2025年06月26日), aarch64.
What I am seeing
sensors shows the fan RPM sometimes around 3100–3200 RPM, sometimes suddenly drops to 0 RPM, even though I keep forcing PWM values.
Temperatures are stable (~55–70°C), so cooling works when the fan spins, but the fan control logic seems unstable.
Sometimes after reboot it spins, sometimes not.
Things I tried
Checked /boot/firmware/config.txt and /etc/thermal.d/ configs
Removed custom lines, commented everything out, so no override should exist.
Manual writes to sysfs
echo 1 | sudo tee /sys/class/hwmon/hwmon*/pwm1_enable
echo 255 | sudo tee /sys/class/hwmon/hwmon*/pwm1
→ sometimes works (fan spins full), sometimes reports 0 RPM in sensors while the fan is visibly spinning.
Verified module loaded
lsmod | grep pwm
pwm_fan 49152 0
Blacklisting check
Removed /etc/modprobe.d/blacklist-pwmfan.conf just in case.
Ran update-initramfs -u.
Systemd service approach
Wrote a service + script (fanlock.sh) that continuously forces manual mode and PWM=220.
Added "kick-start" (set 255 for 2s, then drop to 220).
Logs show script running, but still sometimes fan goes to 0 RPM.
Inotifywatch on pwm1
Checked if something else resets the value. Could not clearly identify a culprit.
Sensors output
Example:
pwmfan-isa-0000
Adapter: ISA adapter
fan1: 3151 RPM
...then suddenly:
pwmfan-isa-0000
Adapter: ISA adapter
fan1: 0 RPM
Question
Is this a driver / kernel regression with pwm_fan on CM5 IO board, or am I missing a new overlay/config requirement?
Since I am on CM5 + official IO case + official PSU + bundled fan, I would expect it to "just work".
Any guidance on:
Correct overlay or config.txt setting required?
Known issues with tach feedback on the 8K fan?
Way to permanently force manual PWM without kernel/firmware fighting back?
Thanks in advance for any help!
Turkiye / Engineer
Raspberry user for 10 years.
Raspberry user for 10 years.
- PhilE
- Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator - Posts: 6874
- Joined: Mon Sep 29, 2014 1:07 pm
Re: CM5 IO Board PWM Fan Not Locking / Randomly Stopping (pwm_fan, Bookworm, Kernel 6.12.34)
This isn't one of ours. It makes me wonder what other software mods you have.Removed /etc/modprobe.d/blacklist-pwmfan.conf just in case.
I suggest you monitor the contents of /sys/class/thermal in one window, e.g.
Code: Select all
$ watch -n 1 cat /sys/class/thermal/thermal_zone0/temp /sys/class/thermal/cooling_device0/cur_stateCode: Select all
$ while true; do true; done &
$ while true; do true; done &
Notice that the hysteresis values require the temperature to drop significantly below the threshold temperature before dropping to the lower fan speed (including off). Once you understand how it works, try passively monitoring those values while running your experiment.
As long as the kernel is reporting plausible temperatures, and the fan is responding to cooling state changes correctly, everything else is due to the configuration (from Device Tree - see "dtparam | grep temp" for a list of parameters, then e.g. "dtparam -h fan_temp0" for each parameter) or the kernel's thermal subsytem (Which is unlikely to be faulty).
Re: CM5 IO Board PWM Fan Not Locking / Randomly Stopping (pwm_fan, Bookworm, Kernel 6.12.34)
First time posting here so forgive if I don't supply enough information.
I had the same issue trying to get the fan bundled with the CM5 development kit to spin up at the first threshold I set. The problem is that at the first temperature threshold ( 50 degC default ), the pwm is set to 75 ( out of 255 ) which does not supply enough power to get the fan to spin. Then at the next threshold ( 60 degC default ), the pwm sets to 125 which is enough to spin the fan ( ~1600 rpm ). Little testing I did showed that pwm = 80 caused the fan to occasionally attempt to spin but then quit. At pwm = 100, fan was spinning ok ( ~760 rpm ).
So using defaults, the fan will not spin until the 60 degC threshold.
From https://github.com/raspberrypi/linux/bl ... ays/README
fan_temp0_speed Fan PWM setting for 1st cooling level (0-255, default 75). Pi5 only.
One fix is to add to config.txt:
dtparam=fan_temp0_speed=114
Note the reason I picked 114 is that is the first threshold speed set in pwm-gpio-fan-overlay.dts:
/* PWM duty cycle values in a range from 0 to 255 */
/* which correspond to thermal cooling states 0 to 4 */
cooling-levels = <0 114 152 204 255>;
But any pwm settting higher than say, 100, should spin the fan.
I had the same issue trying to get the fan bundled with the CM5 development kit to spin up at the first threshold I set. The problem is that at the first temperature threshold ( 50 degC default ), the pwm is set to 75 ( out of 255 ) which does not supply enough power to get the fan to spin. Then at the next threshold ( 60 degC default ), the pwm sets to 125 which is enough to spin the fan ( ~1600 rpm ). Little testing I did showed that pwm = 80 caused the fan to occasionally attempt to spin but then quit. At pwm = 100, fan was spinning ok ( ~760 rpm ).
So using defaults, the fan will not spin until the 60 degC threshold.
From https://github.com/raspberrypi/linux/bl ... ays/README
fan_temp0_speed Fan PWM setting for 1st cooling level (0-255, default 75). Pi5 only.
One fix is to add to config.txt:
dtparam=fan_temp0_speed=114
Note the reason I picked 114 is that is the first threshold speed set in pwm-gpio-fan-overlay.dts:
/* PWM duty cycle values in a range from 0 to 255 */
/* which correspond to thermal cooling states 0 to 4 */
cooling-levels = <0 114 152 204 255>;
But any pwm settting higher than say, 100, should spin the fan.
- aBUGSworstnightmare
- Posts: 13432
- Joined: Tue Jun 30, 2015 1:35 pm
Re: CM5 IO Board PWM Fan Not Locking / Randomly Stopping (pwm_fan, Bookworm, Kernel 6.12.34)
when posting my PWM fan overlay on the forum for the first time Back in 2023 I've added a note that some smaller fans may require higher PWM values to start viewtopic.php?p=2122676&hilit=fan+overlay#p2122676
I've adjusted the first point of the fan curve to a value that made all of them happy.
That's exactly what the overrides are good for; adjusting the parameter to match
a) your HW
b) thermal requirements
simply add them If the defaults do not work for you.
I've adjusted the first point of the fan curve to a value that made all of them happy.
That's exactly what the overrides are good for; adjusting the parameter to match
a) your HW
b) thermal requirements
simply add them If the defaults do not work for you.
- aBUGSworstnightmare
- Posts: 13432
- Joined: Tue Jun 30, 2015 1:35 pm
Re: CM5 IO Board PWM Fan Not Locking / Randomly Stopping (pwm_fan, Bookworm, Kernel 6.12.34)
i have no Idea what a '8k fan' is!dogukansahil wrote: ↑Mon Sep 15, 2025 6:26 am..
Known issues with tach feedback on the 8K fan?
Way to permanently force manual PWM without kernel/firmware fighting back?
Thanks in advance for any help!
If you don't want to use kernel driver from temp controlled fan speed (hwmon) then don't allow the FW to enabled it and do start/set PWM manually.
https://github.com/raspberrypi/linux/bl ... EADME#L208
Jump to
- Community
- General discussion
- Announcements
- Other languages
- Deutsch
- Español
- Français
- Italiano
- Nederlands
- 日本語
- Polski
- Português
- Русский
- Türkçe
- User groups and events
- Raspberry Pi Official Magazine
- Using the Raspberry Pi
- Beginners
- Troubleshooting
- Advanced users
- Assistive technology and accessibility
- Education
- Picademy
- Teaching and learning resources
- Staffroom, classroom and projects
- Astro Pi
- Mathematica
- High Altitude Balloon
- Weather station
- Programming
- C/C++
- Java
- Python
- Scratch
- Other programming languages
- Windows 10 for IoT
- Wolfram Language
- Bare metal, Assembly language
- Graphics programming
- OpenGLES
- OpenVG
- OpenMAX
- General programming discussion
- Projects
- Networking and servers
- Automation, sensing and robotics
- Graphics, sound and multimedia
- Other projects
- Media centres
- Gaming
- AIY Projects
- Hardware and peripherals
- Camera board
- Compute Module
- Official Display
- HATs and other add-ons
- Device Tree
- Interfacing (DSI, CSI, I2C, etc.)
- Keyboard computers (400, 500, 500+)
- Raspberry Pi Pico
- General
- SDK
- MicroPython
- Other RP2040 boards
- Zephyr
- Rust
- AI Accelerator
- AI Camera - IMX500
- Hailo
- Software
- Raspberry Pi OS
- Raspberry Pi Connect
- Raspberry Pi Desktop for PC and Mac
- Beta testing
- Other
- Android
- Debian
- FreeBSD
- Gentoo
- Linux Kernel
- NetBSD
- openSUSE
- Plan 9
- Puppy
- Arch
- Pidora / Fedora
- RISCOS
- Ubuntu
- Ye Olde Pi Shoppe
- For sale
- Wanted
- Off topic
- Off topic discussion