Using GPIO

Hello!

I install in my BBB Debian.
I can read the value Form Pin 12.
I can set the direction to in or out.

But I dont know which Pins has wich mode.
I want all 4 serial Ports, 12 inputs, 12 outputs and 2 analog inputs and 2 analog outputs.

But cant set OR check the mode of the Pins.

AS far I dead I have to compile the kernel new, when I want change mode of Pins?

For help Im very pleased.

Thank you!

You can do most of what you want using my universal cape overlay and the
config-pin command:

https://github.com/cdsteinkuehler/beaglebone-universal-io

Note these are pre-installed on the new Debian images for the
BeagleBone, so if you're testing with one of those you won't need to
download anything.

Also note that you don't have to do anything special to use the analog
input pins, they are always setup as analog inputs. But there are no
analog outputs, unless you send PWM to a digital I/O pin and use an
external filter.

Hello!

Thank you for your help. Will try to use tomorrow.

Hannes

Hello!

Can you please tell me how I have to use it?
I use the Image “BBB-eMMC-flasher-debian-7.4-2014-04-18-2gb.img”
With a newer Image I have the problem to have less space on the eMMC.

With the first line I get, the File exists:
nano /sys/devices/bone_capemgr.9/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
7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-UART1
8: 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

I enabled (if it works) before the serial ports.

Can you explain please how to use?
Your GUI I also try, but how to use? Compiling the main.cpp bring error:

main.cpp:20:24: schwerwiegender Fehler: QApplication: Datei oder Verzeichnis nicht gefunden
Kompilierung beendet.

Thank you!

Hello!

Guess I passed now some steps:
https://learn.adafruit.com/introduction-to-the-beaglebone-black-device-tree/exporting-and-unexporting-an-overlay

Great instruction. I install dtc and can compile your files with “sh make.sh”

But there is just one problem:

echo cape-universal > /sys/devices/bone_capemgr.*/slots

I get:

bash: echo: write error: File exists

Can I add the line(s) manual in the slots? Because when I open the slot:

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

I can add BB-UART1 … but not cape-universal.

Any idea how I can add the settings?

Thanks

You load *JUST* the cape-universal. It provides user-mode selection of
pin multiplexing and also loads most useful hardware drivers (like the
UARTs).

Once loaded, all pins default to inputs with their power-on reset
default pull up/down settings. To change the pin functions, use the
config-pin utility:

config-pin p9.24 uart
config-pin p9.25 high

Just type config-pin (with no options) to get usage info.

You can also provide a file list of pin settings to the program, to
setup everything at once. There is even a GUI program to generate the
files, but it doesn't (yet) run on the BeagleBone. Get the PC, Mac, or
x86 Linux version here:

https://github.com/strahlex/BBIOConfig/releases

Hi Charles!

Sorry for the question, but what did you mean with just load?
New BBB and set the first Commando:
echo cape-universal > /sys/devices/bone_capemgr.*/slots

And there I get Write Error. File exists.

Guess without this command I cannot proceed?

Hannes

You're probably having an issue with the audio pins if you haven't
disabled the HDMI cape (leaving the HDMIn without audio to load).

If HDMI is grabbing the audio pins, you need to load the universaln cape
which leaves the audio pins open:

echo cape-universaln > /sys/devices/bone_capemgr.*/slots

Hello Charles!

Hey, thank you! I disable the HDMI in the uEnv.txt and now I can enable cape-universal!
I put cape-universal in the uEnv.txt and now its enabled after reboot!

I have to set up the UART ba myself, right?

echo uart > /sys/devices/ocp.3/P9_11_pinmux.25/state

enable P9_11 to UART Mode, right?

Can I set this in your cape-universal-00A0.dts by default?

Thank you!

And maybe there is somewhere a list of all possible states?
uart, default, timer are I know.

Because P9_23 bring with

cat/sys/class/gpio/gpio49/value
bring me a “1” when I close with 3.3V

P9_17 bring me a “1” when I close with GND.

