平台:瑞芯的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
正常编译后烧录到开发板上,通过示波器能够看到心跳波形: