You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

基于Volumio的Nanopi Neo Air内核LED驱动异常排查求助

Troubleshooting Empty /sys/class/leds on Nanopi Neo Air Volumio Custom Kernel

Let's break down why your green power LED isn't working and /sys/class/leds is empty, even with seemingly correct kernel configs and DTS entries. Here are the key areas to investigate step by step:

  • Verify the Device Tree LED Node Was Properly Loaded
    Your DTS defines the LED nodes, but we need to confirm the running kernel actually picked them up. Extract the active device tree with this command:

    dtc -I fs /proc/device-tree > active_dts.dts
    

    Open active_dts.dts and check for the leds node:

    • Ensure the pwr (green LED) node exists with the correct GPIO pin (<&r_pio 0 10 GPIO_ACTIVE_HIGH>)
    • Confirm the pinctrl-0 references (&leds_npi, &leds_r_npi) are present and configured to set those pins as GPIO outputs (not alternate functions like UART or SPI)
      If the node is missing or misconfigured, your DTS wasn't properly included in the kernel's device tree blob (dtb) during compilation.
  • Check GPIO Controller Drivers Are Enabled
    LED functionality depends entirely on the underlying GPIO controller working. For the Nanopi Neo Air's r_pio (right-side GPIO bank), confirm these kernel configs are built-in (not modules):

    CONFIG_PINCTRL_SUNXI=y
    CONFIG_PINCTRL_SUN8I_R=y
    

    Verify they're present in your built-in modules list:

    grep -i sun8i /lib/modules/$(uname -r)/modules.builtin
    

    If the GPIO controller driver isn't active, the LED subsystem can't access the pins, so no /sys/class/leds entries will be created.

  • Inspect Kernel Boot Logs for LED/GPIO Errors
    Kernel logs often reveal initialization failures. Run these commands to find relevant messages:

    dmesg | grep -i led
    dmesg | grep -i gpio
    dmesg | grep -i pinctrl
    

    Look for red flags like:

    • "GPIO pin X is already in use by another device" (pin conflict)
    • "Failed to parse LED node" (DTS syntax issue)
    • "pinctrl: could not request pin X" (incorrect pin mux configuration)
      These will point directly to why the LED subsystem isn't initializing.
  • Test GPIO Functionality Manually
    To rule out hardware issues, try controlling the green LED via GPIO sysfs directly:

    1. Calculate the correct GPIO number for r_pio 0 10 (on Sunxi platforms, r_pio starts at GPIO 128, so this would be 128 + 10 = 138).
    2. Export the GPIO:
      echo 138 > /sys/class/gpio/export
      
    3. Set it to output and turn it on:
      echo out > /sys/class/gpio/gpio138/direction
      echo 1 > /sys/class/gpio/gpio138/value
      

    If the LED lights up, the hardware is working, and the issue is definitely in the kernel's device tree or GPIO controller configuration. If it doesn't, double-check the pin mapping or physical hardware connections.

  • Confirm LED Subsystem Dependencies
    Even though you have trigger configs enabled, ensure core LED subsystem components are fully initialized. Double-check that CONFIG_GPIO_SUNXI=y (main GPIO driver) is enabled alongside your existing LED configs—this is a critical dependency for leds-gpio to work.


内容的提问来源于stack exchange,提问作者Julien Julien

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.11 07:39:38