This is how to set say P2_18 as an output and high.
debian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -q P2.18
P2_18 Mode: gpio Direction: in Value: 0
debian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin P2.18 gpio
debian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin P2.18 out
debian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin P2.18 hi
debian@beaglebone:~$ /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -q P2.18
P2_18 Mode: gpio Direction: out Value: 1
I don’t think the /usr/bin/config-pin tool can do this.
Cheers,
Jon
Hi Jon!
I upgraded the kernel to the same version as you have.
This is the output:
root@beaglebone:~# /opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -q P2_18
P2_18 pinmux file not found!
Cannot read pinmux file: /sys/devices/platform/ocp/ocp*P2_18_pinmux/state
Still not working. In uEnv.txt file, I have this added:
uboot_overlay_addr6=/lib/firmware/PB-MCP2515-SPI1.dtbo
This is the MCP2515 which could read the SWCAN bus if it was set to HIGH.
jonn...@gmail.com a következőt írta (2020. október 19., hétfő, 3:32:13 UTC+2):
If you look at the P2_18 define, do you see a state listed?
Ex:
debian@beaglebone:~$ ls -lt /sys/devices/platform/ocp/ocp:P2_18_pinmux/state
-rw-rw-r-- 1 root gpio 4096 Oct 19 07:17 /sys/devices/platform/ocp/ocp:P2_18_pinmux/state
I have no other overlays enabled, so perhaps try removing what you have enabled and then see if the config-pin tool will work. Perhaps something in the overlay is over writing the pinmux config:
This is my config:
debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh
[sudo] password for debian:
git:/opt/scripts/:[20c080bc91f243ef852a704758788a31083b0f9e]
eeprom:[A335PBGL00A21750EPB01280]
model:[TI_AM335x_PocketBeagle]
dogtag:[BeagleBoard.org Debian Buster IoT Image 2020-08-25]
bootloader:[microSD]:[/dev/mmcblk0]:[U-Boot 2019.04-00002-gc9b3922522]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-pocketbeagle.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-ADC-00A0]
kernel:[4.19.94-ti-r51]
nodejs:[v10.21.0]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=1]
uboot_overlay_options:[uboot_overlay_pru=AM335X-PRU-RPROC-4-19-TI-00A0.dtbo]
uboot_overlay_options:[enable_uboot_cape_universal=1]
pkg check: to individually upgrade run: [sudo apt install --only-upgrade ]
Cheers,
Jon
It looks like P2_18 and P2_06 are being disabled in PB-MCP2515-SPI1 to prevent a driver load but I suppose this is by design.
/opt/source/bb.org-overlays/src/arm/PB-MCP2515-SPI1.dts
fragment@1 {
target = <&ocp>;
overlay {
P2_25_pinmux { status = “disabled”; }; /* SPI1 MOSI - gpio1_9 /
P2_27_pinmux { status = “disabled”; }; / SPI1 MISO - gpio1_8 /
P2_29_pinmux { status = “disabled”; }; / SPI1 CLK - gpio0_7 /
P2_30_pinmux { status = “disabled”; }; / SPI1 CS0 - gpio3_17 /
P2_31_pinmux { status = “disabled”; }; / SPI1 CS1 - gpio0_19 /
P2_08_pinmux { status = “disabled”; }; / SWC nINT /
P2_32_pinmux { status = “disabled”; }; / SWC nRESET /
P2_06_pinmux { status = “disabled”; }; / SWC M0 /
P2_18_pinmux { status = “disabled”; }; / SWC M1 */
};
}
Have you looked at this older issue posting for PB-MCP2515-SPI1? Perhaps this will help.
https://gist.github.com/pdp7/e0dcfaca4e478be000987fb0105f2560
Jon