PWM subdirectories dissapeared after Debian update

Hello,

Let me make sure I understand this correctly.

It worked, you updated, and now /sys/class/pwm and /dev/pwm no longer work? Okay, how did you update again?

I think if you just used the apt update/upgrade, this could have worked or maybe not. I noticed there has been a lot of development on new images from beagleboard.org.

I can figure out exactly what you did and retry it. Then, I can say “yes” it is true. Or, “no” this is not happening on my system.

Just for the record, nice lib. Also, I say use one of the newer images available on this forum located here: Debian 10.x/11.x Kernel Updates .

Seth

P.S. I rarely use the older image from the bbb.io/latest-images site online for the am335x, i.e. BBB and so on.

If you would like me to understand more, this is okay. I can make more attempts at trying to make sense of it but the older image is just that currently…an older image.

And…yes sir. I have had this disappearance of my /sys/class/pwm dir/files being noticed before this reply. I think maybe, but let me check first, the newer image may just be a good image for PWM functionality. I will return service in a bit.

Okay…so it seems /dev/pwm is not available on my image you were discussing:

debian@beaglebone:~$ uname -a Linux beaglebone 4.19.94-ti-r68 #1buster SMP PREEMPT Thu Sep 16 15:32:31 UTC 2021 armv7l GNU/Linux debian@beaglebone:~$ ls -l /sys/class/pwm/pwmchip* lrwxrwxrwx 1 root root 0 Feb 19 19:12 /sys/class/pwm/pwmchip0 -> ../../devices/platform/ocp/48300000.epwmss/48300100.ecap/pwm/pwmchip0 lrwxrwxrwx 1 root root 0 Feb 19 19:12 /sys/class/pwm/pwmchip1 -> ../../devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip1 lrwxrwxrwx 1 root root 0 Feb 19 19:12 /sys/class/pwm/pwmchip3 -> ../../devices/platform/ocp/48302000.epwmss/48302100.ecap/pwm/pwmchip3 lrwxrwxrwx 1 root root 0 Feb 19 19:12 /sys/class/pwm/pwmchip4 -> ../../devices/platform/ocp/48302000.epwmss/48302200.pwm/pwm/pwmchip4 lrwxrwxrwx 1 root root 0 Feb 19 19:12 /sys/class/pwm/pwmchip6 -> ../../devices/platform/ocp/48304000.epwmss/48304100.ecap/pwm/pwmchip6 lrwxrwxrwx 1 root root 0 Feb 19 19:12 /sys/class/pwm/pwmchip7 -> ../../devices/platform/ocp/48304000.epwmss/48304200.pwm/pwm/pwmchip7

and…

BeagleBoard.org Debian Buster IoT Image 2020-04-06

Although this is a bit of a stinker for traditional images, the 2020-04-06 image, I will be about an hour or less w/ the newer image and how PWM is installed on the machine in question, i.e. BBB!

and…here is the updated image from one of the picks from that link I showed you:

Linux beaglebone 4.19.94-ti-r71 #1buster SMP PREEMPT Sun Feb 6 00:19:46 UTC 2022 armv7l GNU/Linux

and…

BeagleBoard.org Debian Buster IoT Image 2022-02-03

Here is what I currently have in /dev/pwm and /sys/class/pwm.

debian@beaglebone:/sys/class/pwm$ ls
pwmchip0 pwmchip1 pwmchip3 pwmchip4 pwmchip6 pwmchip7
debian@beaglebone:/sys/class/pwm$

There is no pwm dir/file in /dev/!

Now, if I go into one of the pwmchip* directories, I see this, for instance at 0, currently.

ls
device export npwm power subsystem uevent unexport

And then…if I wanted to provide a chip on selection: echo 1 > export? I tried it and this is ls on /sys/class/pwm/pwmchip1/ after the export of 1:

debian@beaglebone:/sys/class/pwm/pwmchip1$ echo 1 > export
debian@beaglebone:/sys/class/pwm/pwmchip1$ ls
device export npwm power pwm-1:1 subsystem uevent unexport

One more thing:

Once you or anyone wants to get their /dev/pwm/<NAME OF THE PWM>/ for use, just try the /sys/class/pwm/pwmchip* echo 1 > export commands. Then, /dev/pwm/* will show. `