Please note: Friday June 18 is a holiday celebrating Juneteenth, please allow extra time for your order to arrive and plan accordingly.
0

Problem with BeagleboneBlack PWM by using Adafruit_BBIO
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Problem with BeagleboneBlack PWM by using Adafruit_BBIO

by bhongtip on Tue Jun 05, 2018 3:18 am

I would like to use UART (UART1, UART2 and UART4) , PWM (either P9_14 or P9_16) and a few GPIO in Beagleboneblack by using Python and Adafruit_BBIO library.

I have problem with configuring PWM. Below is from my /boot/uEnv.txt

#Docs: http://elinux.org/Beagleboard:U-boot_pa ... layout_2.0

uname_r=4.9.78-ti-r94
#uuid=
#dtb=


###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBon ... t_Overlays
###Master Enable
#enable_uboot_overlays=1
###
###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/<file0>.dtbo
#uboot_overlay_addr1=/lib/firmware/<file1>.dtbo
#uboot_overlay_addr2=/lib/firmware/<file2>.dtbo
#uboot_overlay_addr3=/lib/firmware/<file3>.dtbo
###
###Additional custom capes
#uboot_overlay_addr4=/lib/firmware/<file4>.dtbo
#uboot_overlay_addr5=/lib/firmware/<file5>.dtbo
#uboot_overlay_addr6=/lib/firmware/<file6>.dtbo
#uboot_overlay_addr7=/lib/firmware/<file7>.dtbo
###
###Custom Cape
#dtb_overlay=/lib/firmware/<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
#disable_uboot_overlay_video=1
#disable_uboot_overlay_audio=1
#disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###PRUSS OPTIONS
###pru_rproc (4.4.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo
###pru_uio (4.4.x-ti & mainline/bone kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
###
###Cape Universal Enable
enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

cmdline=coherent_pool=1M net.ifnames=0 quiet cape_universal=enable

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 quiet video=HDMI-A-1:1024x768@60e

##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
#cape_enable=bone_capemgr.enable_partno=

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

and uname-a result is
Linux beaglebone 4.9.78-ti-r94 #1 SMG PREEMPT Fri Jan26 21:26:24 UTC 2018 armv71 GNU/Linux

result of cat /sys/devices/platform/bone_capemgr/slots is

0 : PF---- -1
1 : PF---- -1
2 : PF---- -1
3 : PF---- -1

result of config-pin -q P9_16 is

P9_16 pinmux file not found !
Pin has no cape : P9_16


is there anything wrong with my cape-universal enable?
bhongtip
 
Posts: 3
Joined: Thu Jan 16, 2014 4:04 am

Re: Problem with BeagleboneBlack PWM by using Adafruit_BBIO

by drewfustini on Tue Jun 05, 2018 12:56 pm

Hi, sorry to hear you are having this problem.

It would be good to know the versions of the different software on your BeagleBone.

Please paste the output of this command:
Code: Select all | TOGGLE FULL SIZE
sudo /opt/scripts/tools/version.sh

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Re: Problem with BeagleboneBlack PWM by using Adafruit_BBIO

by bhongtip on Tue Jun 05, 2018 9:32 pm

Here it is

debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh
git:/opt/scripts/:[ea6ea9fca05f36f5044398884375b0231348d6e2]
eeprom:[A335BNLT000B1614BBBK2189]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-01-28]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.01-00002-g9aa111a004]
kernel:[4.9.78-ti-r94]
nodejs:[v6.14.2]
pkg:[bb-cape-overlays]:[4.4.20180424.0-0rcnee0~stretch+20180424]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[firmware-ti-connectivity]:[20170823-1rcnee1~stretch+20180328]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal i2c bluetooth netdev cloud9ide gpio pwm eqep admin spi tisdk weston-launch xenomai]
dmesg | grep pinctrl-single
[ 1.404915] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
END
bhongtip
 
Posts: 3
Joined: Thu Jan 16, 2014 4:04 am

Re: Problem with BeagleboneBlack PWM by using Adafruit_BBIO

by bhongtip on Thu Jun 07, 2018 5:31 am

Updated ! : After looking for many topics, there seems to be a comment that using older Kernel probably resolve the problem.

Then I use

> cd /opt/scripts/tools/
> sudo git pull
> sudo ./update_kernelsh --lts-4_4
> sudo reboot

After reboot, the result of > cat $slots is as below

debian@beaglebone:~$ cat /sys/devices/platform/bone_capemgr/slots
0: PF---- -1
1: PF---- -1
2: PF---- -1
3: PF---- -1
4: P-O-L- 0 Override Board Name,00A0,Override Manuf,cape-universal
debian@beaglebone:~$

However, with Python code as below

>>> import Adafruit_BBIO.PWM as p
>>> p1 = "P9_14"
>>> p2 = "P9_16"
>>> p.start(p1,50,100,1)

there is error as below

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Problem with a sysfs file

back to terminal, if I use config-pin query, result is as below

debian@beaglebone:~$ config-pin -q P9_14
P9_14 Mode: pwm
debian@beaglebone:~$ config-pin -q P9-16
P9_16 Mode: pwm
debian@beaglebone:~$


Is there anything wrong? why is there problem with a sysfs file? how can I fix this?

Thank you in advance.
bhongtip
 
Posts: 3
Joined: Thu Jan 16, 2014 4:04 am

Re: Problem with BeagleboneBlack PWM by using Adafruit_BBIO

by silver2row on Sat Jun 09, 2018 6:23 pm

Hello,

I had a similar issue. I had to type up an entire route of software to make PWM work in Adafruit_BBIO.PWM as PWM library. Try a while loop, for loop, or try if/else after your initialization of the software.

Seth

P.S. If this does not make sense, I can give you a snippet to test on your BBB.

silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: Problem with BeagleboneBlack PWM by using Adafruit_BBIO

by drewfustini on Tue Jul 03, 2018 4:25 pm

bhongtip: are you still having this issue?

drewfustini
 
Posts: 944
Joined: Sat Dec 26, 2015 1:19 pm

Please be positive and constructive with your questions and comments.