Hi all,
I’m newer to using Linux and Beaglebone as a whole. I am trying to just use the basic config-pin utility to set gpios and I keep keetign the above error.
I’ve done a bit of research here and elsewhere and I’m unable to find an exact solution to this.
My /boot/uEnv.txt is as follows:
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0
uname_r=4.19.94-ti-r42
#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/<file4>.dtbo
#uboot_overlay_addr5=/lib/firmware/<file5>.dtbo
#uboot_overlay_addr6=/lib/firmware/<file6>.dtbo
#uboot_overlay_addr7=/lib/firmware/<file7>.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.14.x-ti kernel)
#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.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=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet
#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet video=HDMI-A-1:1024x768@60e
##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh
I was tinkering around with i2c and spi earlier, and setting pins to those states works just fine. It’s specifically the setting a pin high or low that is causing issues.
P8_33 is hdmi, i see you have it disabled…
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1
disable_uboot_overlay_wireless=1
disable_uboot_overlay_adc=1
Please run and report the output of:
sudo /opt/scripts/tools/version.sh
Regards,
Thanks for the fast reply. unfortunately it’s not pin specific, it seems to be the entirety of setting gpios
version.sh:
debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh
[sudo] password for debian:
git:/opt/scripts/:[b39ec679648a6be8f25f48bd1c9784c1fc5a0c46]
eeprom:[A335BNLT00C02125SBB08079]
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]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2019.04-00002-g07d5700e21]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[AM335X-PRU-RPROC-4-19-TI-00A0]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0.bb.org-overlays]
kernel:[4.19.94-ti-r42]
nodejs:[v10.15.2]
/boot/uEnv.txt Settings:
uboot_overlay_options:[enable_uboot_overlays=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:[uboot_overlay_pru=/lib/firmware/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 <pkg>]
pkg:[bb-cape-overlays]:[4.14.20210821.0-0~buster+20210821]
pkg:[bb-wl18xx-firmware]:[1.20211222.2-0~buster+20211222]
pkg:[kmod]:[26-1]
pkg:[librobotcontrol]:[1.0.5-git20200715.0-0~buster+20200716]
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
[ 51.104280] remoteproc remoteproc0: wkup_m3 is available
[ 51.242998] remoteproc remoteproc0: powering up wkup_m3
[ 51.243025] remoteproc remoteproc0: Booting fw image am335x-pm-firmware.elf, size 217168
[ 51.250885] remoteproc remoteproc0: remote processor wkup_m3 is now up
[ 53.939817] remoteproc remoteproc1: 4a334000.pru is available
[ 53.963840] remoteproc remoteproc2: 4a338000.pru is available
dmesg | grep pru
[ 53.939817] remoteproc remoteproc1: 4a334000.pru is available
[ 53.940018] pru-rproc 4a334000.pru: PRU rproc node pru@4a334000 probed successfully
[ 53.963840] remoteproc remoteproc2: 4a338000.pru is available
[ 53.964004] pru-rproc 4a338000.pru: PRU rproc node pru@4a338000 probed successfully
dmesg | grep pinctrl-single
[ 0.945258] pinctrl-single 44e10800.pinmux: 142 pins, size 568
dmesg | grep gpio-of-helper
[ 0.958686] gpio-of-helper ocp:cape-universal: ready
lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
END
Additional context, ls of the sys/devices/platform/ocp shows plenty of pinmuxs
debian@beaglebone:~$ ls /sys/devices/platform/ocp/
40300000.ocmcram 481d0000.can ocp:P8_14_pinmux ocp:P9_12_pinmux
44e07000.gpio 481d8000.mmc ocp:P8_15_pinmux ocp:P9_13_pinmux
44e09000.serial 48300000.epwmss ocp:P8_16_pinmux ocp:P9_14_pinmux
44e0b000.i2c 48302000.epwmss ocp:P8_17_pinmux ocp:P9_15_pinmux
44e35000.wdt 48304000.epwmss ocp:P8_18_pinmux ocp:P9_16_pinmux
44e3e000.rtc 48310000.rng ocp:P8_19_pinmux ocp:P9_17_pinmux
47400000.usb 49000000.edma ocp:P8_26_pinmux ocp:P9_18_pinmux
48022000.serial 49800000.tptc ocp:P8_27_pinmux ocp:P9_19_pinmux
48024000.serial 49900000.tptc ocp:P8_28_pinmux ocp:P9_20_pinmux
4802a000.i2c 49a00000.tptc ocp:P8_29_pinmux ocp:P9_21_pinmux
48030000.spi 4a100000.ethernet ocp:P8_30_pinmux ocp:P9_22_pinmux
48042000.timer 4a326004.pruss-soc-bus ocp:P8_31_pinmux ocp:P9_23_pinmux
48044000.timer 4c000000.emif ocp:P8_32_pinmux ocp:P9_24_pinmux
48046000.timer 53100000.sham ocp:P8_33_pinmux ocp:P9_25_pinmux
48048000.timer 53500000.aes ocp:P8_34_pinmux ocp:P9_26_pinmux
4804a000.timer 56000000.sgx ocp:P8_35_pinmux ocp:P9_27_pinmux
4804c000.gpio driver_override ocp:P8_36_pinmux ocp:P9_28_pinmux
48060000.mmc modalias ocp:P8_37_pinmux ocp:P9_29_pinmux
480c8000.mailbox ocp:A15_pinmux ocp:P8_38_pinmux ocp:P9_30_pinmux
480ca000.spinlock ocp:cape-universal ocp:P8_39_pinmux ocp:P9_31_pinmux
4819c000.i2c ocp:l4_wkup@44c00000 ocp:P8_40_pinmux ocp:P9_41_pinmux
481a0000.spi ocp:P8_07_pinmux ocp:P8_41_pinmux ocp:P9_42_pinmux
481a6000.serial ocp:P8_08_pinmux ocp:P8_42_pinmux ocp:P9_91_pinmux
481a8000.serial ocp:P8_09_pinmux ocp:P8_43_pinmux ocp:P9_92_pinmux
481aa000.serial ocp:P8_10_pinmux ocp:P8_44_pinmux of_node
481ac000.gpio ocp:P8_11_pinmux ocp:P8_45_pinmux power
481ae000.gpio ocp:P8_12_pinmux ocp:P8_46_pinmux subsystem
481cc000.can ocp:P8_13_pinmux ocp:P9_11_pinmux uevent
B_Kirsch:
ocp:P8_33_pinmux
so it’s there…
i wonder if there is a mismatch between config-pin and the linux kernel version?
Which version of config-pin are you using the shell script or the c based project?
the shell version. I’m currently connected through PuTTY
testing on my board…
P8_33 for example…
debian@bbb-pwr01-ser09:/sys/devices/platform/ocp/ocp:P8_33_pinmux$ uname -r
4.19.94-ti-r73
debian@bbb-pwr01-ser09:/sys/devices/platform/ocp/ocp:P8_33_pinmux$ cat state
default
debian@bbb-pwr01-ser09:/sys/devices/platform/ocp/ocp:P8_33_pinmux$ cat of_node/pinctrl-names
default�gpio�gpio_pu�gpio_pd�eqep
default
gpio
gpio_pu
gpio_pd
eqep
debian@bbb-pwr01-ser09:/sys/devices/platform/ocp/ocp:P8_33_pinmux$ echo gpio_pu > state
debian@bbb-pwr01-ser09:/sys/devices/platform/ocp/ocp:P8_33_pinmux$ cat state
gpio_pu
debian@bbb-pwr01-ser09:/sys/devices/platform/ocp/ocp:P8_33_pinmux$
Regards,
Trying this command results in this:
/sys/devices/platform/ocp/ocp:P8_33_pinmux$ uname -r
-bash: /sys/devices/platform/ocp/ocp:P8_33_pinmux$: No such file or directory
Oh, something is strange…
debian@bbb-pwr01-ser09:/sys/devices/platform/ocp/ocp:P8_33_pinmux$ uname -r
4.19.94-ti-r73
debian@bbb-pwr01-ser09:/sys/devices/platform/ocp/ocp:P8_33_pinmux$ which uname
/bin/uname
Something is messed up…
I’d re-flash: https://forum.beagleboard.org/tag/latest-images
Regards,
This should be a fresh install off a SD card. I can try a reflash
Same issue with a fresh out-of-the-box beaglebone as well.
Can you please share your shell script or list of commands you are running?
Regards,
literally just “config-pin p8.33 gpio”
followed by “config-pin p8.33 1”
B_Kirsch:
config-pin p8.33 1
Thanks, confirmed…
debian@bbb-pwr01-ser09:~$ config-pin p8.33 gpio
Current mode for P8_33 is: gpio
debian@bbb-pwr01-ser09:~$ config-pin p8.33 1
ERROR: write() to /sys/devices/platform/ocp/ocp:P8_33_pinmux/state failed, No such device
debian@bbb-pwr01-ser09:~$ config-pin --help
GPIO Pin Configurator
Usage: config-pin -c <filename>
config-pin -l <pin>
config-pin -q <pin>
config-pin <pin> <mode>
I’ve also tried “config-pin p8.33 gpio 1” and other variations but it just kicks back with the -h information
The C-based config-pin doesn’t support 0/1… mode has to be one of the P8.33…
default
gpio
gpio_pu
gpio_pd
eqep
The “old” config-pin shell script:
supports:
# Configure a pin as gpio output and setting the state
config-pin P8.07 hi
config-pin P8.07 low
But it’s an un-maintainable mess, vs the c based parser…
// BeagleBone GPIO Pin Configurator
// Compatible with the config-pin script available elsewhere
// Copyright (C)2018, Philip Munts, President, Munts AM Corp.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
This file has been truncated. show original
Regards,
interesting.
so the preferred way to control the pins direction and things would be to write directly to the files? which directory should I be looking in to write that?
B_Kirsch:
config-pin p8.33 gpio 1
config-pin p8.33 gpio
echo out > /sys/class/gpio/gpio9/direction
echo 1 > /sys/class/gpio/gpio9/value
testing…
debian@bbb-pwr01-ser09:~$ gpioinfo
gpiochip0 - 32 lines:
line 0: "MDIO_DATA" unused input active-high
line 1: "MDIO_CLK" unused input active-high
line 2: "SPI0_SCLK" "P9_22" input active-high [used]
line 3: "SPI0_D0" "P9_21" input active-high [used]
line 4: "SPI0_D1" "P9_18" input active-high [used]
line 5: "SPI0_CS0" "P9_17" input active-high [used]
line 6: "SPI0_CS1" "cd" input active-low [used]
line 7: "ECAP0_IN_PWM0_OUT" "P9_42" input active-high [used]
line 8: "LCD_DATA12" "P8_35" input active-high [used]
line 9: "LCD_DATA13" "P8_33" input active-high [used]
0 9
debian@bbb-pwr01-ser09:~$ cd /sys/class/gpio/gpio9/
debian@bbb-pwr01-ser09:/sys/class/gpio/gpio9$ ls
active_low device direction edge label power subsystem uevent value
debian@bbb-pwr01-ser09:/sys/class/gpio/gpio9$ cat label
P8_33
debian@bbb-pwr01-ser09:/sys/class/gpio/gpio9$ cat direction
in
debian@bbb-pwr01-ser09:/sys/class/gpio/gpio9$ echo out > direction
debian@bbb-pwr01-ser09:/sys/class/gpio/gpio9$ cat value
0
debian@bbb-pwr01-ser09:/sys/class/gpio/gpio9$ echo 1 > value
debian@bbb-pwr01-ser09:/sys/class/gpio/gpio9$ cat value
Regards,
I will try and report back. thank you for your help. hours of searching on the internet just had me bouncing around through the ancient forum posts that used the old shell script
ok, I’ve got the same replicated on my device. I’ll go check with the multimeter and report back
EDIT since I’ve apparently maxed out my replies for a “first day user”:
Success! Thanks for the help.