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:

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2581 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.