Got a Noctua NF-A4x10 5V PWM hooked up to the 3.3v pin (pin 1), ground (pin 6), and the PWM signal line to GPIO 18 (pin 12) on a Raspberry Pi 4.
dtoverlay=pwm,pin=18,func=2 (pwm/pwm-2chan docs) in my
/boot/config.txt & rebooted to route hardware PWM channel 0 to GPIO 18 & enable the Linux kernel PWM driver sysfs interface.
At that point
/sys/class/pwm/pwmchip0 existed and I 'exported' PWM channel 0 via:
# echo 0 > /sys/class/pwm/pwmchip0/export
$ ls /sys/class/pwm/pwmchip0/pwm0/
capture duty_cycle enable period polarity power uevent
Looking at Noctua's PWM specsheet they want a 25 kHz PWM signal, which translates into (1 / 25000) seconds = 40000 nanoseconds.
Dropped that value (40000 ns) into
period, 50% (20000 ns) into
duty_cycle, and 1 into
# echo 40000 > /sys/class/pwm/pwmchip0/pwm0/period
# echo 20000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
# echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
...and got a (much) quieter fan!
Despite being a 5v fan the NF-A4x10 seems perfectly happy (albeit slower) with both 3.3v power and 3.3v PWM signaling.
Those values can be set at startup via a
tmpfiles.d file (I called mine
w /sys/class/pwm/pwmchip0/export - - - - 0
w /sys/class/pwm/pwmchip0/pwm0/period - - - - 40000
w /sys/class/pwm/pwmchip0/pwm0/duty_cycle - - - - 25000
w /sys/class/pwm/pwmchip0/pwm0/enable - - - - 1
And finally you can tweak the EEPROM config (
sudo -E rpi-eeprom-config --edit) to power off the PWM outputs at shutdown so the fan isn't left spinning: