0

device tree overlay - gpio
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

device tree overlay - gpio

by rifo on Sat May 07, 2016 1:03 pm

Hello,

I want to export one of the GPIOs via the device tree overlays. I have followed the tutorial from

http://kilobaser.com/blog/2014-07-28-beaglebone-black-devicetreeoverlay-generator#1gpiodto and got below error

Code: Select all | TOGGLE FULL SIZE
 root@beaglebone:/lib/firmware# echo bspm_P8_13_f > /sys/devices/bone_capemgr.?/slots
-bash: echo: write error: Invalid argument


Code: Select all | TOGGLE FULL SIZE
 [ 5927.336871] bone-capemgr bone_capemgr.9: part_number 'bspm_P8_13_f', version 'N/A'
[ 5927.337050] bone-capemgr bone_capemgr.9: slot #11: generic override
[ 5927.337095] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 11
[ 5927.337143] bone-capemgr bone_capemgr.9: slot #11: 'Override Board Name,00A0,Override Manuf,bspm_P8_13_f'
[ 5927.337393] bone-capemgr bone_capemgr.9: slot #11: Requesting part number/version based 'bspm_P8_13_f-00A0.dtbo
[ 5927.337442] bone-capemgr bone_capemgr.9: slot #11: Requesting firmware 'bspm_P8_13_f-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 5927.341045] bone-capemgr bone_capemgr.9: slot #11: dtbo 'bspm_P8_13_f-00A0.dtbo' loaded; converting to live tree
[ 5927.341421] bone-capemgr bone_capemgr.9: slot #11: Incompatible with baseboard for 'bspm_P8_13_f'
[ 5927.350944] bone-capemgr bone_capemgr.9: slot #11: Failed verification

 


I then tried to load an existing dtbo file, PyBBIO-gpio1_13-00A0.dtbo and again got an error

Code: Select all | TOGGLE FULL SIZE
[ 3404.116922] bone-capemgr bone_capemgr.9: part_number 'PyBBIO-gpio1_13-00A0.dtbo', version 'N/A'
[ 3404.117102] bone-capemgr bone_capemgr.9: slot #8: generic override
[ 3404.117147] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 8
[ 3404.117195] bone-capemgr bone_capemgr.9: slot #8: 'Override Board Name,00A0,Override Manuf,PyBBIO-gpio1_13-'
[ 3404.117457] bone-capemgr bone_capemgr.9: slot #8: Requesting part number/version based 'PyBBIO-gpio1_13--00A0.dtbo
[ 3404.117507] bone-capemgr bone_capemgr.9: slot #8: Requesting firmware 'PyBBIO-gpio1_13--00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 3404.153777] bone-capemgr bone_capemgr.9: failed to load firmware 'PyBBIO-gpio1_13--00A0.dtbo'



can you please guide me in the right direction
rifo
 
Posts: 42
Joined: Sun Jan 26, 2014 3:07 pm

Re: device tree overlay - gpio

by drewfustini on Sun May 08, 2016 5:49 am

It would be good to know more about the software on your BeagleBone. Please paste the output of these commands:

cat /etc/issue

cat /etc/dogtag

uname -a

cat /sys/devices/bone_capemgr.*/slots

cat /boot/uEnv.txt

cat /boot/uboot/uenv.txt


You may want to take a look at beaglebone-universal-io:
Device tree overlay and support scripts for using most available hardware I/O on the BeagleBone without editing dts files or rebuilding the kernel


If using a 3.8.13 kernel with capemgr, load the overlay as usual
echo cape-universaln > /sys/devices/bone_capemgr.*/slots

# Configure a pin as gpio output and setting the state
config-pin P8.07 hi
config-pin P8.07 low

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

Re: device tree overlay - gpio

by orhn on Wed May 11, 2016 10:07 am

We run the commands you asked and got these results.

cat /etc/issue
Code: Select all | TOGGLE FULL SIZE
Debian GNU/Linux 7 \n \l

BeagleBoard.org Debian Image 2015-03-01

Support/FAQ: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian

default username:password is [debian:temppwd]

The IP Address for usb0 is: 192.168.7.2


cat /etc/dogtag

Code: Select all | TOGGLE FULL SIZE
BeagleBoard.org Debian Image 2015-03-01


uname -a

Code: Select all | TOGGLE FULL SIZE
Linux beaglebone 3.8.13-bone79 #1 SMP Tue Oct 13 20:44:55 UTC 2015 armv7l GNU/Linux


cat /sys/devices/bone_capemgr.*/slots

Code: Select all | TOGGLE FULL SIZE
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI



cat /boot/uEnv.txt

Code: Select all | TOGGLE FULL SIZE
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=3.8.13-bone79
#dtb=
cmdline=quiet init=/lib/systemd/systemd

##Example
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Disable HDMI/eMMC
#cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G

##Disable HDMI
#cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