I would all set to “1” if I put 3.3V.

Thanks

Sorry. You already answered:

Once loaded, all pins default to inputs with their power-on reset
default pull up/down settings. To change the pin functions, use the
config-pin utility:
config-pin p9.24 uart
config-pin p9.25 high
Just type config-pin (with no options) to get usage info.

Thanks

You beat me to the answer...use the config-pin utility! :slight_smile:

Let me know if you run into any problems. I haven't tested every
combination of features and there was a lot of cut-and-paste, so there
could be some bugs.

Hi Charles!

Sorry for the question, but what did you mean with just load?
New BBB and set the first Commando:
echo cape-universal > /sys/devices/bone_capemgr.*/slots

And there I get Write Error. File exists.

Guess without this command I cannot proceed?

You’re probably having an issue with the audio pins if you haven’t
disabled the HDMI cape (leaving the HDMIn without audio to load).

If HDMI is grabbing the audio pins, you need to load the universaln cape
which leaves the audio pins open:

echo cape-universaln > /sys/devices/bone_capemgr.*/slots

With the 4/23 Debian image, I get the following error when running the above command fresh:

[ 1184.038531] bone-capemgr bone_capemgr.9: part_number ‘cape-universaln’, version ‘N/A’
[ 1184.038814] bone-capemgr bone_capemgr.9: slot #9: generic override
[ 1184.038866] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 9
[ 1184.038918] bone-capemgr bone_capemgr.9: slot #9: ‘Override Board Name,00A0,Override Manuf,cape-universaln’
[ 1184.039193] bone-capemgr bone_capemgr.9: slot #9: Requesting part number/version based 'cape-universaln-00A0.dtbo
[ 1184.039246] bone-capemgr bone_capemgr.9: slot #9: Requesting firmware ‘cape-universaln-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 1184.039313] bone-capemgr bone_capemgr.9: slot #9: dtbo ‘cape-universaln-00A0.dtbo’ loaded; converting to live tree
[ 1184.159501] bone-capemgr bone_capemgr.9: slot #9: cape-universaln conflict P9.31 (#5:BB-BONELT-HDMI)
[ 1184.169509] bone-capemgr bone_capemgr.9: slot #9: Failed verification

Pin Conflict. ^^

Make sure you disable the cape you need to disable before loading that
specific cape.

Regards,

Hi Charles!

Sorry for the question, but what did you mean with just load?
New BBB and set the first Commando:
echo cape-universal > /sys/devices/bone_capemgr.*/slots

And there I get Write Error. File exists.

Guess without this command I cannot proceed?

You’re probably having an issue with the audio pins if you haven’t
disabled the HDMI cape (leaving the HDMIn without audio to load).

If HDMI is grabbing the audio pins, you need to load the universaln cape
which leaves the audio pins open:

echo cape-universaln > /sys/devices/bone_capemgr.*/slots

With the 4/23 Debian image, I get the following error when running the above command fresh:

[ 1184.038531] bone-capemgr bone_capemgr.9: part_number ‘cape-universaln’, version ‘N/A’
[ 1184.038814] bone-capemgr bone_capemgr.9: slot #9: generic override
[ 1184.038866] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 9
[ 1184.038918] bone-capemgr bone_capemgr.9: slot #9: ‘Override Board Name,00A0,Override Manuf,cape-universaln’
[ 1184.039193] bone-capemgr bone_capemgr.9: slot #9: Requesting part number/version based 'cape-universaln-00A0.dtbo
[ 1184.039246] bone-capemgr bone_capemgr.9: slot #9: Requesting firmware ‘cape-universaln-00A0.dtbo’ for board-name ‘Override Board Name’, version ‘00A0’
[ 1184.039313] bone-capemgr bone_capemgr.9: slot #9: dtbo ‘cape-universaln-00A0.dtbo’ loaded; converting to live tree
[ 1184.159501] bone-capemgr bone_capemgr.9: slot #9: cape-universaln conflict P9.31 (#5:BB-BONELT-HDMI)

