P8_3 remains HIGH

Hi guys.
I am fairly new to BBB however something i expected to be simple is causing me nightmares :).

I have a project in my head where I want to control lights over wall switches. Anyways, wanted to make entire GPIO0[] bank as inputs with pulldown 0x27. And GPIO1[] bank as outputs.

There could be some more pins but one for sure doesn’t behave the way I want. Compiled my own overlay where all GPIO8_(3,5,7,9,11…) Are set as 0x27. It’s loaded properly, all other overlays like emmc, audio, video are disabled within uEnv file.

Oddly when i export 38 and check value it says 1 if i measure it to the GND it shows high as well. What am I missing?

Well a couple of things to check, have a look at the serial output when booting or dmesg. Make sure the pin has not already been claimed by something else…

You don’t actually say, but when set as an output and setting value to 0 the pins stays high ? GPIO1.5 ?

I would guess that either your overlay is wrong or the pin has already been claimed by something else. I can’t check right now though.

Thanks @benedict.hewson unfortunately i dont see anything in dmesg that relates to this issue:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.19.94-ti-r42 (voodoo@x3-am57xx-beagle-x15-2gb) (gcc version 8.3.0 (Debian 8.3.0-6)) #1buster SMP PREEMPT Tue Mar 31 19:38:29 UTC 2020
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 48 MiB at 0x9c800000
[    0.000000] On node 0 totalpages: 130560
[    0.000000]   Normal zone: 1148 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 130560 pages, LIFO batch:31
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon)
[    0.000000] random: get_random_bytes called from start_kernel+0xac/0x4b4 with crng_init=0
[    0.000000] percpu: Embedded 17 pages/cpu s38988 r8192 d22452 u69632
[    0.000000] pcpu-alloc: s38988 r8192 d22452 u69632 alloc=17*4096
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129412
[    0.000000] Kernel command line: console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 438400K/522240K available (13312K kernel code, 1136K rwdata, 4308K rodata, 1024K init, 350K bss, 34688K reserved, 49152K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
                   vector  : 0xffff0000 - 0xffff1000   (   4 kB)
                   fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
                   vmalloc : 0xe0000000 - 0xff800000   ( 504 MB)
                   lowmem  : 0xc0000000 - 0xdfe00000   ( 510 MB)
                   pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
                   modules : 0xbf000000 - 0xbfe00000   (  14 MB)
                     .text : 0x(ptrval) - 0x(ptrval)   (14304 kB)
                     .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
                     .data : 0x(ptrval) - 0x(ptrval)   (1137 kB)
                      .bss : 0x(ptrval) - 0x(ptrval)   ( 351 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] ftrace: allocating 42043 entries in 124 pages
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[    0.000000]  Tasks RCU enabled.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000017] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000034] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000044] OMAP clocksource: timer1 at 24000000 Hz
[    0.000747] timer_probe: no matching timers found
[    0.000974] Console: colour dummy device 80x30
[    0.001001] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    0.001005] This ensures that you still see kernel messages. Please
[    0.001010] update your kernel commandline.
[    0.001070] Calibrating delay loop (skipped) preset value.. 995.32 BogoMIPS (lpj=1990656)
[    0.001085] pid_max: default: 32768 minimum: 301
[    0.001364] Security Framework initialized
[    0.001379] Yama: becoming mindful.
[    0.001523] AppArmor: AppArmor initialized
[    0.001631] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001643] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.002743] CPU: Testing write buffer coherency: ok
[    0.002809] CPU0: Spectre v2: using BPIALL workaround
[    0.003404] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.027027] Setting up static identity map for 0x80100000 - 0x80100060
[    0.034937] rcu: Hierarchical SRCU implementation.
[    0.050952] smp: Bringing up secondary CPUs ...
[    0.050970] smp: Brought up 1 node, 1 CPU
[    0.050982] SMP: Total of 1 processors activated (995.32 BogoMIPS).
[    0.050988] CPU: All CPU(s) started in SVC mode.
[    0.052710] devtmpfs: initialized
[    0.067326] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.067950] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.067974] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.071943] xor: automatically using best checksumming function   neon
[    0.071960] pinctrl core: initialized pinctrl subsystem
[    0.073274] NET: Registered protocol family 16
[    0.078494] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.114469] l4_wkup_cm:clk:0010:0: failed to disable
[    0.154638] audit: initializing netlink subsys (disabled)
[    0.159046] audit: type=2000 audit(0.148:1): state=initialized audit_enabled=0 res=1
[    0.163696] OMAP GPIO hardware version 0.1
[    0.176453] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.203087] raid6: using algorithm neonx8 gen() 0 MB/s
[    0.203100] raid6: .... xor() 0 MB/s, rmw enabled
[    0.203107] raid6: using neon recovery algorithm
[    0.210372] edma 49000000.edma: TI EDMA DMA engine driver
[    0.213912] SCSI subsystem initialized
[    0.215099] libata version 3.00 loaded.
[    0.215414] usbcore: registered new interface driver usbfs
[    0.215489] usbcore: registered new interface driver hub
[    0.215608] usbcore: registered new device driver usb
[    0.217806] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[    0.218181] pps_core: LinuxPPS API ver. 1 registered
[    0.218189] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.218212] PTP clock support registered
[    0.219149] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
[    0.223286] Advanced Linux Sound Architecture Driver Initialized.
[    0.224106] NetLabel: Initializing
[    0.224116] NetLabel:  domain hash size = 128
[    0.224121] NetLabel:  protocols = UNLABELED CIPSOv4 CALIPSO
[    0.224210] NetLabel:  unlabeled traffic allowed by default
[    0.225279] clocksource: Switched to clocksource timer1
[    0.387604] VFS: Disk quotas dquot_6.6.0
[    0.387710] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.388592] AppArmor: AppArmor Filesystem Enabled
[    0.400732] NET: Registered protocol family 2
[    0.401867] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes)
[    0.401906] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.401947] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.402006] TCP: Hash tables configured (established 4096 bind 4096)
[    0.402144] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.402165] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.402548] NET: Registered protocol family 1
[    0.415706] RPC: Registered named UNIX socket transport module.
[    0.415717] RPC: Registered udp transport module.
[    0.415722] RPC: Registered tcp transport module.
[    0.415727] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.416365] Unpacking initramfs...
[    0.810883] Freeing initrd memory: 6884K
[    0.811747] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.814592] Initialise system trusted keyrings
[    0.814989] workingset: timestamp_bits=14 max_order=17 bucket_order=3
[    0.822207] zbud: loaded
[    0.829586] NFS: Registering the id_resolver key type
[    0.829631] Key type id_resolver registered
[    0.829638] Key type id_legacy registered
[    0.829656] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.830009] fuse init (API version 7.27)
[    0.840537] Key type asymmetric registered
[    0.840550] Asymmetric key parser 'x509' registered
[    0.840647] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 246)
[    0.845017] io scheduler noop registered
[    0.845030] io scheduler deadline registered
[    0.845530] io scheduler cfq registered (default)
[    0.845541] io scheduler mq-deadline registered
[    0.847753] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    0.849017] gpio-of-helper ocp:cape-universal: ready
[    0.852706] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
[    0.856234] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 30, base_baud = 3000000) is a 8250
[    0.866357] console [ttyS0] enabled
[    0.869010] omap_rng 48310000.rng: Random Number Generator ver. 20
[    0.869776] sdhci: Secure Digital Host Controller Interface driver
[    0.869785] sdhci: Copyright(c) Pierre Ossman
[    0.870220] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22)
[    0.870230] omap_hsmmc 48060000.mmc: Got CD GPIO
[    0.870819] omap_hsmmc 48060000.mmc: Linked as a consumer to regulator.1
[    0.871200] random: fast init done
[    0.871561] random: crng init done
[    0.897170] sdhci-pltfm: SDHCI platform and OF driver helper
[    0.932539] mmc0: host does not support reading read-only switch, assuming write-enable
[    0.934399] mmc0: new high speed SDHC card at address 1234
[    0.939784] mmcblk0: mmc0:1234 SA16G 14.5 GiB
[    0.946075]  mmcblk0: p1
[    1.020162] libphy: Fixed MDIO Bus: probed
[    1.021170] CAN device driver interface
[    1.073328] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    1.073343] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
[    1.073726] MDIO: davinci_mdio: dt: updated phy_id[0] from phy_mask[fffffffe]
[    1.091629] libphy: 4a101000.mdio: probed
[    1.091659] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[    1.092741] cpsw 4a100000.ethernet: Detected MACID = 3c:e4:b0:02:83:53
[    1.092892] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[    1.092902] cpsw 4a100000.ethernet: ALE Table size 1024
[    1.092944] cpsw 4a100000.ethernet: cpts: overflow check period 1250 (jiffies)
[    1.095130] usbcore: registered new interface driver smsc95xx
[    1.096034] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.096097] ehci-platform: EHCI generic platform driver
[    1.096291] ehci-omap: OMAP-EHCI Host Controller driver
[    1.096807] usbcore: registered new interface driver usb-storage
[    1.099682] am335x-phy-driver 47401300.usb-phy: 47401300.usb-phy supply vcc not found, using dummy regulator
[    1.099854] am335x-phy-driver 47401300.usb-phy: Linked as a consumer to regulator.0
[    1.102987] am335x-phy-driver 47401b00.usb-phy: 47401b00.usb-phy supply vcc not found, using dummy regulator
[    1.103166] am335x-phy-driver 47401b00.usb-phy: Linked as a consumer to regulator.0
[    1.106583] musb-hdrc musb-hdrc.1: MUSB HDRC host driver
[    1.106625] musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 1
[    1.106938] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[    1.106948] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.106955] usb usb1: Product: MUSB HDRC host driver
[    1.106962] usb usb1: Manufacturer: Linux 4.19.94-ti-r42 musb-hcd
[    1.106970] usb usb1: SerialNumber: musb-hdrc.1
[    1.107801] hub 1-0:1.0: USB hub found
[    1.107859] hub 1-0:1.0: 1 port detected
[    1.118901] omap_rtc 44e3e000.rtc: already running
[    1.119573] omap_rtc 44e3e000.rtc: registered as rtc0
[    1.120829] i2c /dev entries driver
[    1.123691] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[    1.124161] softdog: initialized. soft_noboot=0 soft_margin=60 sec soft_panic=0 (nowayout=0)
[    1.126909] ledtrig-cpu: registered to indicate activity on CPUs
[    1.127332] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
[    1.127662] omap-aes 53500000.aes: will run requests pump with realtime priority
[    1.129990] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
[    1.133202] hidraw: raw HID events driver (C) Jiri Kosina
[    1.137031] gnss: GNSS driver registered with major 242
[    1.142992] NET: Registered protocol family 10
[    1.213013] Segment Routing with IPv6
[    1.213166] mip6: Mobile IPv6
[    1.213481] NET: Registered protocol family 17
[    1.213513] can: controller area network core (rev 20170425 abi 9)
[    1.213607] NET: Registered protocol family 29
[    1.213685] 8021q: 802.1Q VLAN Support v1.8
[    1.213774] Key type dns_resolver registered
[    1.213781] mpls_gso: MPLS GSO support
[    1.214091] ThumbEE CPU extension supported.
[    1.214107] Registering SWP/SWPB emulation handler
[    1.214117] omap_voltage_late_init: Voltage driver support not added
[    1.222511] registered taskstats version 1
[    1.222523] Loading compiled-in X.509 certificates
[    1.222655] zswap: loaded using pool lzo/zbud
[    1.226112] Btrfs loaded, crc32c=crc32c-generic
[    1.226227] AppArmor: AppArmor sha1 policy hashing enabled
[    1.278605] tps6521x_pwrbutton tps65217-pwrbutton: DMA mask not set
[    1.279430] input: tps65217_pwr_but as /devices/platform/ocp/44e0b000.i2c/i2c-0/0-0024/tps65217-pwrbutton/input/input0
[    1.280409] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    1.281467] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    1.281580] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    1.285915] cpu cpu0: Linked as a consumer to regulator.3
[    1.286024] cpu cpu0: Dropping the link to regulator.3
[    1.286534] cpu cpu0: Linked as a consumer to regulator.3
[    1.288429] omap_rtc 44e3e000.rtc: setting system clock to 2022-12-23 21:45:55 UTC (1671831955)
[    1.289192] ALSA device list:
[    1.289200]   No soundcards found.
[    1.295582] Freeing unused kernel memory: 1024K
[    1.296306] Run /init as init process
[    4.916276] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[    5.704284] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    5.705014] systemd[1]: Detected architecture arm.
[    5.731433] systemd[1]: Set hostname to <beaglebone>.
[    7.148139] systemd[1]: Created slice system-serial\x2dgetty.slice.
[    7.149126] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    7.150496] systemd[1]: Listening on fsck to fsckd communication Socket.
[    7.150677] systemd[1]: Reached target Swap.
[    7.151707] systemd[1]: Listening on udev Control Socket.
[    7.152417] systemd[1]: Listening on udev Kernel Socket.
[    7.155122] systemd[1]: Created slice User and Session Slice.
[    8.065795] EXT4-fs (mmcblk0p1): re-mounted. Opts: errors=remount-ro
[    8.970419] systemd-journald[342]: Received request to flush runtime journal from PID 1
[   15.257925] net eth0: initializing cpsw version 1.12 (0)
[   15.330803] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[   15.346440] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   15.346461] 8021q: adding VLAN 0 to HW filter on device eth0
[   18.442916] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[   18.443009] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   20.229229] using random self ethernet address
[   20.229434] using random host ethernet address
[   20.691679] Mass Storage Function, version: 2009/09/11
[   20.691703] LUN: removable file: (no medium)
[   21.192722] using random self ethernet address
[   21.192741] using random host ethernet address
[   21.474305] usb0: HOST MAC 3c:e4:b0:02:83:56
[   21.476557] usb0: MAC 3c:e4:b0:02:83:55
[   21.489868] usb1: HOST MAC 3c:e4:b0:02:83:58
[   21.490308] usb1: MAC 3c:e4:b0:02:83:59
[   21.801661] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[   22.021828] IPv6: ADDRCONF(NETDEV_UP): usb1: link is not ready
[   35.232339] remoteproc remoteproc0: wkup_m3 is available
[   35.357620] remoteproc remoteproc0: powering up wkup_m3
[   35.357654] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[   35.357954] remoteproc remoteproc0: remote processor wkup_m3 is now up
[   35.357985] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x193
[   35.510909] PM: bootloader does not support rtc-only!