##Disable eMMC
#cape_disable=capemgr.disable_partno=BB-BONE-EMMC-2G

##Audio Cape (needs HDMI Audio disabled)
#cape_disable=capemgr.disable_partno=BB-BONELT-HDMI
#cape_enable=capemgr.enable_partno=BB-BONE-AUDI-02


##enable BBB: eMMC Flasher:
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

uuid=d1de5298-a8ed-42c7-a381-d422b588036b



cat /boot/uboot/uenv.txt

Code: Select all | TOGGLE FULL SIZE
cat: /boot/uboot/uenv.txt: No such file or directory


The pins that we want to change (i.e. P8_29) can't be changed. Only the pins that GPIO enabled can be changed via beaglebone-universal-io tutorial and other pins aren't visible.

orhn
 
Posts: 1
Joined: Wed May 11, 2016 9:59 am

Re: device tree overlay - gpio

by drewfustini on Fri May 13, 2016 1:17 am

Please paste the output of:
sudo cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins

P8_29 is "lcd_hsync". I think you'll need to disable the HDMI overlay to use it as GPIO per:
https://github.com/derekmolloy/boneDevi ... rTable.pdf
p8_29.png
p8_29.png (18.89 KiB) Viewed 924 times



Alternatively, you may want to use one of the pins in light green instead:
http://beagleboard.org/static/images/cape-headers.png

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

Re: device tree overlay - gpio

by drewfustini on Fri May 13, 2016 3:50 am

I disabled HDMI overlay by adding this to /boot/uEnv.txt
Code: Select all | TOGGLE FULL SIZE
cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN


After rebooting:
Code: Select all | TOGGLE FULL SIZE
root@beaglebone:~# cat /sys/devices/bone_capemgr.*/slots
 0: 54:PF---
 1: 55:PF---
 2: 56:PF---
 3: 57:PF---
 4: ff:P-O-L Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
 5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI
 6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN


I could then control P8_29 as GPIO pin (GPIO 87):
Code: Select all | TOGGLE FULL SIZE
root@beaglebone:~# echo 87 >  /sys/class/gpio/export

root@beaglebone:~# ls  /sys/class/gpio/gpio87
active_low  direction  edge  power  subsystem  uevent  value

root@beaglebone:~# echo out >  /sys/class/gpio/gpio87/direction

root@beaglebone:~# echo 1 >  /sys/class/gpio/gpio87/value

root@beaglebone:~# cat /sys/kernel/debug/pinctrl/44e10800.pinmux/pins | grep 'pin 57'
pin 57 (44e108e4) 00000027 pinctrl-single

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

Re: device tree overlay - gpio

by rifo on Wed May 18, 2016 6:16 am

great! thanks a lot for your help :)
rifo
 
Posts: 42
Joined: Sun Jan 26, 2014 3:07 pm

Re: device tree overlay - gpio

by gururaj on Mon Nov 07, 2016 4:58 am

hi,
I purchased BeagleBone Black Industrial 4G is Red. I trying to power up using external power supply which is working perfectly with my old Beaglebone Black which has xAM3359AZCZ100 Black PCB board, where i can do ssh to the BBB but the same external power supply board if i connect to BeagleBone Black Industrial 4G is Red i cannot do ping/SSH no ethernet get up. Plz can any one suggest what wrong is there....

gururaj
 
Posts: 12
Joined: Sat Nov 05, 2016 7:11 am

Re: device tree overlay - gpio

by drewfustini on Wed Nov 09, 2016 6:02 am

I'd suggest contacting the manufacturer regarding support for the BeagleBone Black Industrial. I believe it should be this page:
https://www.element14.com/community/doc ... ustrial-4g

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

Re: device tree overlay - gpio

by gururaj on Wed Nov 09, 2016 8:56 am

Hi,
I written device tree overlay - gpio for 3 pins its working fine for me.
now i don't wont to load this every time enen after the board reboot. tell me where shall i put this command
" echo VALVERS-IO > /sys/devices/bone_capemgr.*/slots" make work even after device reboot.
thank you

gururaj
 
Posts: 12
Joined: Sat Nov 05, 2016 7:11 am

Re: device tree overlay - gpio

by drewfustini on Wed Nov 09, 2016 3:04 pm

I'd like to know more about the system software on your beaglebone.

Please paste the output of:

uname -a

cat /etc/dogtag

cat /etc/debian_version


Also, please paste the content of your custom .dts file.

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

Re: device tree overlay - gpio

by gururaj on Thu Nov 10, 2016 2:57 am

hi, Thank you for replay, Here is the following details

uname -a
Linux beaglebone 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 armv7l GNU/Linux

cat /etc/dogtag
BeagleBoard.org Debian Image 2015-03-01

cat /etc/debian_version
7.8

gururaj
 
Posts: 12
Joined: Sat Nov 05, 2016 7:11 am

Re: device tree overlay - gpio

by gururaj on Thu Nov 10, 2016 9:58 am

