I have a custom carrier/base board that works well with both CM4 and CM5. I've now added an emc2301 fan controller, realizing the CM5 has fan control built-in, but I want my base board to be compatible with both compute modules so I added an emc2301, same as on the CM4 IO board. I can control the fan fine using /sys/class/hwmon, I see the fan RPM speed and I can force the speed using pwm1. I also see /sys/class/thermal/cooling_device0 exists. But I have two issues that I don't know if I just don't completely understand how it's supposed to work, or if something isn't working correctly.
A) if I set minpwm=0 in my config.txt (i2c-fan) then the fan never starts, even if the cpu temperature increases. If I set it to any number above 0 then the fan control is working. (I can still manually start the fan by echo:ing to pwm1 when minpwm=0). cur_state on the coolingdevice0 is set to 0.
B) The speed control/trip levels/cooling map doesn't make sense to me. If I set minpwm=20 then cur_state on cooling_device0 is set to 6. If I disconnect the fan so the CPU temp is increasing then cur_state is set to 10 once it reached 65 degrees, which may be correct, but I thought there would be 10 levels, so it will step up the fan speed, and same when temperature decreases down to a level where it may even stop the fan (which is why I have minpwm=0 to "support" stopping the fan. It seems there are only two levels, cur_state 6 and 10. At cur_state 6 the pwm1 is set to 153 and the CPU temp is hovering around 50 degrees.
Here's the part in config.txt: dtoverlay=i2c-fan,emc2301,minpwm=20,maxpwm=255,midtemp=50000,maxtemp=65000
Here's my kernel version: 6.12.32-v8-16k. This is running on BalenaOS FWIW.
A) if I set minpwm=0 in my config.txt (i2c-fan) then the fan never starts, even if the cpu temperature increases. If I set it to any number above 0 then the fan control is working. (I can still manually start the fan by echo:ing to pwm1 when minpwm=0). cur_state on the coolingdevice0 is set to 0.
B) The speed control/trip levels/cooling map doesn't make sense to me. If I set minpwm=20 then cur_state on cooling_device0 is set to 6. If I disconnect the fan so the CPU temp is increasing then cur_state is set to 10 once it reached 65 degrees, which may be correct, but I thought there would be 10 levels, so it will step up the fan speed, and same when temperature decreases down to a level where it may even stop the fan (which is why I have minpwm=0 to "support" stopping the fan. It seems there are only two levels, cur_state 6 and 10. At cur_state 6 the pwm1 is set to 153 and the CPU temp is hovering around 50 degrees.
Here's the part in config.txt: dtoverlay=i2c-fan,emc2301,minpwm=20,maxpwm=255,midtemp=50000,maxtemp=65000
Here's my kernel version: 6.12.32-v8-16k. This is running on BalenaOS FWIW.
Statistics: Posted by hakanl — Tue Jul 01, 2025 3:57 am