Hello,
I recently started working on my BBB A6A. I went through necessary getting started guides and it works like a charm. Now as a part of my project, I need to use some of the GPIOs on P8/P9 header. While googling how to use them as a GPIO, and how to set pinmux and etc, I went through this guide. http://derekmolloy.ie/gpios-on-the-beaglebone-black-using-device-tree-overlays/ and he explained everything very clearly.
Now my question is : is there any way i can use allocated pins as GPIOs other than available pins ? If yes, how ? If no, why ?
For example, P9_19 and P9_20 are Allocated to (Group: pinmux_i2c2_pins) and hence it can not be used as GPIOs ?
Thanks.
Hello,
I recently started working on my BBB A6A. I went through necessary getting started guides and it works like a charm. Now as a part of my project, I need to use some of the GPIOs on P8/P9 header. While googling how to use them as a GPIO, and how to set pinmux and etc, I went through this guide. http://derekmolloy.ie/gpios-on-the-beaglebone-black-using-device-tree-overlays/ and he explained everything very clearly.
Now my question is : is there any way i can use allocated pins as GPIOs other than available pins ? If yes, how ? If no, why ?
For example, P9_19 and P9_20 are Allocated to (Group: pinmux_i2c2_pins) and hence it can not be used as GPIOs ?
If pins are also connected to circuitry on the board that cannot be disabled then you cannot use those pins for GPIO. For example, pins used for the eMMC can be used for GPIO as long as eMMC is disabled. Same for LCD pins, but then you cannot use LCD or HDMI. I2C2 isn’t connected to other circuity on the board so you can use it for GPIO.
Regards,
John
Thanks John. Got it cleared. 
Would be nice if you could explain how to disable eMMC on debian. I ran out of GPIO’s in my project. Tried to use P9_19 and P9_20 (both I2C’s) in the device tree overlay but since i did that the overlay doesn’t work correctly anymore.
how do u use the i2c2 pins? it doesn’t work on my bbb if i only change the pinmode to mode 7 in my device tree. have u done additional changes or something like that elsewhere?
how do u use the i2c2 pins? it doesn’t work on my bbb if i only change the pinmode to mode 7 in my device tree. have u done additional changes or something like that elsewhere?
If you look at /arch/arm/boot/dts/am335x-bone-common.dtsi you will see the i2c2 definition:
&i2c2 {
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <&i2c2_pins>;
clock-frequency = <100000>;
cape_eeprom0: cape_eeprom0@54 {
compatible = “at,24c256”;
reg = <0x54>;
};
cape_eeprom1: cape_eeprom1@55 {
compatible = “at,24c256”;
reg = <0x55>;
};
cape_eeprom2: cape_eeprom2@56 {
compatible = “at,24c256”;
reg = <0x56>;
};
cape_eeprom3: cape_eeprom3@57 {
compatible = “at,24c256”;
reg = <0x57>;
};
};
The line “pinctrl-0 = <&i2c2_pins>;” refers to the i2cs_pins label in the pinmux section:
i2c2_pins: pinmux_i2c2_pins {
pinctrl-single,pins = <
0x178 0x73 /* uart1_ctsn.i2c2_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 /
0x17c 0x73 / uart1_rtsn.i2c2_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */
;
};
So, as you can see, i2c2 is used to identify the capes plugged into the BBB. If you don’t need this feature, simply remove or comment out this section and then change the i2c2 pins to gpio pins.
Regards,
John
I’m using Derek Molloys device Tree overlays and I’m running debian… I can’t find the folder on my bbb .
But I found the “am335x-bone-common.dtsi” in https://github.com/derekmolloy/boneDeviceTree/tree/master/DTSource3.8.13 which I have on my bbb. I’ve commented out the section you mentioned but nothing changes. Without using or declaring the I2c2 pins in my Device Tree Overlay I’m able to use all unallocated pins as GPIO Inputs as I declared them in my Device Tree Overlay.
Did i change the wrong am335x-bone-common.dtsi.? Is there another one elsewhere on the debian distribution or do i have to copy the changed file into a specific folder?
I’m using Derek Molloys device Tree overlays and I’m running debian… I can’t find the folder on my bbb .
But I found the “am335x-bone-common.dtsi” in https://github.com/derekmolloy/boneDeviceTree/tree/master/DTSource3.8.13 which I have on my bbb. I’ve commented out the section you mentioned but nothing changes. Without using or declaring the I2c2 pins in my Device Tree Overlay I’m able to use all unallocated pins as GPIO Inputs as I declared them in my Device Tree Overlay.
Did i change the wrong am335x-bone-common.dtsi.? Is there another one elsewhere on the debian distribution or do i have to copy the changed file into a specific folder?
You need to follow:
http://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-LinuxKernel
After the kernel has built, you will see a KERNEL folder which includes the complete Linux Kernel. In that folder, go to /arch/arm/boot/dts and edit the am335x-bone-common.dtsi file. After that, return to the bb-kernel folder and run tools/rebuild.sh script. The build results will be in the deploy folder which you need to copy to your sdcard/“nfs folder”.
Regards,
John
Thanks for your quick responses always.
I’ve tried the Instructions to build the Kernel
git clone https:``//github.com/RobertCNelson/bb-kernel.git
cd bb-kernel/
git checkout origin/am33x-v3.``8
-b tmp
but if use the command ./build_kernel.sh
. i get this message after the “resolving deltas process”. I’ve tried several times but it always freezes at 96%. Do you have any Idea what went wrong?
this is what i get in the commandshell:
root@beaglebone:/bb-kernel# ./build_kernel.sh
- Detected build host [Debian GNU/Linux 7.5 (wheezy)]
- host: [armv7l]
- git HEAD commit: [e496a19d1fed586a7e82c3cd74f0571491a526ca]
Thanks for your quick responses always.
I’ve tried the Instructions to build the Kernel
git clone https:``//github.com/RobertCNelson/bb-kernel.git
cd bb-kernel/
git checkout origin/am33x-v3.``8
-b tmp
You need to be building this on your desktop, not on your BBB.
Regards,
John
halfbrain,
If you’re using angstrom or debian, you can disable the emmc by adding this to the optargs in uEnv.txt on the usb mass storage partition: capemgr.disable_partno=BB-BONE-EMMC-2G
If you’re not using hdmi, you can free up those too: capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN,BB-BONE-EMMC-2G
halfbrain, I forgot to mention, you should tie the eMMC cmd and clock pins low on P8.20 and P8.21, as suggested by the wiki: http://elinux.org/Beagleboard:BeagleBoneBlack#Onboard_eMMC
Hi John
Sorry for asking you again but it still doesnt work 
I’ve tried several times to build the kernel, also in the Desktop Folder. Yesterday i destroyed my image somehow :-). I reflashed the BBB again with the Debian form my uSD Card and started right with the Kernel building without doing anything else before except the
sudo apt-get update
sudo apt-get install bc lzma lzop libncurses5-dev
which are necessary…
but i get the same error everytime :
root@beaglebone:/home/debian/Desktop/bb-kernel# ./build_kernel.sh
- Detected build host [Debian GNU/Linux 7.5 (wheezy)]
- host: [armv7l]
- git HEAD commit: [e496a19d1fed586a7e82c3cd74f0571491a526ca]
/home/debian/Desktop/bb-kernel/system.sh.sample' ->
/home/debian/Desktop/bb-kernel/system.sh’
Hi John
I always get this even after reflashing my whole bbb with Debian.
root@beaglebone:/home/debian/Desktop/bb-kernel# ./build_kernel.sh
- Detected build host [Debian GNU/Linux 7.5 (wheezy)]
- host: [armv7l]
- git HEAD commit: [e496a19d1fed586a7e82c3cd74f0571491a526ca]
Hi John
I always get this even after reflashing my whole bbb with Debian.
root@beaglebone:/home/debian/Desktop/bb-kernel# ./build_kernel.sh
- Detected build host [Debian GNU/Linux 7.5 (wheezy)]
- host: [armv7l]
- git HEAD commit: [e496a19d1fed586a7e82c3cd74f0571491a526ca]
Probably ran out of space. Realistically, just use an x86 desktop to run
the script.
Regards,
Thanks for your Answer Brandon
Just a few questions for my Information:
- If I used the EMMC pins I would need to boot from SD Card everytime?
- And if I used the HMDI Pins it wouldn’t be possible to connect the uHdmi Cable to the bbb and connect some screen to it? Because they are connected to the same pins?
The way you unallocated the pins and the way john recommend me to unallocate the pins seem to be very different. To be honest I don’t understand the difference of the two ways. Which way is the easier one and can this way be used to unallocate every pin on the bbb? I just wan’t to make things trickier than they are
But i’m very thankful for your help so far 
What ran out of space the bbb? How do I use an x86desktop…btw whats and x86desktop :-)? a 32bit Computer?
I’m sshing with Putty via Network from my Windows 7 64bit Pc. Is that a problem? Doesn’t the whole process run on the bbb?
What ran out of space the bbb?
I'll take a good 2-3gb of space in the end. Haven't looked at the
numbers in awhile.
How do I use an x86desktop...btw whats and
x86desktop :-)? a 32bit Computer?
"x86" based "linux" desktop.. doesn't matter if it's 32bit/64bit.
Regards,
What is wrong is that you’re doing this on your bbb. You should be doing this on a cross compile i386 PC.
What is it you’re trying to do ?