Enable PWM pin on Rock 4 SE?

  • Hi! First time posting, some time lurking.

    First off, I am new to GPIO, PWM and working in /sys (new as in have read a bunch but very little practise) so please be patient in my noobiness.

    I have a couple of Radxa Rock 4 SE's with some options for which I've designed and printed a chassis/case for, and since the units are now encapsulated I decided on adding a small Noctua 40mm 5V PWM-fan to help with air flow and cooling connected to pins 2=5V, 9=GND and 11=PWM0 (pinout table). The fan is currently running, albeit a bit loud, which makes me think that it is currently not being controlled.

    I have found the following thread on the Radxa forum in which a user had submitted a script on GitHub that supposedly helps with this, but in order to use it he says that the PWM-pin need to be enabled in the OS (hence why I am here). Is this done already in LibreELEC or what would I need to do? I have found previous threads from 6 years ago in which it is stated that I would need to compile the kernel (kernel 4 was relevant back then) with some patches applied but I am not certain if that is necessary today.

    I do see some stuff present regarding pwm in the sys folder

    I can see in the script linked above that it wants to access /sys/class/pwm/pwmchip0/pwm0 but I seem to be missing that path. Does LibreELEC handle PWM differently or should I have that path?

    I cannot find anything regarding PWM in dmesg.


    Thanks in advance.

  • The script was probably written against an older downstream vendor kernel not the modern mainline kernels that LE uses. I had a quick look at the rk3399-rock-4se.dts and rk3399-rock-pi-4.dtsi device-tree files for Linux 6.14 and while some PWM things do exist in them I don't see anything specific for fan control and no thermal properties are defined for the SoC. It's probably best to post in the Radxa forum to ask for a current method on Linux 6.12 and see what they say.

  • Huh would you look at that, and here I thought I was a missing a step or configured something wrong... Thank you a lot for the help, I'll try posting on Radxa forum and see if maybe there is a solution to this. I'll post in this thread if I hear anything :)

  • I just browsed through the device-tree file rk-3399-base.dtsi which is included in rk-3399-t.dtsi, which is included in rk-3399-rock-4se.dts on master in which I saw some stuff about 4 PWM ports/interfaces/pins(?):

    Might any one of these be possible to make use of somehow or do they need to be more defined than that in one of the other dts/dtsi-files?