Add a HeartBeat function on RK3288 LED

Platform: Rockchip’s rk3288

Author: fulinux

*****This article allows reprinting, but please indicate the source: http:/ /blog.csdn.net/fulinus****

1, hardware environment

any GPIO pin is selected as the heartbeat Output, select an unused SPI0_CSn0, as shown in the bottom board schematic:

2, software environment

The configuration in the kernel/arch/arm/boot/dts/rk3288-tb_8846.dts file is as follows:
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";
};< /pre>
The kernel configuration is as follows:
--- LED Support
<*> LED Support for GPIO connected LEDs
[*] LED Trigger support --->
<*> LED Heartbeat Trigger
< div> After normal compilation, burn it to the development board, and you can see the heartbeat waveform through the oscilloscope:


< p>Platform: Rockchip’s rk3288

Author: fulinux

*****This article allows reprinting, but please Indicate the source: http://blog.csdn.net/fulinus****


1, hardware environment

any choice A GPIO pin is used as the output of heartbeat, select an unused SPI0_CSn0, as shown in the schematic diagram of the backplane:

2, software environment

The configuration in the kernel/arch/arm/boot/dts/rk3288-tb_8846.dts file is as follows:

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";
};

The kernel configuration is as follows: < /div>

--- LED Support
<*> LED Support for GPIO connected LEDs
[*] LED Trigger support --->
<*> LED Heartbeat Trigger
Compile normally and burn it to the development board , The heartbeat waveform can be seen through the oscilloscope:

The configuration in the kernel/arch/arm/boot/dts/rk3288-tb_8846.dts file is as follows:

< p>

diff --git a/arch/arm/boot/dts/rk3288-tb_8846.dts b/arch/arm/boot/dts/rk3288-tb_8846.dts
index c92d973..91ad1da 100644< br />--- 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";
};

The kernel configuration is as follows:

--- LED Support

<*> LED Support for GPIO connected LEDs

[*] LED Trigger support

<* > LED Heartbeat Trigger

After normal compilation, burn it to the development board, and you can see the heartbeat waveform through the oscilloscope:

Leave a Comment

Your email address will not be published.