This is how my P0[] overlay looks like:

/*
* 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-tbox-0";
    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            pinctrl_tbox: pinctrl_tbox_0_pins {
                pinctrl-single,pins = <
                    0x018 0x27 /* P8_3  INPUT PULLDOWN | /sys/class/gpio/gpio38/ | MODE7 */
                    0x008 0x27 /* P8_5  INPUT PULLDOWN | /sys/class/gpio/gpio34/ | MODE7 */
                    0x090 0x27 /* P8_7  INPUT PULLDOWN | /sys/class/gpio/gpio66/ | MODE7 */
                    0x09c 0x27 /* P8_9  INPUT PULLDOWN | /sys/class/gpio/gpio69/ | MODE7 */
                    0x034 0x27 /* P8_11 INPUT PULLDOWN | /sys/class/gpio/gpio45/ | MODE7 */
                    0x024 0x27 /* P8_13 INPUT PULLDOWN | /sys/class/gpio/gpio23/ | MODE7 */
                    0x03c 0x27 /* P8_15 INPUT PULLDOWN | /sys/class/gpio/gpio47/ | MODE7 */
                    0x02c 0x27 /* P8_17 INPUT PULLDOWN | /sys/class/gpio/gpio27/ | MODE7 */
                    0x020 0x27 /* P8_19 INPUT PULLDOWN | /sys/class/gpio/gpio22/ | MODE7 */
                    0x080 0x27 /* P8_21 INPUT PULLDOWN | /sys/class/gpio/gpio62/ | MODE7 */
                    0x010 0x27 /* P8_23 INPUT PULLDOWN | /sys/class/gpio/gpio36/ | MODE7 */
                    0x000 0x27 /* P8_25 INPUT PULLDOWN | /sys/class/gpio/gpio32/ | MODE7 */
                    0x0e0 0x27 /* P8_27 INPUT PULLDOWN | /sys/class/gpio/gpio86/ | MODE7 */
                    0x0e4 0x27 /* P8_29 INPUT PULLDOWN | /sys/class/gpio/gpio87/ | MODE7 */
                    0x0d8 0x27 /* P8_31 INPUT PULLDOWN | /sys/class/gpio/gpio10/ | MODE7 */
                    0x0d4 0x27 /* P8_33 INPUT PULLDOWN | /sys/class/gpio/gpio9/  | MODE7 */
                    0x0d0 0x27 /* P8_35 INPUT PULLDOWN | /sys/class/gpio/gpio8/  | MODE7 */
                    0x0c0 0x27 /* P8_37 INPUT PULLDOWN | /sys/class/gpio/gpio78/ | MODE7 */
                    0x0b8 0x27 /* P8_39 INPUT PULLDOWN | /sys/class/gpio/gpio76/ | MODE7 */
                    0x0b0 0x27 /* P8_41 INPUT PULLDOWN | /sys/class/gpio/gpio74/ | MODE7 */
                    0x0a8 0x27 /* P8_43 INPUT PULLDOWN | /sys/class/gpio/gpio72/ | MODE7 */
                    0x0a0 0x27 /* P8_45 INPUT PULLDOWN | /sys/class/gpio/gpio70/ | MODE7 */
                    0x01c 0x7 /* P8_4  OUTPUT PULLDOWN | /sys/class/gpio/gpio39/ | MODE7 */
                    0x00c 0x7 /* P8_6  OUTPUT PULLDOWN | /sys/class/gpio/gpio35/ | MODE7 */
                    0x094 0x7 /* P8_8  OUTPUT PULLDOWN | /sys/class/gpio/gpio67/ | MODE7 */
                    0x098 0x7 /* P8_10 OUTPUT PULLDOWN | /sys/class/gpio/gpio68/ | MODE7 */
                    0x030 0x7 /* P8_12 OUTPUT PULLDOWN | /sys/class/gpio/gpio44/ | MODE7 */
                    0x028 0x7 /* P8_14 OUTPUT PULLDOWN | /sys/class/gpio/gpio26/ | MODE7 */
                    0x038 0x7 /* P8_16 OUTPUT PULLDOWN | /sys/class/gpio/gpio46/ | MODE7 */
                    0x08c 0x7 /* P8_18 OUTPUT PULLDOWN | /sys/class/gpio/gpio65/ | MODE7 */
                    0x084 0x7 /* P8_20 OUTPUT PULLDOWN | /sys/class/gpio/gpio63/ | MODE7 */
                    0x014 0x7 /* P8_22 OUTPUT PULLDOWN | /sys/class/gpio/gpio37/ | MODE7 */
                    0x004 0x7 /* P8_24 OUTPUT PULLDOWN | /sys/class/gpio/gpio33/ | MODE7 */
                    0x07c 0x7 /* P8_26 OUTPUT PULLDOWN | /sys/class/gpio/gpio61/ | MODE7 */
                    0x0e8 0x7 /* P8_28 OUTPUT PULLDOWN | /sys/class/gpio/gpio88/ | MODE7 */
                    0x0ec 0x7 /* P8_30 OUTPUT PULLDOWN | /sys/class/gpio/gpio89/ | MODE7 */
                    0x0dc 0x7 /* P8_32 OUTPUT PULLDOWN | /sys/class/gpio/gpio11/ | MODE7 */
                    0x0cc 0x7 /* P8_34 OUTPUT PULLDOWN | /sys/class/gpio/gpio81/ | MODE7 */
                    0x0c8 0x7 /* P8_36 OUTPUT PULLDOWN | /sys/class/gpio/gpio80/ | MODE7 */
                    0x0c4 0x7 /* P8_38 OUTPUT PULLDOWN | /sys/class/gpio/gpio79/ | MODE7 */
                    0x0bc 0x7 /* P8_40 OUTPUT PULLDOWN | /sys/class/gpio/gpio77/ | MODE7 */
                    0x0b4 0x7 /* P8_42 OUTPUT PULLDOWN | /sys/class/gpio/gpio75/ | MODE7 */
                    0x0ac 0x7 /* P8_44 OUTPUT PULLDOWN | /sys/class/gpio/gpio73/ | MODE7 */
                    0x0a4 0x7 /* P8_46 OUTPUT PULLDOWN | /sys/class/gpio/gpio71/ | MODE7 */
                >;
            };
        };
    };

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

