GPIO on Fedora 27

Discussion in 'UDOO X86' started by Michal Schorm, Feb 15, 2018.

Tags:
  1. Michal Schorm

    Michal Schorm New Member

    Joined:
    Feb 14, 2018
    Messages:
    2
    Likes Received:
    0
    Hello,
    I got my UDOO X86_64, loaded with Fedora 27, and I am trying to work with GPIO pins.
    I should also mention that I have never worked with GPIO before.

    Please note, that most advices about controlling GPIOs from OS are not applicable to me. 'sysfs' kernel module (the one that allows you to go to /sys/class/gpio/... ) is broken and has been deprecated time ago. A new kernel module handling GPIOs is now used.
    It allows you to work with GPIOs as a character devices in /dev/gpiochip0 (/dev/gpiochip1, ...).

    I made a good progress using this way, as showed here:
    https://github.com/FaramosCZ/UDOO/blob/gpio/gpio_3.c
    I can set and read the pins. Also the libgpiod tools confirm the settings I'm doing.

    The problem is very simple.
    I have *zero* idea, which pin is accessible from where.

    Here is the output from 'gpioinfo' tool from 'libgpiod':
    I trucnated all line numbers in between. (it has ~200 rows in total)

    gpiochip4 - 3 lines:
    line 0: unnamed unused output active-high
    line 1: unnamed unused output active-high
    line 2: unnamed "ACPI:Event" input active-high [kernel]
    gpiochip3 - 55 lines:
    line 0: unnamed unused output active-high
    line 1: unnamed unused output active-high
    . . .
    line 54: unnamed unused input active-high
    gpiochip2 - 24 lines:
    line 0: unnamed unused input active-high
    line 1: unnamed unused input active-high
    . . .
    line 23: unnamed unused input active-high
    gpiochip1 - 59 lines:
    line 0: unnamed unused input active-high
    line 1: unnamed unused input active-high
    line 2: unnamed unused output active-high
    line 3: unnamed unused input active-high
    . . .
    line 58: unnamed unused input active-high
    gpiochip0 - 56 lines:
    line 0: unnamed unused output active-high
    line 1: unnamed unused output active-high
    . . .
    line 55: unnamed unused input active-high

    I can set all of them, but I don't know which lines are mapped to which pins on board.
    I tried to set every line 0 and 1 from every chip to '0' and '1' values and measure the voltage between them.
    I measured the GPIO0 and GPIO1 difference, connected as here:
    https://www.udoo.org/docs-x86/img/x86_pinout_arduino.png

    Since they are the first 2 arduino pins, I should've found them.
    But no success so far.


    Can someone help me with this one?
     
  2. Markus Laire

    Markus Laire Active Member

    Joined:
    Mar 9, 2017
    Messages:
    225
    Likes Received:
    92
  3. ccs_hello

    ccs_hello UDOOer

    Joined:
    Apr 15, 2017
    Messages:
    536
    Likes Received:
    194
    UDOO x86 actually is two computers in one: Intel X86 (Braswell CPU) and Arduino (Intel Curie.)
    They are independent with each other.
    Braswell's GPIO pins are in outer columns of these two-columns connectors (see post 2 picture.)
    Arduino 101's are in inner connectors.
     
    Markus Laire likes this.
  4. Michal Schorm

    Michal Schorm New Member

    Joined:
    Feb 14, 2018
    Messages:
    2
    Likes Received:
    0
    Ok, I understand the difference now. Thanks for clarification.

    However the question more or less remains.
    How can I interact with the Braswell CPU pins and how do I find which is where?

    (also, can I use *any* of them to play with? They are "general purpose" after all, right)
     
  5. ccs_hello

    ccs_hello UDOOer

    Joined:
    Apr 15, 2017
    Messages:
    536
    Likes Received:
    194
    Probably ask the author of that Kernel Module or read the Intel Braswell hardware reference manual yourself.
     

Share This Page