Have you solved the problem that you were having?  I am unsure why you are 
getting the error:

P9_42 pinmux file not found!
cape-universala overlay not found

I am currently trying to figure out how the PWM pins work in the 4.1+ 
Kernel and it appears that after each reboot the *pwmchip** links in the 
*/sys/class/pwm/* directory link to different directories in the *ocp* 
directory.  For P9.42, look for the pwmchip link that links to the 
*/sys/devices/platform/ocp/48300000.epwmss/48300100.ecap/pwm/pwmchip? 
*directory and then your code works for me.

Jon


On Thursday, March 17, 2016 at 10:47:39 PM UTC-4, Walter Schilling wrote:
>
> OK, so here is where I am at:
> #1 I wrote the following script, and, well it worked great...  Until I had 
> to reboot my machine:
>
>
>
>
>
>
> *#!/bin/bash# SE3910 Real Time Systems# PWM Bash shell script.# Author: W. 
> Schilling# This script will enable PWM on the beaglebone connected to 
> ECAPPWM0.# It will set the duty cycle to the value passed in, which is a 
> value between 1 and 10000.*
>
>
> *# Setup the pin as a PWM pin.config-pin P9.42 pwm*
>
>
> *# Export the control for the device, creating the directory structure 
> that we w$echo 0 > /sys/class/pwm/pwmchip0/export*
>
>
> *# Setup the period for PWM to be 10000 to make things nice and easy to 
> work wit$echo  10000 > /sys/class/pwm/pwmchip0/pwm0/period*
>
>
> *# Setup the duty cycle to the value passed in as $1echo $1 > 
> /sys/class/pwm/pwmchip0/pwm0/duty_cycle*
>
>
> *# Enable pwm echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable*
>
> However, when I rebooted my machine, the pin failed to toggle.  I believe 
> I inadvertently did something with capes that wasn't enabled when I first 
> tried it.  I then tried this script on my home beaglebone, running Robert 
> Nelson's image bone-debian-8.3-lxqt-4gb-armhf-2016-02-21-4gb.img.  This 
> one, however, fails with the following:
>
> root@beaglebone:~# ./pwm2.sh 1000
> P9_42 pinmux file not found!
> cape-universala overlay not found
> run "config-pin overlay cape-universala" to load the cape
> ./pwm2.sh: line 12: echo: write error: Device or resource busy
> ./pwm2.sh: line 15: /sys/class/pwm/pwmchip0/pwm0/period: No such file or 
> directory
> ./pwm2.sh: line 18: /sys/class/pwm/pwmchip0/pwm0/duty_cycle: No such file 
> or directory
> ./pwm2.sh: line 21: /sys/class/pwm/pwmchip0/pwm0/enable: No such file or 
> directory
> root@beaglebone:~# 
>
> I've tried the following, which results in different errors but still 
> errors:
> root@beaglebone:~# config-pin overlay cape-universaln
> Loading cape-universaln overlay
> bash: line 0: echo: write error: File exists
> Error loading device tree overlay file: cape-universaln
> root@beaglebone:~# ./pwm2.sh 1000
> P9_42 pinmux file not found!
> cape-universala overlay not found
> run "config-pin overlay cape-universala" to load the cape
> ./pwm2.sh: line 12: echo: write error: Device or resource busy
> ./pwm2.sh: line 15: /sys/class/pwm/pwmchip0/pwm0/period: No such file or 
> directory
> ./pwm2.sh: line 18: /sys/class/pwm/pwmchip0/pwm0/duty_cycle: No such file 
> or directory
> ./pwm2.sh: line 21: /sys/class/pwm/pwmchip0/pwm0/enable: No such file or 
> directory
> root@beaglebone:~# 
>
> Ideas to try next?
>
> Walt
> -- 
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/6c3fb83a-7fdb-4856-b218-b5766368f81d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to