Important: Please read the Qt Code of Conduct -

Gpios in Yocto QT Embedded

  • Hey Guys,

    First of all sorry for my English its not my native language. Im kind of a newbie in the Embedded Linux / Qt World so I hope my questions are not to stupid.

    Im using an embedded Board with an IMX287 CPU and I have a custom designed Yocto(Poky) with Kernel version 3.17 running on it. I used core-image-sato as Image recipe and have also included qt4-embedded on it. I can compile now own QT Programms with bitbake and run them on my yocto build.

    Now my question is : Is there an way to control the GPIOs of the IMX287 within my QT Programm(Maybe an library or something similar)? I've read there is an Qt function called "Qprocess" where I can send console commands to control my GPIOs , but this looks like a strange solution for me.

    Thx in advance for your help!

    greetings Chris

  • Lifetime Qt Champion


    It depends a bit on how the GPIOs are seen by your OS e.g. are they accessible through a device in /dev ?

  • Hi SGaist,
    Thx for the fast reply.
    Right now I can change the direction of the gpios with commands like this:
    echo "139" > /sys/class/gpio/export
    echo "in" > /sys/class/gpio/gpio139/direction

    When i look in my /dev folder i cant see something like gpio

    My /dev folder looks like this:
    link text

    Sorry again if this answer is not accurate enough, Im a hardware guy ^^

  • Lifetime Qt Champion

    sys ? Even better !

    You can use QFile to write to export and direction and voila nothing more complicated.

    Nop, very good answer :) You can be both guys ;)

  • Im far away from beeing both guys ^^ Thanks for your Help !
    Finally got an LED to blink (YAY!). Had some Issues with the Opening Mode of the Qfile . Its only working with OpenMode "WriteOnly" right now.

  • Lifetime Qt Champion

    There's always a beginning ;)

    IIRC sysfs can provide write-only files

Log in to reply