Customised fan curve for radxa rock5a #469
-
Anyone know how to modify the fan curve for the radxa rock5a board. the fan is continually cycling between off and low speed, when the processor is under low load and I would rather it ran at low speed rather than cycing. The fan speed does vary to regulate the cpu temperature, so the step wise regulator is working it just seems that the low speed pwm settings need adjusting for my fan, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
So after checking various sources, I managed to work out how to customise the pwm fan curve for the rock 5a. The kernel has a pwm-fan kernel driver to deal with the fan control. The supplied configuration for the rock 5a board has seven cooling levels (indexed 0 to 6) which are by default set to the following PWM values:- cooling-levels = <100 160 190 200 215 235 255>; The lowest level with a pwm value of 100 was insufficent for my fan to spool up, so I carried out some tests to determine the minimum pwm value for the fan to spin. Here is how to do it: Login to root, and set the thermal policy to user_space:
Then you can set the fan speed by setting pwm value, for example, if you want to set the speed to max, just set it to 255:
Find the miminal pwm value that makes the fan spin. I set the default value to 145 because it’s the minimum value for my fan. After you get your minimum pwm value, you just have to fill the other 5 values between 145 and 255, like 145 163 181 199 217 235 255 Then create a devicetree overlay to set the new pwm fan curve:
and save it as pwm-fan.dts Compile the dts to create a dtbo file using the command:-
Then as root, copy the resultant dtbo file to /boot/firmware/dtbs/overlays:-
Finally, edit the ubuntuEnv.txt file in the /boot/firmware/ directory to add your new overlay. You can use a text editor like nano to edit the file.
Add or modify the overlays= line to include the pwm-fan overlay.
Save the changes and exit the editor. Press ctrl+s to save the file, then press ctrl+x to exit. Reboot your device to apply the changes. That's it. I now have a fan that correctly regulates the CPU temperature with load, and keeps spinning at it's minimum speed at cooling level 0. |
Beta Was this translation helpful? Give feedback.
-
Incidentally,the default armbian dts files for each board are here:- https://github.com/armbian/linux-rockchip/tree/rk-5.10-rkr4/arch/arm64/boot/dts/rockchip I think the same dts files are used for this ubuntu port. You can check on how many cooling levels are configured for your board and what the default pwm values are set at in these files. You can then use the method described above to modify the pwm values as required, making sure that you set up the values for the number of levels to match the default for your particular board. If required, the trip temperatures can by modified by creating another overlay for the soc_thermal target. |
Beta Was this translation helpful? Give feedback.
So after checking various sources, I managed to work out how to customise the pwm fan curve for the rock 5a.
The kernel has a pwm-fan kernel driver to deal with the fan control. The supplied configuration for the rock 5a board has seven cooling levels (indexed 0 to 6) which are by default set to the following PWM values:-
cooling-levels = <100 160 190 200 215 235 255>;
The lowest level with a pwm value of 100 was insufficent for my fan to spool up, so I carried out some tests to determine the minimum pwm value for the fan to spin.
Here is how to do it:
Login to root, and set the thermal policy to user_space:
Then you can set the f…