aduff

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: OSD32MP1-BRK Getting Startet Tutorial #10892
    Andrey Loshchilovaduff
    Participant

      the LED lines are busy as it is described in the Device Tree as LEDs. It means you can not control it by gpioset/gpioget utility anymore. You should use sysfs interface instead.

      The list of available LEDs:

      debian@localhost:~$ ls /sys/class/leds/
      LED1_GRN LED1_RED LED2_GRN LED2_RED

      For example, you can turn LED1_GRN on and of by writing to /sys/class/leds/LED1_GRN/brightness

      Turn off:
      echo 0 > /sys/class/leds/LED1_GRN/brightness

      Turn on:
      echo 1 > /sys/class/leds/LED1_GRN/brightness

      You can also setup trigger for the LED. List of available triggers:
      cat /sys/class/leds/LED1_GRN/trigger
      [none] rfkill-any rfkill-none kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 cpu1 default-on transient flash torch mmc0

      to set, say, heartbeat trigger you should do:
      echo heartbeat > /sys/class/leds/LED1_GRN/trigger

      This document might be useful: http://blog.foool.net/wp-content/uploads/linuxdocs/leds.pdf

      Regarding the default functions. in Device Tree it is described as below. It means red LED1 should be triggered by heartbeat, while the green LED1 is constantly ON. What do you see on your board?

      led{
      compatible = “gpio-leds”;

      red1{
      label = “LED1_RED”;
      gpios = <&gpioz 6 GPIO_ACTIVE_LOW>;
      linux,default-trigger = “heartbeat”;
      status = “okay”;
      default-state = “off”;
      };

      green1{
      label = “LED1_GRN”;
      gpios = <&gpioz 7 GPIO_ACTIVE_LOW>;
      status = “okay”;
      default-state = “on”;
      };

      red2{
      label = “LED2_RED”;
      gpios = <&gpioi 8 GPIO_ACTIVE_LOW>;
      status = “okay”;
      default-state = “off”;
      };

      green2{
      label = “LED2_GRN”;
      gpios = <&gpioi 9 GPIO_ACTIVE_LOW>;
      default-state = “off”;
      };
      };

      • This reply was modified 4 years ago by Andrey Loshchilovaduff.
    Viewing 1 post (of 1 total)