Enabling PWM in the 6.19.6 kernel

Hi - I’ve just (few days ago) spun a new kernel for my beagle cluster. New kernel boots up fine, and the PWM overlay has been applied.

What’s strange is I can’t bring up pwm, specifically:

echo 0 > /sys/class/pwm/pwmchip0/export
echo 1 > /sys/class/pwm/pwmchip0/export
echo 0 > /sys/class/pwm/pwmchip1/export
echo 1 > /sys/class/pwm/pwmchip1/export

This works - and it creates the A and B channels in pwm 0 and 1.

But when I try and enable the pwm:

echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
echo 1 > /sys/class/pwm/pwmchip0/pwm1/enable
echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable
echo 1 > /sys/class/pwm/pwmchip1/pwm1/enable
bash: echo: write error: Invalid argument
bash: echo: write error: Invalid argument
bash: echo: write error: Invalid argument
bash: echo: write error: Invalid argument

I have the various the ehrpwm modules in the kernel, current they are in by default - but just spinning a new kernel with the as modules - so I can see what parameters I can set.

So just posting here in case anyone has seen something similar? I must have miss set something in the kernel config, but what that is I’ve not been able to find despite extensive checking.

Anyone any ideas?

Have you looked at the kernel driver to see if you need to set something
like maybe the period, before it’ll accept your enable command?

1 Like

Bingo - yes that worked ….

Outstanding!