Also, please paste the content of your custom .dts file.

/dts-v1/;
/plugin/;

/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";

part-number = "VALVERS-IO";

fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
valversled: pinmux_valversled {
pinctrl-single,pins = <
0x084 0x7 // GPIO1_31 Mode7, GPIO
0x080 0x7 // GPIO1_30 Mode7, GPIO
0x004 0x7 // GPIO1_1 Mode 7, GPIO
>;
};
};
};

fragment@1 {
target = <&ocp>;
__overlay__ {
valversled_helper {
compatible = "bone-pinmux-helper";
pinctrl-names = "default";
pinctrl-0 = <&valversled>;
status = "okay";
};
};
};
};

gururaj
 
Posts: 12
Joined: Sat Nov 05, 2016 7:11 am

Re: device tree overlay - gpio

by drewfustini on Fri Nov 11, 2016 1:31 am

It appears that you want to configure those pins for GPIO mode. Is that correct?

Have you compiled the .dts and placed it in /lib/firmware?

After you enter this command:
echo VALVERS-IO > /sys/devices/bone_capemgr.*/slots

Please run the command dmesg and paste any errors that you see (this is the Linux kernel log).

Also, please paste the output of:
/sys/devices/bone_capemgr.*/slots

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

Re: device tree overlay - gpio

by gururaj on Fri Nov 11, 2016 4:10 am

$ cat /etc/dogtag
BeagleBoard.org Debian Image 2015-03-01

$cat /etc/debian_version
7.8

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 7.8 (wheezy)
Release: 7.8
Codename: wheezy


$ uname -ar
Linux beaglebone 3.8.13-bone70 #1 SMP Fri Jan 23 02:15:42 UTC 2015 armv7l GNU/Linux

$ cat /sys/devices/bone_capemgr.*/slots
0: 54:PF---
1: 55:PF---
2: 56:PF---
3: 57:PF---
4: ff:P-O-- Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G
8: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART1
9: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART2
10: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART4
11: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART5
12: ff:P-O-L Override Board Name,00A0,Override Manuf,VALVERS-IO

$dmesg
[ 2780.414196] bone-capemgr bone_capemgr.9: part_number 'VALVERS-IO', version 'N/A'
[ 2780.414387] bone-capemgr bone_capemgr.9: slot #12: generic override
[ 2780.414433] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 12
[ 2780.414481] bone-capemgr bone_capemgr.9: slot #12: 'Override Board Name,00A0,Override Manuf,VALVERS-IO'
[ 2780.419139] bone-capemgr bone_capemgr.9: slot #12: Requesting part number/version based 'VALVERS-IO-00A0.dtbo
[ 2780.419206] bone-capemgr bone_capemgr.9: slot #12: Requesting firmware 'VALVERS-IO-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 2780.422675] bone-capemgr bone_capemgr.9: slot #12: dtbo 'VALVERS-IO-00A0.dtbo' loaded; converting to live tree
[ 2780.423078] bone-capemgr bone_capemgr.9: slot #12: #2 overlays
[ 2780.431125] bone-capemgr bone_capemgr.9: slot #12: Applied #2 overlays.

Currently i have set Static IP address in /etc/network/interface as shown below....
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp
# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE
auto eth0
iface eth0 inet static
address 192.109.209.70
netmask 255.255.255.0
network 192.109.209.0
gateway 192.109.209.176
dns-nameservers 8.8.8.8
dns-nameservers 8.8.4.4
# The secondary network interface
#auto eth1
#iface eth1 inet dhcp

# WiFi Example
#auto wlan0
#iface wlan0 inet dhcp
# wpa-ssid "essid"
# wpa-psk "password"

# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
# Note on some boards, usb0 is automaticly setup with an init script
#iface usb0 inet static
#address 192.168.7.2
#netmask 255.255.255.0
#network 192.168.7.0
#gateway 192.168.7.1


currently i am facing some issue related network.. i keep device on overl night. when i come morning and i try to do ssh to my beaglebone. its won't happen.
then i will cross check in Debug port UART0(ttyO0) by doing ifconfig..
its ip address get changed my static IP 192.109.209.70.
Can you plz tell me what was the problem..

thank you
its more appreciable for your valuable reply

gururaj
 
Posts: 12
Joined: Sat Nov 05, 2016 7:11 am

Re: device tree overlay - gpio

by drewfustini on Fri Nov 11, 2016 4:36 pm

gururaj wrote:now i don't wont to load this every time after the board reboot. tell me where shall i put this command
" echo VALVERS-IO > /sys/devices/bone_capemgr.*/slots" make work even after device reboot.
thank you


I failed to understand your original question. I thought you were having trouble with getting the device tree overlay to work.

To enable an overlay at boot, add the name to cape_enable in /boot/uboot/uEnv.txt. For example:

cape_enable=capemgr.enable_partno=VALVERS-IO

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

Please be positive and constructive with your questions and comments.