Linux

Generic linux support for any board

Overview

Most boards use a Debian derivative as their official linux based platform so the library is best tested on debian.

Because Go executables are statically linked by default, there should be no problem to run a periph based executable on a buildroot.

ACL

You may have to run the executable as root to be able to access the LEDs, GPIOs and other functionality.

It is possible to change the ACL on the sysfs files via udev rules to enable running without root level. The actual rules are distro specific. That said, using memory mapped GPIO registers usually require root anyway.

SPI

On Linux, SPI support uses the spidev kernel driver.

On embedded boards running Linux, SPI ports might not be enabled by default. Check for /dev/spidev*.* nodes.

If there aren’t, you might need to add a Device Tree Overlay enabling spidev.

An example for the Pine A64(+) Board can be found here.

cgo

Some drivers in periph.io/x/host/v3 requires cgo.

On Debian, including Raspbian and Ubuntu, you need to install pkg-config to enable cgo, run:

sudo apt install pkg-config