HowTo: Activate Arduino Serial on Intel Edison

After installing Archlinux on Intel Edison, we needed to use the serial port of the arduino breakout board. But it didn't work out of the box.

This was not a bug but a configuration issue. Thanks to the people of Emutexlabs, who made useful and very detailed tables of pin mapping for GPIOs/SPI/I2C/UART/PWM on linux, we came up with a script to activate UART on our board.

Useful links:

#!/bin/sh

# export all useful gpio
echo 130 > /sys/class/gpio/export
echo 248 > /sys/class/gpio/export
echo 216 > /sys/class/gpio/export
echo 131 > /sys/class/gpio/export
echo 249 > /sys/class/gpio/export
echo 217 > /sys/class/gpio/export
echo 214 > /sys/class/gpio/export

# Disable tri-state
echo low > /sys/class/gpio/gpio214/direction

# Set direction
echo low  > /sys/class/gpio/gpio248/direction
echo high > /sys/class/gpio/gpio249/direction

echo in > /sys/class/gpio/gpio216/direction
echo in > /sys/class/gpio/gpio217/direction

# Set Mode1
echo mode1 > /sys/kernel/debug/gpio_debug/gpio130/current_pinmux
echo mode1 > /sys/kernel/debug/gpio_debug/gpio131/current_pinmux

# Activate tri-state
echo high > /sys/class/gpio/gpio214/direction

Yippee !

screen /dev/ttyMFD1 115200