I don't like to admit defeat, but this time I give up...
I am trying to use the BeagleBone Black P9_41 pin as a GPIO
(GPIO3_20/GPIO0_20). According to the BeagleBone Black System reference
manual two different balls are connected to that pin:
"# Both of these signals connect to pin 41 of P11. Resistors are installed
that allow for the GPIO3_20 connection to be removed by removing R221. The
intent is to allow the SW to use either of these signals, one or the other,
on pin 41. SW should set the unused pin in input mode when using the other
pin. This allowed us to get an extra signal out to the expansion header. "
I realize this complicates matters, but I have no choice but to use this
exact pin. I am using other pins succesfully. Additionally, I am using
overlays to use ttyO1, ttyO2, ttyO4 and ttyO5.
The R221 designator is not correct, so I downloaded the boardfiles and
looked at them in Orcad. I tryed desoldered R19 (which disconnects CLKOUT2)
as well as R20 (one at a time), but that didn't help. I resoldered both 0R
bridges.
I have created a DTS which compiles succesfully with
After doing
echo 116 > /sys/class/gpio/unexport
echo 116 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio116/direction
I can toggle the pin in software:
echo 1 > /sys/class/gpio/gpio116/value
and
cat /sys/class/gpio/gpio116/value
returns 1 or 0 depending on what value I set it to
However, the voltage of the pin stays at 3.3V.
I've also tried to init GPIO20 as well as 116, set them both to low or set
one to input and the other output/high. No luck.
I guess I need more than a simple overlay/pinmux config/... to set the pin
configuration (and disable CLKOUT2)
There is lots of information on how to create and use them, but no clear
explanation on how to do this with current kernels. I've gone through Derek
Malloys book, but some of his methods seems deprecated with newer kernels.
My (compiling but not functioning) p941test-00A0.dts (based on the TI dts
example files):
/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone", "ti,beaglebone-black";
/* identification */
part-number = "pinctrl-test-0";
fragment@0 {
target = <_pinmux>;
__overlay__ {
pinctrl_test: pinctrl_test_0_pins {
pinctrl-single,pins = <
0x1b4 0x0F/* P9_41 muxRegOffset, OUTPUT | MODE0 |
Pull down enabled */
0x1a8 0x07/* P9_42 muxRegOffset, OUTPUT | MODE0 */
>;
};
};
};
fragment@1 {
target = <>;
__overlay__ {
test_helper: helper {
compatible = "bone-pinmux-helper";
pinctrl-names = "default";
pinctrl-0 = <_test>;
status = "okay";
};
};
};
};
compiling this with
sudo make -d src/arm/p941test-00A0.dtbo
seems to do what it should.
After using ./install.sh to put it everything in the correct directory, I
set
uboot_overlay_addr7=/lib/firmware/p941test-00A0.dtbo in /boot/uEnv.txt
I'm quite confident my dts is the issue, but no idea what's wrong (and it
does compile).
Some additional info:
/opt/scripts/tools/version.sh returns:
git:/opt/scripts/:[1aa73453b2c980b75e31e83dab7dd8b6696f10c7]
eeprom:[A335BNLTEIA04718BBBK00F9]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Image 2018-10-07]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.09-2-gd5b4c4b656
]:[location: dd MBR]
kernel:[4.14.71-ti-r80]
nodejs:[v6.14.4]
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr4=/lib/firmware/BB-UART1-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr5=/lib/firmware/BB-UART2-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr6=/lib/firmware/BB-UART4-00A0.dtbo]
uboot_overlay_options:[uboot_overlay_addr7=/lib/firmware/BB-UART5-00A0.dtbo]
uboot_overlay_options:[disable_uboot_overlay_video=1]
uboot_overlay_options:[disable_uboot_overlay_audio=1]
uboot_overlay_options:[disable_uboot_overlay_wireless=1]
uboot_overlay_options:[disable_uboot_overlay_adc=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade
]
pkg:[bb-cape-overlays]:[4.14.20200805.0-0~stretch+20200805]
pkg:[bb-wl18xx-firmware]:[1.20180517-0rcnee0~stretch+20180517]
pkg:[kmod]:[23-2rcnee1~stretch+20171005]
pkg:[librobotcontrol]:[1.0.3-git20181009.0-0rcnee0~stretch+20181010]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=
/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0
quiet]
dmesg | grep pinctrl-single
[1.040989] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size
568
dmesg | grep gpio-of-helper