平台:瑞芯的rk3288
作者:fulinux
*****本文允许转载,不过请注明出处:http://blog.csdn.net/fulinus****
1、硬件环境
任意选取一个GPIO引脚作为heartbeat的输出,选择一个未被使用的SPI0_CSn0,如底板原理图所示:
对应在顶板上连接rk3288的是GPIO5 _ B5 _ u引脚,如图:
2、软件环境
在kernel/arch/arm/boot/dts/rk3288-tb_8846.dts文件中配置如下:
diff --git a/arch/arm/boot/dts/rk3288-tb_8846.dts b/arch/arm/boot/dts/rk3288-tb_8846.dts index c92d973..91ad1da 100644 --- a/arch/arm/boot/dts/rk3288-tb_8846.dts +++ b/arch/arm/boot/dts/rk3288-tb_8846.dts @@ -6,6 +6,16 @@ #include "vtl_ts_sdk8846.dtsi" / { + leds { + compatible = "gpio-leds"; + led0 { + label = "led0"; + gpios = <&gpio5 GPIO_B5 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + }; + fiq-debugger { status = "okay"; };
内核配置如下:
--- LED Support
<*> LED Support for GPIO connected LEDs
[*] LED Trigger support --->
<*> LED Heartbeat Trigger
正常编译后烧录到开发板上,通过示波器可以看到心跳波形:
时间: 2024-10-01 05:05:20