启用BeagleBone上的所有GPIO引脚,包括eMMC引脚

问题描述 投票:1回答:4

我在BeagleBone Green上运行Debian Jessie IOT图像。我喜欢使用最多的GPIO,根据文档应该给我65个GPIO。 GPIOs on BeagleBone Green

除与eMMC共享的引脚外的所有工作:P8_3-6,P8_20-25

这样可行:

config-pin -a P8_7 in+

这不起作用:

config-pin -a P8_22 in+

bash: /sys/devices/platform/ocp/ocp*P8_22_pinmux/state: No such file or directory 
Cannot write pinmux file: /sys/devices/platform/ocp/ocp*P8_22_pinmux/state

一些信息.....

root@beaglebone:~# cat /sys/devices/platform/bone_capemgr/slots
0: PF----  -1
1: PF----  -1
2: PF----  -1
3: PF----  -1
4: P-O-L-   0 Override Board Name,00A0,Override Manuf,cape-universala

cape-universala应该导出dmesg中的所有引脚....

 [    4.002843] pinctrl-single 44e10800.pinmux: pin 44e10814.0 already requested by 481d8000.mmc; cannot claim for ocp:P8_22_pinmux
 [    4.014528] pinctrl-single 44e10800.pinmux: pin-5 (ocp:P8_22_pinmux) status -22
 [    4.021901] pinctrl-single 44e10800.pinmux: could not request pin 5 (44e10814.0) from group pinmux_P8_22_default_pin  on device pinctrl-single
 [    4.034756] bone-pinmux-helper ocp:P8_22_pinmux: Error applying setting, reverse things back
 [    4.089416] pinctrl-single 44e10800.pinmux: pin 44e10814.0 already requested by 481d8000.mmc; cannot claim for ocp:P8_22_pinmux
 [    4.101069] pinctrl-single 44e10800.pinmux: pin-5 (ocp:P8_22_pinmux) status -22

我似乎无法禁用eMMC,这是/boot/uEnv.txt

  cmdline=coherent_pool=1M net.ifnames=0 quiet cape_enable=bone_capemgr.enable_partno=cape-universala cape_disable=bone_capemgr.disable_partno=BB-BONE-EMMC-2G

我从SD卡启动BeagleBone,因此不必使用eMMC。

怎么了?

debian beagleboneblack gpio beagleboard
4个回答
1
投票

目录,我相信你熟悉/这个程序,/ boot里面有一个名为uEnv.txt的文件。

有一种较旧的方式来调整设置,它可能仍然适用。将eMMC部分取消注释到uEnv.txt文件的注释应用程序应该允许您使用这些特定的引脚。

现在......请听。

之前我已经完成了这项工作,并且在取消注释后无法从我的eMMC启动,删除#mark,eMMC。我知道你正在使用SD卡。我可以快速测试它并回复你。

我只是想让你知道这存在,并且uboot覆盖在较新的Debian图像中是现在所做的。所以,我很确定我们不会在特定的Debian Distros上使用设备树覆盖。我想这一切都取决于你拥有的内核以及你在机器上启动的图像。

嗯...我现在已经插入了我的机器,在我更改了我的/ boot目录文件uEnv.txt以取消注释eMMC部分到文件后,我即将测试SD卡支持。我在我的机器上使用Linux beaglebone 4.4.91-ti-r136以获得与Adafruit_BBIO的PWM的兼容性。

在该文件中,/ boot目录中的uEnv.txt文件,我必须取消注释此部分:disable_uboot_overlay_emmc = 1。

我即将重启。

好的...我能够启动w /取消注释disable_uboot_overlay_emmc = 1部分到uEnv.txt文件。

这应该打开引脚。我会很快测试它。

赛斯

附: https://github.com/mvduin/bbb-pin-utils是一个很好的实用程序,用于显示可用的引脚。

This is the photo of my print out using that utility for the pins.


1
投票

我发现我很努力......这是如何使用所有可用的GPIO引脚:

  root@beaglebone:~# more /boot/uEnv.txt | grep -v '#'
  uname_r=4.4.91-ti-r133
  dtb=am335x-boneblack-overlay.dtb
  cmdline=coherent_pool=1M net.ifnames=0 quiet

而已!


1
投票

最新图片,uname:4.9.78-ti-r94并忽略所有重叠内容

为了获得全新的图像,我通过更改uEnv启用了Rail上的所有GPIO:P8和P9。请参阅#mco评论。这是唯一的变化

#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.4.x-ti kernel)
### mco-mco

# uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-4-TI-00A0.dtbo

###pru_uio (4.4.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 quiet omap_wdt.nowayout=0

#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

##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
#cape_enable=bone_capemgr.enable_partno=

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

# mco-mco
### optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
### optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

#dtb=am335x-boneblack-emmc-overlay.dtb

然后我在启动时执行一个脚本来“揭穿”pwm的系统文件,这些文件可以在重新启动之间切换。该脚本生成/ tmp / gpiossetup并正确对齐pwm引脚。

#!/bin/bash
ERRORF=/tmp/pwmerrors.txt
PWMF=/tmp/pwmsetup
[[ -f $PWMF ]] && exit
echo > $PWMF
sync
pushd /sys/class/pwm
idx=0
pwms=(20000     20000    20000    20000    20000    20000    20000)
dutys=( 0       0        0        0        0        0        0)
expo=(  0       1        0        1        0        1        0)
right=(48302200 48302200 48300100 48300200 48300200 48304200 48304200)
for p in P9.14  P9.16    P9.42    P9.21    P9.22    P8.13    P8.19;do
    config-pin $p pwm
    for link in $(ls -l | awk '{print $11}');do
        if [[ $link =~ ${right[$idx]} ]];then
            #echo $link
            #echo "sys folder for $p is $(echo $link | awk -F '/' '{print $NF}')"
            sysfld=$(echo $link | awk -F '/' '{print $NF}')
            pushd $sysfld
                echo ">"$(pwd)   exporting: ${expo[$idx]}"<"
                ex=${expo[$idx]}
                echo $ex > unexport
        sync
                echo $ex > export
                if [[ -d "pwm$ex" ]];then
                    echo $(pwd) $p  $ex >> $PWMF
                    echo ${pwms[$idx]} > "pwm$ex/period"
                    echo ${dutys[$idx]} > "pwm$ex/duty_cycle"
                    echo "1" > "pwm${ex}/enable"
                    #echo $(pwd)/pwm$ex/
                else
                    echo "? cannot export ($pwd)" >> $ERRORF
                fi
            popd
        fi
        sleep 0.2
    done
    idx=$((idx+1))
    sleep 0.2
done
popd

1
投票

只需在/boot/uEnv.txt中的行下方取消注释并重新启动即可。

#disable_uboot_overlay_emmc=1

disable_uboot_overlay_emmc=1

这将禁用emmc并释放为emmc分配的所有引脚。请注意,您已从SD卡运行beaglebone。

© www.soinside.com 2019 - 2024. All rights reserved.