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

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

$
0
0
Ok Thank you, I fixed that noob bug. However the situation is still the same. The device tree is being updated but

Code:

gpio info        line  20:     "GPIO20"       unused   input  active-high line  21:     "GPIO21"      unused   input  active-high               // expecting this to be assigned.line  22:     "GPIO22"       unused   input  active-high 
Here is the overlay:

Code:

/dts-v1/;/plugin/;/ {        fragment@0 {                target-path = "/leds";                __overlay__ {                        new-led {                                linux,default-trigger = "heartbeat";                                label = "NEWLED";                                gpios = <&gpio 21 0x00>;                        };                };        };};
As before, dtoverlay command correctly updated the device tree, but there was no assignment to the GPIO.

Then I tried updated /boot/firmware/config.txt adding

Code:

# Enable the extra GPIO leddtoverlay=gpio-led
Then I rebooted and the overlay took effect ie correct heartbeat flashing on GPIO21.

Code:

gpio info        line  20:     "GPIO20"       unused   input  active-high line  21:     "GPIO21"     "NEWLED"  output  active-high [used]     // works if config.txt edited but not with dtoverlayline  22:     "GPIO22"       unused   input  active-high 

As a possible explanation, I remember reading somewhere that the kernel does not always "honour" the dtoverlay command.
Presumably this is to stop misadventures by overwriting key parts of the base tree and maybe "leds" is one node that behaves like this.

Any final comment?

Unexplained behaviour is always uncomfortable....

Statistics: Posted by bcperth — Mon Apr 07, 2025 1:34 am



Viewing all articles
Browse latest Browse all 8609

Trending Articles