I'm trying to enable PWM and some GPIOs on the Beaglebone and I'm running into various problems.
Originally I tried to start PWM using the /sys/class/pwm/pwmchip1/export interface, but ran into a bunch of race conditions. I then tried using the Adafruit_BBIO.PWM library, which works around most of the race conditions (but still sometimes fails nonrepeatably). (I also tried writing the PWM registers directly, but there are a lot of them and I couldn't find documentation on which ones are needed, so I figure I'm better off using the device drivers.) But the Adafruit_BBIO library depends on using cape_universal, which configures some pins in ways that conflict with what I want in my dts file. So my questions are: a) Is there a simple, reliable way of enabling PWM? b) Is there a way of overriding some cape_universal pin assignments? Or getting cape_universal to assign them the way I want? Or configuring the ocp:Px_xx_pinmux/state files that the Adafruit library needs without using cape_universal? I can post my dts files and so forth, but I suspect that I need to change my approach entirely. Thanks, Ken P.S. By "race conditions", I mean that if I write to /sys/class/pwm/pwmchip1/export, and then try to write to /sys/class/pwm/pwm-1:0, sometimes the latter file isn't there and I need to wait. But even sleeping a bit isn't always enough. The Adafruit library has code to deal with this <https://github.com/adafruit/adafruit-beaglebone-io-python/blob/1f7c20e8991f887267f34559907229b702a36e17/source/c_pwm.c#L419> as well as various other situations, but even that code fails randomly about 20% of the time. -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/f69db953-caef-4a27-b96d-7099b9e7eb2d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.