OSD32MP1-BRK Getting Startet Tutorial

Forums Reference, Evaluation, and Development Boards OSD32MP1-BRK OSD32MP1-BRK Getting Startet Tutorial

Viewing 2 reply threads
  • Author
    Posts
    • #10831
      Corsin ObristCCISN_Obrist
      Participant

        I’m using the OSD32MP1-BRK with the OpenSTLinux Version2.0 | September 23.2020 Image. The flashing and booting of the image on the device workt properly.
        But the LEDs are blinking not the same as described in the tutorial.
        Also when I try to toggle the LED over the command line it says:

        error setting the GPIO line values: Device or resource busy

        also when I try to lunch the webserver it doesen’t work. In the directory /usr/local/demo there is only the demo_lucher.py python file and no LEDWebDemo.

        while starting the file with python3 demo_luncher.py the error msg is:

        Gtk couldn’t be initialized. Use Gtk.init_check() if you want to handle this case.

        Could you tell me where I’ll find the image where this getting started tutorial was written with? Or could you give me some hints how i can use it with the Version2.0 of the provided .img?

      • #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.
        • #10895
          Neeraj Kumar Reddy DantuNeeraj Dantu
          Moderator

            As aduff said, the LEDs are integrated into the device tree with the new OpenSTLinux V2 image. We have modified the demo in the OpenSTLinux image to now work as described in the Getting Started Guide. Note that the demo code in in folder /usrl/local/demo/LEDWebDemo

            Best,

            Neeraj

        Viewing 2 reply threads
        • You must be logged in to reply to this topic.