And this is what my GPIO38 states right after i boot OS and export pin:

cd /sys/class/gpio/gpio38/
root@beaglebone:/sys/class/gpio/gpio38# cat value
1

and my version script:

root@beaglebone:/opt/scripts/tools# ./version.sh
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLT00C02212SBB24899]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-04-06]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot.dts]
kernel:[4.19.94-ti-r42]
nodejs:[v10.15.2]
device-tree-override:[dtb=am335x-boneblack-overlay.dtb]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_addr0=/lib/firmware/TBOX-00A0.dtbo]
uboot_overlay_options:[disable_uboot_overlay_emmc=1]
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]
uboot_overlay_options:[enable_uboot_cape_universal=0]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821]
pkg:[bb-wl18xx-firmware]:[1.20200322.0-0rcnee0~buster+20200322]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.4-git20190227.1-0rcnee0~buster+20190327]
pkg:[firmware-ti-connectivity]:[20190717-2rcnee1~buster+20200305]
groups:[debian : debian adm kmem dialout cdrom floppy audio dip video plugdev users systemd-journal bluetooth netdev i2c gpio pwm eqep remoteproc admin spi iio docker tisdk weston-launch xenomai cloud9ide]
cmdline:[console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet]
dmesg | grep remote
[   35.232339] remoteproc remoteproc0: wkup_m3 is available
[   35.357620] remoteproc remoteproc0: powering up wkup_m3
[   35.357654] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[   35.357954] remoteproc remoteproc0: remote processor wkup_m3 is now up
dmesg | grep pru
dmesg | grep pinctrl-single
[    0.847753] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[    0.849017] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END

