old interface ls /sys/class/gpio/ new interface ls /dev/gpiochip* /sys/class/leds (must enable) sudo apt update sudo apt install gpiod -y new interface sudo gpiodetect gpioinfo pinctrl-bcm2835 or ls /dev/gpiochip* and gpioinfo 0 sudo gpioset pinctrl-bcm2835 18=1 or gpioset 0 18=1 enable driver then modify device tree device tree not necessary for usb (can describe itself at runtime) Linux kernel menuconfig ---> Device drivers ---> LED Support ---> LED Class support and led support for led gpio connected and led trigger support ---> all Kernel SRC/Documentation/devicetree/bindings/ Kernel SRC/Documentation/devicetree/bindings/leds/leds-gpio.yaml copy example Kernel SRC/arch/arm/boot/dts/nxp/imx/imx6dl-colibri-aster.dts driver: Kernel SRC/drivers/leds/leds-gpio.c "compatible = "gpio-leds" Kernel SRC/arch/arm/boot/dts/nxp/imx/imx6dl.dtsi (base device tree)dtsi contains aliases to gpio eg &gpio1 eg leds { compatible = "gpio-leds"; led-0 { gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; function = LED_FUNCTION_STATUS; color = ; default-state = "off"; }; }; Make a copy of the dts (typically in board//). Point to that dts in the "Out of tree custom DTS" menu entry (BR2_LINUX_KERNEL_CUSTOM_DTS_PATH) in the Buildroot menuconfig. Obviously, you need to build a kernel and enable the device tree option for this to work or just add out-of-tree device tree directory for folder containing custom dts. ls -l /proc/device-tree/ ls -l /proc/device-tree/leds/ cd /sys/class/leds ls cd red:status cat max_brightness echo 0 > brightness (off) echo 1 > brightness (on) cat trigger echo timer > trigger echo delay_off etc Now we need to create the overlay directory that will add additional configuration files to the target’s firmware image. Let’s create a directory called board/raspberrypi/rootfs_overlay/, and subdirectories for the actual files. ((PAD_ETH_TXP)/UART3_RX/IIC1_SCL/XGPIOB[25]/PWM[13]/CAM_MCLK0/SPI1_SDO/IIS2_LRCK)__[HIZ]|________PAD_ETH_TXP___EPHY_RXN 62 ((PAD_ETH_TXM)/UART3_RTS/IIC1_SDA/XGPIOB[24]/PWM[12]/CAM_MCLK1/SPI1_SDI/IIS2_BCLK)__[HIZ]|________PAD_ETH_TXM___EPHY_RXP 63 ((PAD_ETH_RXP)/UART3_TX/CAM_MCLK1/XGPIOB[27]/PWM[15]/CAM_HS0/SPI1_SCK/IIS2_DO)__[HIZ]|________PAD_ETH_RXP___EPHY_TXN 64 ((PAD_ETH_RXM)/UART3_CTS/CAM_MCLK0/XGPIOB[26]/PWM[14]/CAM_VS0/SPI1_CS_X/IIS2_DI)__[HIZ]|________PAD_ETH_RXM___EPHY_TXP 65 XGPIO?