Seems like you've not loaded the proper device tree file ( "cape" ) for the
correct PWM - To start off with.

On Thu, Mar 17, 2016 at 7:47 PM, Walter Schilling <schill...@msoe.edu>
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 beagleboard...@googlegroups.com.
> 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 beagleboard+unsubscr...@googlegroups.com.
> 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 beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to