and my show-pins.pl:

root@beaglebone:/sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single# /opt/scripts/device/bone/show-pins.pl
P8.25 / eMMC d0                    0  U7 fast rx down 7 gpio 1.00        ocp/helper (pinctrl_tbox_0_pins)
P8.24 / eMMC d1                    1  V7 fast    down 7 gpio 1.01        ocp/helper (pinctrl_tbox_0_pins)
P8.05 / eMMC d2                    2  R8 fast rx down 7 gpio 1.02        ocp/helper (pinctrl_tbox_0_pins)
P8.06 / eMMC d3                    3  T8 fast    down 7 gpio 1.03        ocp/helper (pinctrl_tbox_0_pins)
P8.23 / eMMC d4                    4  U8 fast rx down 7 gpio 1.04        ocp/helper (pinctrl_tbox_0_pins)
P8.22 / eMMC d5                    5  V8 fast    down 7 gpio 1.05        ocp/helper (pinctrl_tbox_0_pins)
P8.03 / eMMC d6                    6  R9 fast rx down 7 gpio 1.06        ocp/helper (pinctrl_tbox_0_pins)
P8.04 / eMMC d7                    7  T9 fast    down 7 gpio 1.07        ocp/helper (pinctrl_tbox_0_pins)
P8.19                              8 U10 fast rx down 7 gpio 0.22        ocp/helper (pinctrl_tbox_0_pins)
P8.13                              9 T10 fast rx down 7 gpio 0.23        ocp/helper (pinctrl_tbox_0_pins)
P8.14                             10 T11 fast    down 7 gpio 0.26        ocp/helper (pinctrl_tbox_0_pins)
P8.17                             11 U12 fast rx down 7 gpio 0.27        ocp/helper (pinctrl_tbox_0_pins)
P8.12                             12 T12 fast    down 7 gpio 1.12        ocp/helper (pinctrl_tbox_0_pins)
P8.11                             13 R12 fast rx down 7 gpio 1.13        ocp/helper (pinctrl_tbox_0_pins)
P8.16                             14 V13 fast    down 7 gpio 1.14        ocp/helper (pinctrl_tbox_0_pins)
P8.15                             15 U13 fast rx down 7 gpio 1.15        ocp/helper (pinctrl_tbox_0_pins)
P9.15                             16 R13 fast rx down 7 gpio 1.16
P9.23                             17 V14 fast rx down 7 gpio 1.17
P9.14                             18 U14 fast rx down 7 gpio 1.18
P9.16                             19 T14 fast rx down 7 gpio 1.19
P9.11                             28 T17 fast rx  up  7 gpio 0.30
P9.13                             29 U17 fast rx  up  7 gpio 0.31
P9.12                             30 U18 fast rx  up  7 gpio 1.28
P8.26                             31  V6 fast    down 7 gpio 1.29        ocp/helper (pinctrl_tbox_0_pins)
P8.21 / eMMC clk                  32  U9 fast rx down 7 gpio 1.30        ocp/helper (pinctrl_tbox_0_pins)
P8.20 / eMMC cmd                  33  V9 fast    down 7 gpio 1.31        ocp/helper (pinctrl_tbox_0_pins)
P9.15                             34 T13 fast rx  up  7 gpio 2.00
P8.18                             35 V12 fast    down 7 gpio 2.01        ocp/helper (pinctrl_tbox_0_pins)
P8.07                             36  R7 fast rx down 7 gpio 2.02        ocp/helper (pinctrl_tbox_0_pins)
P8.08                             37  T7 fast    down 7 gpio 2.03        ocp/helper (pinctrl_tbox_0_pins)
P8.10                             38  U6 fast    down 7 gpio 2.04        ocp/helper (pinctrl_tbox_0_pins)
P8.09                             39  T6 fast rx down 7 gpio 2.05        ocp/helper (pinctrl_tbox_0_pins)
P8.45 / hdmi / sysboot 0          40  R1 fast rx down 7 gpio 2.06        ocp/helper (pinctrl_tbox_0_pins)
P8.46 / hdmi / sysboot 1          41  R2 fast    down 7 gpio 2.07        ocp/helper (pinctrl_tbox_0_pins)
P8.43 / hdmi / sysboot 2          42  R3 fast rx down 7 gpio 2.08        ocp/helper (pinctrl_tbox_0_pins)
P8.44 / hdmi / sysboot 3          43  R4 fast    down 7 gpio 2.09        ocp/helper (pinctrl_tbox_0_pins)
P8.41 / hdmi / sysboot 4          44  T1 fast rx down 7 gpio 2.10        ocp/helper (pinctrl_tbox_0_pins)
P8.42 / hdmi / sysboot 5          45  T2 fast    down 7 gpio 2.11        ocp/helper (pinctrl_tbox_0_pins)
P8.39 / hdmi / sysboot 6          46  T3 fast rx down 7 gpio 2.12        ocp/helper (pinctrl_tbox_0_pins)
P8.40 / hdmi / sysboot 7          47  T4 fast    down 7 gpio 2.13        ocp/helper (pinctrl_tbox_0_pins)
P8.37 / hdmi / sysboot 8          48  U1 fast rx down 7 gpio 2.14        ocp/helper (pinctrl_tbox_0_pins)
P8.38 / hdmi / sysboot 9          49  U2 fast    down 7 gpio 2.15        ocp/helper (pinctrl_tbox_0_pins)
P8.36 / hdmi / sysboot 10         50  U3 fast    down 7 gpio 2.16        ocp/helper (pinctrl_tbox_0_pins)
P8.34 / hdmi / sysboot 11         51  U4 fast    down 7 gpio 2.17        ocp/helper (pinctrl_tbox_0_pins)
P8.35 / hdmi / sysboot 12         52  V2 fast rx down 7 gpio 0.08        ocp/helper (pinctrl_tbox_0_pins)
P8.33 / hdmi / sysboot 13         53  V3 fast rx down 7 gpio 0.09        ocp/helper (pinctrl_tbox_0_pins)
P8.31 / hdmi / sysboot 14         54  V4 fast rx down 7 gpio 0.10        ocp/helper (pinctrl_tbox_0_pins)
P8.32 / hdmi / sysboot 15         55  T5 fast    down 7 gpio 0.11        ocp/helper (pinctrl_tbox_0_pins)
P8.27 / hdmi                      56  U5 fast rx down 7 gpio 2.22        ocp/helper (pinctrl_tbox_0_pins)
P8.29 / hdmi                      57  R5 fast rx down 7 gpio 2.23        ocp/helper (pinctrl_tbox_0_pins)
P8.28 / hdmi                      58  V5 fast    down 7 gpio 2.24        ocp/helper (pinctrl_tbox_0_pins)
P8.30 / hdmi                      59  R6 fast    down 7 gpio 2.25        ocp/helper (pinctrl_tbox_0_pins)
P9.22 / spi boot clk              84 A17 fast rx  up  7 gpio 0.02
P9.21 / spi boot in               85 B17 fast rx  up  7 gpio 0.03
P9.18 / spi boot out              86 B16 fast rx  up  7 gpio 0.04
P9.17 / spi boot cs               87 A16 fast rx  up  7 gpio 0.05
P9.42a                            89 C18 fast rx down 7 gpio 0.07
P9.20 / cape i²c sda             94 D18 fast rx  up  3 i²c 2 sda       ocp/P9_20_pinmux (pinmux_P9_20_default_pin)
P9.19 / cape i²c scl             95 D17 fast rx  up  3 i²c 2 scl       ocp/P9_19_pinmux (pinmux_P9_19_default_pin)
P9.26                             96 D16 fast rx  up  7 gpio 0.14
P9.24                             97 D15 fast rx  up  7 gpio 0.15
P9.31 / hdmi audio clk           100 A13 fast rx down 7 gpio 3.14
P9.29 / hdmi audio fs            101 B13 fast rx down 7 gpio 3.15
P9.30                            102 D12 fast rx down 7 gpio 3.16
P9.28 / hdmi audio data          103 C12 fast rx down 7 gpio 3.17
P9.42b                           104 B12 fast rx down 7 gpio 3.18
P9.27                            105 C13 fast rx down 7 gpio 3.19
P9.41                            106 D13 fast rx down 7 gpio 3.20
P9.25 / audio osc                107 A14 fast rx down 7 gpio 3.21
P9.41 / jtag emu3                109 D14 fast rx down 7 gpio 0.20

