PWM Issues BeagleBoard.org Debian Image 2018-01-28

Hi, (2018 Feb 16)
I went to many posts, but they look outdated from 1025 and beyond.
I am trying to enable the PWM on pin 14 and 16, EHRPWM1A P9.14 and EHRPWM1B P9.16
My system details are:

BeagleBoard.org Debian Image 2018-01-28 Linux beaglebone 4.9.78-ti-r94 #1 SMP PREEMPT Fri Jan 26 21:26:24 UTC 2018 armv7l GNU/Li

Well, "2018-01-28" support pwm's out of the box, so you don't have to
do all that extra work:

Just pick your pin and run the correct option:

config-pin P8_13 pwm
config-pin P8_19 pwm
config-pin P8_34 pwm
config-pin P8_36 pwm
config-pin P8_45 pwm
config-pin P8_46 pwm
config-pin P9_14 pwm
config-pin P9_16 pwm
config-pin P9_21 pwm
config-pin P9_22 pwm
config-pin P9_28 pwm
config-pin P9_29 pwm
config-pin P9_31 pwm
config-pin P9_42 pwm

Then go under /syc/class/pwm/ and enable/etc..

If they don't work, just run:

sudo /opt/scripts/tools/version.sh

and share it's output with us to help you fix what's broken..

Regards,

4.9 kernels do not use slots everything's loaded in uboot via uEnv.txt
with a dtbo file

FIXED.
PWM, Beagle Bone

Meanwhile I got an answer at: github.com cdsteinkuehler beaglebone-universal-io
Though, I used the SDcard, the u-boot @ 2016 from eMMC took over. I dd-it and wipe it.

For: EHRPWM1A P9_14

`
the sys file is: /sys/class/pwm/pwmchip3
echo 0 > export

`

EHRPWM1B P9_16

the sys file is: /sys/class/pwm/pwmchip3 echo 1 > export

`
cd /sys/class/pwm/pwmchip3
echo 0 > export
echo 1 > export
echo 20000 > pwm0/period
echo 10000 > pwm0/duty_cycle # P9_14
echo 1 > pwm0/enable

echo 20000 > pwm1/period
echo 10000 > pwm1/duty_cycle # P9_16
echo 1 > pwm1/enable
`

Be careful, "pwmchip3" is not set in stone, and can move between
reboots/kernel/etc...

For P9_14/P9_16 go thru:

/sys/devices/platform/ocp/48302000.epwmss/48302200.pwm/pwm/pwmchip*/

When you look at:

/sys/class/pwm/pwmchip3/ you see it symlinks back to above..

Regards,

Thank you. Just ran into. :slight_smile:

Hi,
Thank you. Just ran into, That’s I am back to forum., though I hack it’s initialization.

`
pwm1=$(config-pin -l P9.16 | grep pwm)
pwm2=$(config-pin -l P9.14 | grep pwm)
[[ ! -z $pwm1 ]] && config-pin P9.14 pwm
[[ ! -z $pwm2 ]] && config-pin P9.16 pwm

pushd /sys/class/pwm
right=$(ls -l | grep 48302200 | awk ‘{print $9}’)
echo “found right chip $right”
if [[ ! -z $right ]];then
pwmsys=$right
pushd $pwmsys
echo 0 > export
echo 1 > export
pushd pwm0
echo 10000 > period
echo 5000 > duty_cycle
echo normal > polarity
echo 1 > enable
popd
pushd pwm1
echo 10000 > period
echo 5000 > duty_cycle
echo normal > polarity
echo 1 > enable
popd
popd
fi
popd

`

J