Yocto Gpio

tapani
tapani New Member Posts: 7

Hello

I'm building a Yocto-based setup on Up Board. I wish to communicate with an external device connected to the 40-pin connector. It's already been tested on an Ubuntu 16.04, but I'm having trouble with Yocto.

I've read instructions from up wiki and meta-up-board's readme.

  • Poky thud
  • meta-up-board, branch sumo_linux-yocto, minimal changes to make it thud-compatible
  • kernel 4.14 with patches from meta-up-board
    • also tried 4.18 with ported patches

At least some of the patches and drivers are working, but something is still missing. Only the default ttyS0...ttyS3 are there and the listings below do not look quite right either. There should also be a connectd device detected in gpio25.

cat /proc/tty/drivers
/dev/tty /dev/tty 5 0 system:/dev/tty /dev/console /dev/console 5 1 system:console /dev/ptmx /dev/ptmx 5 2 system /dev/vc/0 /dev/vc/0 4 0 system:vtmaster serial /dev/ttyS 4 64-67 serial pty_slave /dev/pts 136 0-1048575 pty:slave pty_master /dev/ptm 128 0-1048575 pty:master unknown /dev/tty 4 1-63 console

cat /proc/tty/drivers/serial
serinfo:1.0 driver revision: 0: uart:16550A port:000003F8 irq:4 tx:81 rx:0 RTS|DTR 1: uart:16550A mmio:0xA171B000 irq:39 tx:0 rx:0 2: uart:unknown port:000003E8 irq:4 3: uart:unknown port:000002E8 irq:3

ls /sys/bus/gpio/devices
lrwxrwxrwx 1 root root 0 Jun 13 10:44 gpiochip0 -> ../../../devices/platform/INT33FF:00/gpiochip0 lrwxrwxrwx 1 root root 0 Jun 13 10:44 gpiochip1 -> ../../../devices/platform/INT33FF:01/gpiochip1 lrwxrwxrwx 1 root root 0 Jun 13 10:44 gpiochip2 -> ../../../devices/platform/INT33FF:02/gpiochip2 lrwxrwxrwx 1 root root 0 Jun 13 10:44 gpiochip3 -> ../../../devices/platform/INT33FF:03/gpiochip3 lrwxrwxrwx 1 root root 0 Jun 13 10:44 gpiochip4 -> ../../../devices/platform/up-pinctrl/gpiochip4

ls /sys/class/gpio
--w------- 1 root root 4096 Jun 13 10:44 export lrwxrwxrwx 1 root root 0 Jun 13 10:44 gpiochip0 -> ../../devices/platform/up-pinctrl/gpio/gpiochip0 lrwxrwxrwx 1 root root 0 Jun 13 10:44 gpiochip318 -> ../../devices/platform/INT33FF:03/gpio/gpiochip318 lrwxrwxrwx 1 root root 0 Jun 13 10:44 gpiochip373 -> ../../devices/platform/INT33FF:02/gpio/gpiochip373 lrwxrwxrwx 1 root root 0 Jun 13 10:44 gpiochip397 -> ../../devices/platform/INT33FF:01/gpio/gpiochip397 lrwxrwxrwx 1 root root 0 Jun 13 10:44 gpiochip456 -> ../../devices/platform/INT33FF:00/gpio/gpiochip456 --w------- 1 root root 4096 Jun 13 10:44 unexport

cat /sys/kernel/debug/gpio
`gpiochip4: GPIOs 0-27, parent: platform/up-pinctrl, up-pinctrl:

gpiochip3: GPIOs 318-372, parent: platform/INT33FF:03, INT33FF:03:

gpiochip2: GPIOs 373-396, parent: platform/INT33FF:02, INT33FF:02:
gpio-386 ( |up-pinctrl ) out lo
gpio-388 ( |up-pinctrl ) out hi
gpio-396 ( |up-pinctrl ) in lo

gpiochip1: GPIOs 397-455, parent: platform/INT33FF:01, INT33FF:01:
gpio-418 ( |up-pinctrl ) out hi

gpiochip0: GPIOs 456-511, parent: platform/INT33FF:00, INT33FF:00:
gpio-499 ( |up-pinctrl ) out hi`

Any ideas what could be wrong? Have the yocto patches been tested to work?

Answers

  • ccalde
    ccalde New Member Posts: 348 ✭✭✭

    Hi @tapani ,

    Sorry, but the Wiki was just updated with the latest meta-upboard layer version (sumo branch).
    Please, could you confirm your test with this version?
    https://wiki.up-community.org/Yocto-based

  • tapani
    tapani New Member Posts: 7

    Hi @ccalde

    I tried to follow the instructions literally, but because I don't have an operating system old enough, there were serious issues with glibc 2.27. Instead I tried the sumo branch of meta-up-board on top of thud. With that I had the same results as with sumo_linux-yocto.

    Is there perhaps an image somewhere I could use to verify it works?

  • tapani
    tapani New Member Posts: 7

    Hi @ccalde
    I set up an ubuntu 18.04 virtual machine and used it to build an upboard-image-sato. I followed the wiki's instructions to the letter. I'm sorry, but it doesn't work. Ubuntu with the precompiled upboard kernel works out "of the box" as soon as the correct kernel is running.

  • ccalde
    ccalde New Member Posts: 348 ✭✭✭

    Hi @tapani ,

    Sorry but that's confused for me.
    Are you asking for a compiled Yocto image to verify there? Do you have any issues during the meta-up-board build?

  • tapani
    tapani New Member Posts: 7

    Hi @ccalde

    I was indeed asking for a compiled image to see if the kernel built strictly according to wiki instructions works as expected.
    Then I managed to do it on my own.

    During my latest test build on a clean sumo + meta-up-board I didn't have any issues that would have stopped the process.

  • tapani
    tapani New Member Posts: 7

    @ccalde is the source code for 4.15 somewhere? I could try to use that one, but I can only find older ubilinux kernels.

  • tapani
    tapani New Member Posts: 7

    I did find the source code, but not the exact build configuration. That would help. :)

  • ccalde
    ccalde New Member Posts: 348 ✭✭✭

    Hi,

    Could you confirm if you have any issue building the Yocto sumo layer for meta-up-board?
    https://wiki.up-community.org/Yocto-based
    Could you please send me the specific commands you followed to get your built image?

    Why you need the sources for 4.15? Yocto sumo uses the 4.14 version.
    Also, why are you talking about Ubilinux kernels?
    That all is confusing.

  • tapani
    tapani New Member Posts: 7

    Hi @ccalde

    OK, let's take a few steps back.

    • Yocto sumo 4.14: doesn't work properly (see original post)
    • Yocto thud 4.14: same thing
    • Yocto thud 4.18 with ported up-board patches: same thing
    • Ubuntu with Ubilinux 4.15 kernel: works

    For reference I set up a virtual machine with old Ubuntu and built sumo with exactly these instructions: https://wiki.up-community.org/Yocto-based -> Does not work, just like in my original post.

    Can you please confirm that my original assumption is correct? That my pasted listings indicate that something is not working quite as it should?

  • ccalde
    ccalde New Member Posts: 348 ✭✭✭

    Hi,

    So, you got the meta-up-board sumo branch built successfully but you have issues to detect your device connected to a GPIO.
    You are talking about the GPIO 25 but that is GROUND pin!
    Did you check your device in other GPIO pin number?
    https://wiki.up-community.org/Pinout

Privacy Policy