OK, looking at the schematic GPIO1_0 - GPIO1_7 are connected to the eMMC chip. You are not going to be able to use them as GPIO pins. the show-pins.pl is telling you that, they are used by eMMC.

Potentially if you are booting from SD, then you might be able to hold the eMMC reset pin low and use the pins as GPIO if you disable MMC in your devicetree.

If you need lots of I/O and are not using the LCD interface, that is 20 I/O pins right there.

Alternatively you could use some I2C I/O expander chips.

O wow, OK. I really hoped that if i disable mmc overlay (as i do boot and operate of SD card) i will use entire header by just putting:
uboot_overlay_options:[disable_uboot_overlay_emmc=1]

So to keep reset pin low i assume just connect that Reset PIN to the GND right? But by looking at headers overview (google) i dont see any EMMC pin described as Reset? Would you be able to guide me with that. Sorry if i am overlooking something obvious … just really newbie to the BBB

disable_uboot_overlay_emmc=1 probably just stops uboot from trying to boot from emmc. U-boot may still configure the pins as emmc pins. You may also need to disable the eMMC in the BBB dts file. I don’t know if it is an overlay and the disable_uboot_overlay_emmc prevents it from loading, but as the pin stays high, I would suspect the peripheral is still being enabled. The last time I looked at the BBB dts files, the eMMC was in and enabled by default. Of course that might have changed, @RobertCNelson will be able to tell you for sure.

