User Tools

Site Tools


Getting started with Olimex A20-SOM

Buildroot system

Based on, using the sunxi u-boot and Linux kernel

make a20_olinuxino_defconfig

Bootable microSD

Make two partitions:

  • boot partition: FAT16, starting at offset 1MB, for u-boot.img, script.bin, uEnv.txt and uImage
  • linux partion: ext3 for rootfs
:!: Before running below commands be sure of which device is your to-be-formatted microSD card. In this example we take /dev/sdc . You might loose data if you run the wrong command!
sudo sfdisk /dev/sdc << EOF

Format the first partition in FAT16 for boot

sudo mkfs.vfat -F 16 /dev/sdc1 -n boot

Format the second in EXT3 for the root filesystem

sudo mkfs.ext3 /dev/sdc2 -L rootfs

Burn sunxi-spl.bin and u-boot.bin, from Buildroot's output/images, at the beginning of the SD card:

sudo dd if=sunxi-spl.bin of=/dev/sdc bs=1024 seek=8
sudo dd if=u-boot.bin of=/dev/sdc bs=1024 seek=32

or, equivalently, u-boot-sunxi-with-spl.bin (actually, the concatenation of sunxi-spl.bin and u-boot.bin), to be found in Buildroot's build/uboot:

sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdc bs=1024 seek=8

Copy the content of the boot partition:

tar -xvf rootfs.tar -C </path/to/boot/mount/point> --strip=2 --wildcards './boot/*' --exclude './boot/u-boot.bin' --exclude './boot/u-boot.img' --exclude './boot/sunxi-spl.bin' --exclude './boot/u-boot-sunxi-with-spl.bin'

Copy the content of the root filesystem:

sudo tar xvf rootfs.tar -C </path/to/rootfs/mount/point> --exclude 'boot'


SPI support

  1. Load the spi driver: modprobe spi_sun7i

FBTFT support

(requires spi driver to be loaded)

  1. Load the fbtft_device driver: modprobe fbtft_device name=rpi-display busnum=1 gpios=reset:4,dc:5,led:6 rotate=90
    • rpi-display is associated to the 'ili9341' driver,
    • busnum=1 refers to device /dev/spi1.0,
    • gpios=… makes the link between the defferents signals to the actual gpios they are connected to)
    • rotate=… indicates the rotation angle (counter clockwise) of the screen (0, 90, 180 or 270)
  2. Load the driver corresponding to the screen: modprobe fb_ili9341


Network configuration


To enable eth0 interface, load sunxi-emac driver on the OLinuXino-Lime

modprobe sunxi-emac


with a rt2870 chipset

Add the support for the rt2870 chipset to your system:

  • make sure linux-firmware is ticked in your buildroot configuration
  • make sure Busybox mdev is configured to support firmware hotload

On target,

  • configure mdev as kernel hotplug
sysctl -w kernel.hotplug=/sbin/mdev
mdev -s
  • load the rt2800usb driver
modprobe rt2800usb
  • bring up the wlan0 interface
ifconfig wlan0 up

with a mt7601 chipset

Build the driver

Download the driver sources from

Apply the following patch:

diff --git a/src/Makefile b/src/Makefile
index dfe1283..b2615ab 100755
--- a/src/Makefile
+++ b/src/Makefile
@@ -197,11 +197,13 @@ endif
 ifeq ($(PLATFORM),PC)
 # Linux 2.6
-LINUX_SRC = /lib/modules/$(shell uname -r)/build
+LINUX_SRC = <path_to_your_linux_kernel_sources>
 # Linux 2.4 Change to your local setting
 #LINUX_SRC = /usr/src/linux-2.4
-LINUX_SRC_MODULE = /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless/
+LINUX_SRC_MODULE = $LINUX_SRC/drivers/net/wireless
+CROSS_COMPILE = <path_to_your_sdk>/host/usr/bin/arm-linux-
+export ARCH
diff --git a/src/include/os/rt_linux.h b/src/include/os/rt_linux.h
index 3726b9e..821e401 100755
--- a/src/include/os/rt_linux.h
+++ b/src/include/os/rt_linux.h
@@ -279,7 +279,7 @@ typedef struct file* RTMP_OS_FD;
 typedef struct _OS_FS_INFO_
 	uid_t				fsuid;
 	gid_t				fsgid;
diff --git a/src/include/rtmp_def.h b/src/include/rtmp_def.h
index 2afcb77..b69af63 100755
--- a/src/include/rtmp_def.h
+++ b/src/include/rtmp_def.h
@@ -75,7 +75,7 @@
 #define RX_RING_SIZE            8
 #endif /* INF_AMAZON_SE */
 #define MAX_TX_PROCESS          4
-#define LOCAL_TXBUF_SIZE        2048
+#define LOCAL_TXBUF_SIZE        256
 #endif /* RTMP_MAC_USB */
diff --git a/src/os/linux/ b/src/os/linux/
index 531b00e..e67c864 100755
--- a/src/os/linux/
+++ b/src/os/linux/
@@ -1054,7 +1054,7 @@ CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -Wall -O2 -Wundef -Wstrict-prototy
 export CFLAGS
-GCCVERSION = $(shell gcc -dumpversion)
+GCCVERSION = $(shell $(CROSS_COMPILE)gcc -dumpversion)
 ifeq ($(PLATFORM),PC)
     ifneq (,$(findstring 2.4,$(LINUX_SRC)))


  1. <path_to_your_linux_kernel_sources> is the path to the sources of kernel for your target; e.g. <buildroot_directory>/output/build/linux-sunxi-v3.4.104-r0
  2. <path_to_your_sdk> is your buildroot output directory; e.g. <buildroot_directory>/output

Note that changing the LOCAL_TXBUF_SIZE define value from 2048 to 256 prevents an error to occur during the loading of your driver.

Launch the compilation:

$ cd src
$ make

and copy the generated src/os.linux/mt7601Usta.ko driver to your target. Note that the generated file is quite big (15MB)…

Load the driver

On your target:

  • load the driver:
$ insmod mt7601Usta.ko
  • enable the ra0 interface:
$ ifconfig ra0 up



via the mali driver (

To redirect the output the a non standard framebuffer device, define the FRAMEBUFFER environnement variable to the wanted device. THe same variable has to be used to launch a Qt5 application, instead of the normal QT_QPA_EGLFS_FB one.

a20.txt · Last modified: 2018/05/22 10:33 (external edit)