Rock 5B FAN Control

Hello, and happy new year!

The fan on my Rock 5B runs quite slowly.
It is connected to the FAN connection.

How can I make the fan speed dependent on the temperature or set it to a fixed larger/higher value?

Armbian 23.11.1 with xfce Desktop and kernel 5.10.110 is installed.

I would be happy to get tips in the right direction!

You should look at the sysfs cooling zones located in /sys/class/thermal/

Also take a look at these gh issues


I have similar question. I am running radxa debian and looking for the file which contains fan speed values of cooling levels for cooling_device4 (pwm_fan).
I want to change Level 1 value from 64 to 72 which works better for me.

Thank you for your help!

That’s contained in the dtb decompile dtb using dtc and change it I’ll provide the links you need

Install dtc

sudo apt install device-tree-compiler

Find dtb in /boot/…
Copy it to ur current dir

dtc -I dtb -O dts -f ./rk3588-rock5b.dtb -o ./rk3588-rock5b.dts

Find and edit the cooling level (example here is before it is compiled just to show u how it looks so don’t copy and paste it)

       fan0: pwm-fan {
                compatible = "pwm-fan";
                #cooling-cells = <2>;
                cooling-levels = <0 64 128 192 255>;
                pwms = <&pwm1 0 10000 0>;
        };

Then put the dtb back together

dtc -I dts -O dtb -f ./rk3588-rock5b.dts -o ./rk3588-rock5b.dtb

Copy it back from where you took it from

Thank you for the information, but I do not have any dtb in the /boot/. Everything I find close to that is some .disabled files in the dtbo folder.

Uhh don’t look at the root of boot, look at boot/dtbs and then rockchip/ as it I don’t remember I don’t use debian and it’s different on arch

I did it. Thanks for your help!

  1. I found dtb-s in /usr/lib/linux-image-5.10.110-27-rockchip/rockchip .
  2. I changed hex value:
    pwm-fan {
    compatible = “pwm-fan”;
    #cooling-cells = <0x02>;
    cooling-levels = <0x00 0x48 0x80 0xc0 0xff>;
    pwms = <0x1a7 0x00 0x2710 0x00>;
    phandle = <0x4b>;

Armbian 23.11.1 bookworm (xfce)
Kernel 5.10.110

Unfortunately my fan problem is not yet solved…

The fan still runs very slowly.
I can set it manually, but the automatic temperature control doesn’t work.
I use this overlay:

/dts-v1/;
/plugin/;
/ {
fragment@0 {
target = <&fan0>;
overlay {
cooling levels = <120 135 150 165 180 195 210 235 255>;
};
};
};

I changed the “policy” file in the /sys/class/thermal/thermal_zone0 folder as “root” from user_space to step_wise.
After a restart it is back to user_space… and the fan is at level 1 (of 8)…

The overlay is also correctly entered in /boot armbianEnv.txt.
The new entry is also present in /boot/overlay-user/.

The access rights for armbianEnv.txt have “1001” as the owner and “123” as the group.

Doesn’t root also have to have access (i.e. become a member of group 123?) so that the armbianEnv is not overwritten by owner 1001 every time after a restart?

How can I add root or xxx@rock5b as a member of group 123 there?

These levels are too low (and obviously made by someone who did not even listen to whether the fan makes any coil whine noise).

Hi incognito
Thanks for the info.

but unfortunately only a half answer…
what values belong in there?

It’s one thing that the values aren’t right.

The bigger problem is that the “policy” file in the “/sys/class/thermal/thermal_zone0” folder is reset to user_space every time you restart, where step_wise should actually be.

It’s understandable that the automatic fan control doesn’t work like this, if that’s the only problem…