If you need a lot of IO and the LCD i/os are not an option, I would go with an I2C I/O expander. You can find some cheap Arduino based boards. That will give you plenty of I/O and also give you some protection for the BBB in case you stick a high voltage on an I/O pin.

If you go the I2C route, make sure you get one without I2C pull-ups on the SDA and SDCLK lines if it is 5V only, you can then add your own pull up resistors to 3.3V and it will work. Handy if you need to interface to 5V systems.

I don’t see anything out of the ordinary…

enable_uboot_cape_universal=0 → still enables it, only way to ‘disable’ it is to not set the variable…

#enable_uboot_cape_universal=1

Can you share your serial boot log over J1?

Something fishy is happening on your eMMC pins, ps some models or eMMC used over the years don’t properly disable…

Regards,

@RobertCNelson would I be correct in assuming that the internal boot ROM will still enable the eMMC pins and try to talk with it, as it is set as the boot device.

If using those lines for something else, then at power up you may get some activity on the eMMC lines for a brief period while the boot ROM tries to find a device.

Thank you, commented this line but no cigar. Still 1 at P8_03.
This is quite new purchase (2/3 months ago with newest Debian). How can i get this “serial boot log over J1” ?

You can plug any of these adapters into J1…

https://elinux.org/Beagleboard:BeagleBone_Black_Serial

