1、根节点增加
cpuled {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_cpuled>;
led0: cpu {
label = "cpu";
gpios = <&gpio5 3 GPIO_ACTIVE_LOW>;
default-state = "on";
linux,default-trigger = "heartbeat";//默认的触发源为心跳
};
};
其中compatible属性为 “gpio-leds”,测试改为其他值无效
linux,default-trigger = “heartbeat”;
2、在&iomuxc节点增加
pinctrl_cpuled: ledgrp {
fsl,pins = <
MX6ULL_PAD_SNVS_TAMPER3__GPIO5_IO03 0x1b0b0
>;
};
编译启动,LED随系统闪烁