If you really need extra io pins, use a I2C io expander. much easier than
beating yourself up.

On 10/15/2020 2:08 AM, deevee...@gmail.com wrote:
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 =<&am33xx_pinmux>;
        __overlay__ {
            pinctrl_test:pinctrl_test_0_pins {
                pinctrl-single,pins =<
0x1b40x0F/* P9_41 muxRegOffset, OUTPUT | MODE0 | Pull down enabled */
0x1a80x07/* P9_42 muxRegOffset, OUTPUT | MODE0 */

>;
};
};
};

    fragment@1 {
        target =<&ocp>;
        __overlay__ {
            test_helper:helper {
                compatible ="bone-pinmux-helper";
                pinctrl-names ="default";
                pinctrl-0=<&pinctrl_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.dtboin/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 DebianImage2018-10-07]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot2018.09-00002-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>]
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,115200n8bone_capemgr.uboot_capemgr_enabled=1root=/dev/mmcblk1p1 ro rootfstype=ext4 rootwait coherent_pool=1Mnet.ifnames=0quiet]
dmesg |grep pinctrl-single
[1.040989]pinctrl-single 44e10800.pinmux:142pins at pa f9e10800 size 568
dmesg |grep gpio-of-helper
[1.042221]gpio-of-helper ocp:cape-universal:ready
END

|


uname -a returns:
|
Linuxbeaglebone 4.14.71-ti-r80 #1 SMP PREEMPT Fri Oct 5 23:50:11 UTC 2018 armv7l GNU/Linux
|





/boot/uEnv.txt contents:
|
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.14.71-ti-r80
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_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/BB-UART1-00A0.dtbo
uboot_overlay_addr5=/lib/firmware/BB-UART2-00A0.dtbo
uboot_overlay_addr6=/lib/firmware/BB-UART4-00A0.dtbo
uboot_overlay_addr7=/lib/firmware/p941test-00A0.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_rproc (4.14.x-ti kernel)
# uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_uio (4.4.x-ti, 4.14.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=1Mnet.ifnames=0quiet

#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

#Use an overlayfs on top of a read-only root filesystem:
#cmdline=coherent_pool=1M net.ifnames=0 quiet overlayroot=tmpfs

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





/sys/kernel/debug/pinctrl/44e10800.pinmux/pins |grep PIN109 has:
pin 109 (PIN109) 44e109b4 0000000f pinctrl-single
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com <mailto:beagleboard+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/6d0ed9a7-ba53-4bad-81a9-2e104bf2d448o%40googlegroups.com <https://groups.google.com/d/msgid/beagleboard/6d0ed9a7-ba53-4bad-81a9-2e104bf2d448o%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
For more options, visit http://beagleboard.org/discuss
--- You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/0c645348-f596-153b-94ea-38c2dfecb982%40gmail.com.

Reply via email to