Pin Conflict. ^^

Make sure you disable the cape you need to disable before loading that specific cape.

Is there not a version of cape-universal that doesn’t use the eMMC or HDMI pins?

beaglebone-universal-io/cape-universaln-00A0.dts at master · cdsteinkuehler/beaglebone-universal-io · GitHub makes me think that P9-31 isn’t requested by cape-universaln, yet the conflict still happens. Leaving the .dts files around might be helpful.

> Hi Charles!
>
> Sorry for the question, but what did you mean with just load?
> New BBB and set the first Commando:
> echo cape-universal > /sys/devices/bone_capemgr.*/slots
>
> And there I get Write Error. File exists.
>
> Guess without this command I cannot proceed?

You're probably having an issue with the audio pins if you haven't
disabled the HDMI cape (leaving the HDMIn without audio to load).

If HDMI is grabbing the audio pins, you need to load the universaln
cape
which leaves the audio pins open:

echo cape-universaln > /sys/devices/bone_capemgr.*/slots

With the 4/23 Debian image, I get the following error when running the
above command fresh:

[ 1184.038531] bone-capemgr bone_capemgr.9: part_number
'cape-universaln', version 'N/A'
[ 1184.038814] bone-capemgr bone_capemgr.9: slot #9: generic override
[ 1184.038866] bone-capemgr bone_capemgr.9: bone: Using override eeprom
data at slot 9
[ 1184.038918] bone-capemgr bone_capemgr.9: slot #9: 'Override Board
Name,00A0,Override Manuf,cape-universaln'
[ 1184.039193] bone-capemgr bone_capemgr.9: slot #9: Requesting part
number/version based 'cape-universaln-00A0.dtbo
[ 1184.039246] bone-capemgr bone_capemgr.9: slot #9: Requesting firmware
'cape-universaln-00A0.dtbo' for board-name 'Override Board Name', version
'00A0'
[ 1184.039313] bone-capemgr bone_capemgr.9: slot #9: dtbo
'cape-universaln-00A0.dtbo' loaded; converting to live tree
[ 1184.159501] bone-capemgr bone_capemgr.9: slot #9: cape-universaln
conflict P9.31 (#5:BB-BONELT-HDMI)

Pin Conflict. ^^

Make sure you disable the cape you need to disable before loading that
specific cape.

Is there not a version of cape-universal that doesn't use the eMMC or HDMI
pins?

https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universaln-00A0.dtsmakes me think that P9-31 isn't requested by cape-universaln, yet the
conflict still happens. Leaving the .dts files around might be helpful.

I think I found it:

https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universaln-00A0.dtsmakes me think that P9-31 isn't requested by cape-universaln, yet the
conflict still happens. Leaving the .dts files around might be helpful.

Look in: /opt/source/beaglebone-universal-io/

I think I found it:
cape-universaln: remove P9_31 by jadonk · Pull Request #5 · cdsteinkuehler/beaglebone-universal-io · GitHub

Thanks Jason! Merged.

I always disable the HDMI (with audio) so didn't catch this one.

Robert:
This will need to get migrated to the kernel source as well. Can you
handle that or should I send a patch (or pull request against ??) ?

No worries, i'll pull in that change tomorrow, i found a another half dozen
new cape dtbo's i need to add. :wink:

Regards,

>>
>>
https://github.com/cdsteinkuehler/beaglebone-universal-io/blob/master/cape-universaln-00A0.dtsmakesme think that P9-31 isn't requested by cape-universaln, yet the
>> conflict still happens. Leaving the .dts files around might be helpful.

Look in: /opt/source/beaglebone-universal-io/

> I think I found it:
> cape-universaln: remove P9_31 by jadonk · Pull Request #5 · cdsteinkuehler/beaglebone-universal-io · GitHub

Thanks Jason! Merged.

I always disable the HDMI (with audio) so didn't catch this one.

Still getting the error and trying to track it down.

Rename the file and echo it into the slots later once in userspace. (it has
the same name as the file built-into the kernel)

Regards,