Regards,

1 Like

Thanks, will order one shortly.
For now i tried installing Debian 11.3 and here surprise i do get 0. So it doesnt seem to be beaglebone related but debian related.

Anyways, here’s another surprise…
My P8 header:

P8.25 / eMMC d0                    0  U7 fast rx      7 gpio 1.00        ocp/helper (pinmux_tbox_pins)
P8.24 / eMMC d1                    1  V7 fast     up  7 gpio 1.01        ocp/helper (pinmux_tbox_pins)
P8.05 / eMMC d2                    2  R8 fast rx      7 gpio 1.02        ocp/helper (pinmux_tbox_pins)
P8.06 / eMMC d3                    3  T8 fast     up  7 gpio 1.03        ocp/helper (pinmux_tbox_pins)
P8.23 / eMMC d4                    4  U8 fast rx      7 gpio 1.04        ocp/helper (pinmux_tbox_pins)
P8.22 / eMMC d5                    5  V8 fast     up  7 gpio 1.05        ocp/helper (pinmux_tbox_pins)
P8.03 / eMMC d6                    6  R9 fast rx      7 gpio 1.06        ocp/helper (pinmux_tbox_pins)
P8.04 / eMMC d7                    7  T9 fast     up  7 gpio 1.07        ocp/helper (pinmux_tbox_pins)
P8.19                              8 U10 fast rx      7 gpio 0.22        ocp/helper (pinmux_tbox_pins)
P8.13                              9 T10 fast rx      7 gpio 0.23        ocp/helper (pinmux_tbox_pins)
P8.14                             10 T11 fast     up  7 gpio 0.26        ocp/helper (pinmux_tbox_pins)
P8.17                             11 U12 fast rx      7 gpio 0.27        ocp/helper (pinmux_tbox_pins)
P8.12                             12 T12 fast     up  7 gpio 1.12        ocp/helper (pinmux_tbox_pins)
P8.11                             13 R12 fast rx      7 gpio 1.13        ocp/helper (pinmux_tbox_pins)
P8.16                             14 V13 fast     up  7 gpio 1.14        ocp/helper (pinmux_tbox_pins)
P8.15                             15 U13 fast rx      7 gpio 1.15        ocp/helper (pinmux_tbox_pins)
P8.26                             31  V6 fast     up  7 gpio 1.29        ocp/helper (pinmux_tbox_pins)
P8.21 / eMMC clk                  32  U9 fast rx      7 gpio 1.30        ocp/helper (pinmux_tbox_pins)
P8.20 / eMMC cmd                  33  V9 fast     up  7 gpio 1.31        ocp/helper (pinmux_tbox_pins)
P8.18                             35 V12 fast     up  7 gpio 2.01        ocp/helper (pinmux_tbox_pins)
P8.07                             36  R7 fast rx      7 gpio 2.02        ocp/helper (pinmux_tbox_pins)
P8.08                             37  T7 fast     up  7 gpio 2.03        ocp/helper (pinmux_tbox_pins)
P8.10                             38  U6 fast     up  7 gpio 2.04        ocp/helper (pinmux_tbox_pins)
P8.09                             39  T6 fast rx      7 gpio 2.05        ocp/helper (pinmux_tbox_pins)
P8.45 / hdmi / sysboot 0          40  R1 fast rx down 7 gpio 2.06        ocp/P8_45_pinmux (pinmux_P8_45_default_pin)
P8.46 / hdmi / sysboot 1          41  R2 fast rx down 7 gpio 2.07        ocp/P8_46_pinmux (pinmux_P8_46_default_pin)
P8.43 / hdmi / sysboot 2          42  R3 fast rx down 7 gpio 2.08        ocp/P8_43_pinmux (pinmux_P8_43_default_pin)
P8.44 / hdmi / sysboot 3          43  R4 fast rx down 7 gpio 2.09        ocp/P8_44_pinmux (pinmux_P8_44_default_pin)
P8.41 / hdmi / sysboot 4          44  T1 fast rx down 7 gpio 2.10        ocp/P8_41_pinmux (pinmux_P8_41_default_pin)
P8.42 / hdmi / sysboot 5          45  T2 fast rx down 7 gpio 2.11        ocp/P8_42_pinmux (pinmux_P8_42_default_pin)
P8.39 / hdmi / sysboot 6          46  T3 fast rx down 7 gpio 2.12        ocp/P8_39_pinmux (pinmux_P8_39_default_pin)
P8.40 / hdmi / sysboot 7          47  T4 fast rx down 7 gpio 2.13        ocp/P8_40_pinmux (pinmux_P8_40_default_pin)
P8.37 / hdmi / sysboot 8          48  U1 fast rx down 7 gpio 2.14        ocp/P8_37_pinmux (pinmux_P8_37_default_pin)
P8.38 / hdmi / sysboot 9          49  U2 fast rx down 7 gpio 2.15        ocp/P8_38_pinmux (pinmux_P8_38_default_pin)
P8.36 / hdmi / sysboot 10         50  U3 fast rx down 7 gpio 2.16        ocp/P8_36_pinmux (pinmux_P8_36_default_pin)
P8.34 / hdmi / sysboot 11         51  U4 fast     up  7 gpio 2.17        ocp/helper (pinmux_tbox_pins)
P8.35 / hdmi / sysboot 12         52  V2 fast rx down 7 gpio 0.08        ocp/P8_35_pinmux (pinmux_P8_35_default_pin)
P8.33 / hdmi / sysboot 13         53  V3 fast rx      7 gpio 0.09        ocp/helper (pinmux_tbox_pins)
P8.31 / hdmi / sysboot 14         54  V4 fast rx      7 gpio 0.10        ocp/helper (pinmux_tbox_pins)
P8.32 / hdmi / sysboot 15         55  T5 fast     up  7 gpio 0.11        ocp/helper (pinmux_tbox_pins)
P8.27 / hdmi                      56  U5 fast rx      7 gpio 2.22        ocp/helper (pinmux_tbox_pins)
P8.29 / hdmi                      57  R5 fast rx      7 gpio 2.23        ocp/helper (pinmux_tbox_pins)
P8.28 / hdmi                      58  V5 fast     up  7 gpio 2.24        ocp/helper (pinmux_tbox_pins)
P8.30 / hdmi                      59  R6 fast     up  7 gpio 2.25        ocp/helper (pinmux_tbox_pins)

As you can see one of my pins was set up as output with pull up - Let’s take P8.12 as an example since it’s not used by anything… Line above states P8.12 receiver not enabled, pull up enabled, mode 7.

Now we go to /sys/class/gpio/gpio44 and do:

root@beaglebone:/sys/class/gpio/gpio44# cat direction
in

I expected that if i create overlays, my gpio44 will default to out. Obviously i can change it with echo ‘out’ > direction but am i missing something?