Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7503

Device Tree • Add a led to gpio-leds driver using an overlay - PI3 B+

$
0
0
I have a pi3 model B+
As an exercise, I connected a led to GPIO pin 21 (with series etc) and tried to associate it with the "gpio-leds" driver.
I compiled a small overlay inserting myled and the resulting "leds" part of the device tree now looks like this after

Code:

sudo dtoverlay new-led.dtbo 

Code:

leds {                compatible = "gpio-leds";                phandle = <0x9a>;                led-act {                        linux,default-trigger = "mmc0";                        label = "ACT";                        default-state = "off";                        phandle = <0x3c>;                        gpios = <0x07 0x1d 0x00>;                };                myled {                        linux,default-trigger = "heartbeat";                        label = "Heartbeat";                        default-state = "off";                        status = "true";                        phandle = <0x9c>;                        gpios = <0x07 0x15 0x00>;                };                led-pwr {                        linux,default-trigger = "default-on";                        label = "PWR";                        default-state = "off";                        phandle = <0x3d>;                        gpios = <0x0b 0x02 0x01>;                };        };
After this I was expecting at least to see that gpio pin 21 (hex 0x15) to be allocated.
Instead gpioinfo shows:

Code:

        line  20:     "GPIO20"       unused   input  active-high line  21:     "GPIO21"       unused   input  active-high     -- why is this still unused after the device tree changes?line  22:     "GPIO22"       unused   input  active-high 
Why are the device tree changes not applied?
Is there another command I need to issue?
or
What is the correct way to add a new gpio pin/led to the "gpio-leds" driver so I can use one of the triggers?

Thank You

Statistics: Posted by bcperth — Fri Apr 04, 2025 5:00 am — Replies 1 — Views 24



Viewing all articles
Browse latest Browse all 7503

Trending Articles