工具与软件:
开发环境 :
- SOM: SOM
- 基本 Yocto 图像: am62-Yocto-kirkstone-6.1.83_09.02.01.10-v1.1
- 基本设备树: k3-am625-var-som-symphony.dts
我们正在尝试将 GPIO0_23和 GPIO0_24 (连接器 J18的引脚7和9)配置为输出引脚。 这2个引脚在 Symphony board DTS (k3-am625-var-som-symphony.dts)中配置为 UART2。 我们已删除该配置并按如下所示配置为 GPIO:
&main_pmx0{
+ 状态="正常";
+ pinctrl-names ="默认值";
+ pinctrl-0 =<&DISPLAY_PINS_DEFAULT>;
+
+ display_pins_default:display-default-pins {
PINCTL-SINGLE、PINS =<
+ AM62X_IOPAD (0x005c、PIN_OUTPUT_PULLUP、7)/*(R24) GPMC0_AD8.GPIO0_23 */
+ AM62X_IOPAD (0x0060、PIN_OUTPUT_PULLUP、7)/*(R25) GPMC0_AD9.GPIO0_24 */
+ >;
};
已删除配置:
- main_uart2_pins_default:main-uart2-pins-default {
- pinctrl-single、pins =<
- AM62X_IOPAD (0x005c、PIN_INPUT_PULLUP、2)/*(R24) GPMC0_AD8.UART2_RXD */
- AM62X_IOPAD (0x0060、PIN_OUTPUT、2)/*(R25) GPMC0_AD9.UART2_TXD */
- >;
- };
但我们无法将这些引脚作为 GPIO 输出操作。 我们使用 libgpiod 命令进行了验证。 我们已将这些引脚配置为"PIN_OUTPUT_PULLUP"、但 默认情况下、万用表上的 GPIO0_23测量0V、GPIO0_24测量3.3V。 (连接器 J18的引脚7和9)
如果我们将引脚 GPIO0_24设置为"0"、则不会看到它变为0V。 同样、如果我们将引脚 GPIO0_23设置为"1"、则不会看到它达到3.3V。
以下是命令日志:
root@am62x-var-som:~# cd /sys/class/gpio
root@am62x-var-som:/sys/class/gpio ls -l
总计0
"啊啊啊! 1根根号4096 4月28日 导出
lrwxrwxrwx 1根根 0 Apr 28 2022 gpiochip360 ->../../devices/platform/bus@f0000/20000000.i2c/i2c-0/0-0020/gpio/gpiochip360
lrwxrwxrwx 1根根 0 Apr 28 2022 gpiochip368 ->../../devices/platform/bus@f0000/601000.gpio/gpiochip368
lrwxrwxrwx 1根根 0 Apr 28 2022 gpiochip420 ->../../devices/platform/bus@f0000/6000.gpio/gpiochip420
"啊啊啊! 1根根号4096 Apr 28 2022未导出
root@am62x-var-som:/sys/class/gpio echo 443 > export
root@am62x-var-som:/sys/class/gpio echo 444 > export
root@am62x-var-som:/sys/class/gpio echo out > gpio443/direction
root@am62x-var-som:/sys/class/gpio echo out > gpio444/direction
root@am62x-var-som:/sys/class/gpio echo 1 > gpio443/value
root@am62x-var-som:/sys/class/gpio echo 1 > gpio444/value
root@am62x-var-som:/sys/class/gpio echo 0 > gpio443/value
root@am62x-var-som:/sys/class/gpio echo 0 > gpio444/value
为了验证 pinctrl 配置、我们尝试使用相似的配置将不同的引脚- GPIO1_51 (J3的引脚18)配置为 GPIO 输出(删除了作为 J1.82-USB#A_HOST_PWR 的现有配置)、并且运行正常。
+ AM62X_IOPAD (0x0258、PIN_OUTPUT_PULLUP、7)/*(F18) USB1_DRVVBUS.GPIO1_51 */
- MAIN_USB1_PINS_DEFAULT:MAIN-USB1-PINS-DEFAULT {
- pinctrl-single、pins =<
- AM62X_IOPAD (0x0258、PIN_OUTPUT、0)/*(F18) USB1_DRVVBUS */
- >;
- };
这2个引脚是否需要配置为 GPIO 引脚、或者缺少某些配置?


