Getting started with A13-OLinuXino blog post on element14

Image

 

We spotted blog post on element14 about Getting started with A13-OLinuXino

Building Debian Linux bootable SD card with hardware accelerated video decoding and Kernel 3.4 for A13-OLinuXino

Image

1. Setup of the toolchain

You should make sure you have the tools for building the Linux Kernel and install them if you don’t have them. To install new software you should be with super user rights on your Linux machine, so do this type in a terminal.

$ sudo su

you will be asked for your password and then your prompt will change to # which means you are now the super user, all future commands should be run in this mode.

First update apt-get links by typing:

# apt-get update

Install the toolchain by typing the following.

# apt-get install gcc-4.7-arm-linux-gnueabihf ncurses-dev uboot-mkimage build-essential git

This will install: GCC compiler used to compile the kernal, the kernel config menu
uboot make image which is required to allow the SD card to book into the linux image, Git which allows you to download from the github which holds source code for some of the system, some other tools for building the kernel.

Note that if you use debian may be you will need to add:

deb http://www.emdebian.org/debian squeeze main

in the file below:

/etc/apt/sources.list

after the installation you now have all tools to make your very own A13 kernel image!

2. Building Uboot

For problems around u-boot use Linux-Sunxi mailing list at Google Groups: https://groups.google.com/forum/#!forum/linux-sunxi

First let’s make the directory where we will build the A13-OLinuXino linux:

# mkdir A13-OLinuXino_kernel_34/
# cd A13-OLinuXino_kernel_34/

Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch.
Note that the A13-OLinuXino board u-boot is tested with the next branch:

# git rev-parse --verify HEAD
a5f58fbcf743fd5d239a69dae5049cdb169ef2b0

Download u-boot sourses:

# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git

After the download you should have a new directory

# cd u-boot-sunxi/

With the following command you can start the uboot build:

# make A13-OLinuXino CROSS_COMPILE=arm-linux-gnueabihf-

At the end of the process you can check if everything is OK by

# ls u-boot.bin u-boot-sunxi-with-spl.bin spl/sunxi-spl.bin
spl/sunxi-spl.bin u-boot.bin u-boot-sunxi-with-spl.bin

If you got these files everything is complete, well done so far

# cd ..

You should be in the following directory

/home/user/A13-OLinuXino_kernel_34/#

3. Building kernel sources for A13-OLinuXino

For problems around kernel use Linux-Sunxi mailing list at Google Groups: https://groups.google.com/forum/#!forum/linux-sunxi

Kernel sources for A13 are available on GitHub. Note that the following building is made with the revision below:

# git rev-parse --verify HEAD
77a43694fca9db61560b546ca94809535d37de0f

You can download the kernel sources using the following command:

# git clone https://github.com/linux-sunxi/linux-sunxi

After the download go to the kernel directory

# cd linux-sunxi/

Here you need from A13 configuration file a13_linux_defconfig. The file contains all kernel module settings.

Download a13_linux_defconfig

then copy a13_linux_defconfig file to configs directory:

# cp a13_linux_defconfig linux-sunxi/arch/arm/configs/.

and make:

# make ARCH=arm a13_linux_defconfig

The result should be:

configuration written to .config

If you wish to make your changes in the kernel configuration do:

# make ARCH=arm menuconfig

The menuconfig changes a .config text file, which you can view/edit even with a text editor like vi,nano.

With this command you can add or remove different modules for the different peripherals in the kernel. Be careful when use this as this may cause the kernel to not work properly.

Note that before compiling kernel you have to do a patch related with I2C speed. The patch changes i2c speed from 200kHz to 100kHz.

If you want to use some of olimex’s i2c modules on UEXT then you need from this patch.

download the patch sunxi-i2c.patch

and apply the patch:

# patch -p0 < sunxi-i2c.patch

Now you can continue with kernel image compiling

# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 uImage

when this finish’s you will have uImage ready and the result should be:

Image Name: Linux-3.4.75+
Created: Mon Sep 16 13:39:04 2013
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 5450904 Bytes = 5323.15 kB = 5.20 MB
Load Address: 40008000
Entry Point: 40008000
Image arch/arm/boot/uImage is ready

Now you can build the kernel modules:

# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 INSTALL_MOD_PATH=out modules
# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j4 INSTALL_MOD_PATH=out modules_install

DONE! At this point you have uboot and kernel modules.

The uImage file is located in linux-sunxi/arch/arm/boot/

The kernel modules are located in

linux-sunxi/out/lib/modules/3.x.xx
where 3.x.xx is kernel version

in our case the directory with modules is:

linux-sunxi/out/lib/modules/3.4.75+

4. Format and setup the SD-card

We suggest 4GB class 10 micro sd-card but you can use any card between 2GB and 16GB. Note that if your card is Class 4 or 6 the Linux performance will suffer.

First we have to make the correct card partitions, this is done with fdisk.

Plug SD card into your SD card reader and enter in the terminal

# ls /dev/sd

Then press two times <TAB> you will see a list of your sd devices like sda sdb sdc note that some of these devices may be your hard disk so make sure you know which one is your sd card before you proceed as you can damage your HDD if you choose the wrong sd-device. You can do this by unplugging your sd card reader and identify which “sd” devices remove from the list.

Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:

# fdisk /dev/sdX

then do these steps:

1. p
will list your partitions

if there are already partitions on your card do:

2. d enter 1
if you have more than one partitition press d while delete them all

3. create the first partition, starting from 2048
n enter p enter 1 enter enter +16M

4. create second partition
n enter p enter 2 enter enter enter

then list the created partitions:
p enter
if you did everything correctly on 4GB card you should see something like:

Disk /dev/sdg: 3980 MB, 3980394496 bytes
123 heads, 62 sectors/track, 1019 cylinders, total 7774208 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdg1 2048 34815 16384 83 Linux
/dev/sdg2 34816 7774207 3869696 83 Linux

7. w

write changes to sd card
now we have to format the file system on the card:

the first partition should be vfat as this is FS which the Allwinner bootloader understands

# mkfs.vfat /dev/sdX1

the second should be normal Linux EXT3 FS

# mkfs.ext3 /dev/sdX2

5. Write the Uboot and sunxi-spl.bin

You should be in /home/user/A13-OLinuXino_kernel_34/# directory

Note that you have to write u-boot-sunxi-with-spl.bin in /dev/sdX (not sdX1 or sdX2)

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

6. Write kernel uImage you build to the SD-card

You should be in the directory below

/home/user/A13-OLinuXino_kernel_34/# directory

# mount /dev/sdX1 /mnt/sd

copy the Kernel uImage to root directory in partition 1

# cp linux-sunxi/arch/arm/boot/uImage /mnt/sd

7. Write script.bin file

script.bin is a file with very important configuration parameters like port GPIO assignments, DDR memory parameters, Video resolution etc,

download the script.bin file

# cp script.bin /mnt/sd
# sync
# umount /dev/sdX1

8. Debian rootfs

The Linux Kernel and Uboot are ready, now we have need from Linux distribution rootfs.

Basically the only difference between the different Linux distributions is the rootfs, so if you put Debian rootfs you will have Debian, if you put Ubuntu rootfs it will be Ubuntu etc.

How to build one is a long topic, the good thing is that there are many already pre-built so we can just download one and use.

exit the kernel directory

# cd ..

You should be in the directory below

# /home/user/A13-OLinuXino_kernel_34/

download debian rootfs – a13_olinuxino_debian_fs_kernel_34_75_rel_9.tgz

mount your sd card EXT3 FS partition:

# mkdir /mnt/sd
# mount /dev/sdX2 /mnt/sd

and unarchive the rootfs

# tar xzvf a13_olinuxino_debian_fs_kernel_34_75.tgz -C /mnt/sd
# ls /mnt/sd

the right result should be:

bin dev home lost+found mnt proc run selinux sys usr
boot etc lib media opt root sbin srv tmp var

Now you have to replace the new generated kernel modules from /home/user/A13-OLinuXino_kernel_34/linux-sunxi/out/lib/modules/ to the new debian file system

# rm -rf /mnt/sd/lib/modules/*
# cp -rfv linux-sunxi/out/lib/modules/3.x.xx+/ /mnt/sd/lib/modules/

where x.xx is the kernel version
in our case:

# cp -rfv linux-sunxi/out/lib/modules/3.4.75+/ /mnt/sd/lib/modules/
# sync
# umount /mnt/sdX2

at this point you have Debian on your SD card second partition and
you have an SD card ready to boot debian on A13-OLinuXino

Connect USB-SERIAL-CABLE-F to UEXT Tx.Rx and GND, or connect a VGA screen. Put the SD-card in A10-OLinuXino-Micro and apply 5V power, you should see Uboot and then Kernel messages on the console

default username/password is : root / olimex

For these who do not want to go through all these steps the prebuilt image is linked on our A13-OLinuXino WiKi page.

New Debian image with Armel and Mono-complete is available

Image

There are lot of people who do .NET programming and the Linux alternative MONO. For some weird reason MONO is not working on armhf default Debian distribution which we use (as armhf performs better we ignored so far armel).

We got number of requests from customers who want to program OLinuXino with MONO if we can help with building armel Debian distribution and Dimitar Gamishev completed this few days ago.

With Debian armel mono-complete is installing without problems and we prepared image with it pre-installed. The image is on the Wiki page. Note this Debian should be slower than official armhf Debian as do not use the float point co-processor. Anyway if you want to develop with .NET and MONO armel is the only option. I bet armhf doesn’t work with MONO for some silly library reason, if someone have more knowledge he may dig a bit and fix what is wrong, but for the moment we have something which works!

We are going to release armel for A10 and A20 too, please be patient these images are huge and we triple check all GPIOs and other features work correctly before upload to WIKI.

1. Install on SD card

Note: You should use 4GB Class10 fast micro sd-card to write this image.

The image is Debian linux with kernel 3.4.67+

Default login/password: rootolimex

The file A13_debian_armel_34_67_WIFI_GCC_GPIO_IN_OUT_I2C_100KHz_UVC_python_TS_release_1.7z is an archive of A13_debian_armel_34_67_WIFI_GCC_GPIO_IN_OUT_I2C_100KHz_UVC_python_TS_release_1.img file.

So in order to write the image on SD card you have to unzip A13_debian_armel_34_67_WIFI_GCC_GPIO_IN_OUT_I2C_100KHz_UVC_python_TS_release_1.7z file:

1.1 For Windows

Use 7zip and then use Win32DiskImager.exe for image writing.

1.2 For Linux

Use p7zip package. If you have no installed 7zip then type

#apt-get install p7zip

Copy A13_debian_armel_34_67_WIFI_GCC_GPIO_IN_OUT_I2C_100KHz_UVC_python_TS_release_1.7z file in your directory and unzip it with

#7za e A13_debian_armel_34_67_WIFI_GCC_GPIO_IN_OUT_I2C_100KHz_UVC_python_TS_release_1.7z

The output should be a new 4GB file named A13_debian_armel_34_67_WIFI_GCC_GPIO_IN_OUT_I2C_100KHz_UVC_python_TS_release_1.img

Put 4GB SD card in your card reader and type:

# ls /dev/sd

Then press two times <TAB> you will see a list of your sd devices like sda sdb sdc note that some of these devices may be your hard disk so make sure you know which one is your sd card before you proceed as you can damage your HDD if you choose the wrong sd-device. You can do this by unplugging your sd card reader and identify which “sd” devices remove from the list.
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:

#dd if=A13_debian_armel_34_67_WIFI_GCC_GPIO_IN_OUT_I2C_100KHz_UVC_python_TS_release_1.img of=/dev/sdX

The main installed packages are listed below:

  • Mplayer CLI
  • GCC 4.6
  • dpkg
  • git
  • i2c-tools
  • perl
  • Python 2.7
  • mono-complete
  • sunxi-tools (in /opt/sunxi-tools/)

The main tested onboard hardware modules are:

  • GPIO – they are located in /sys/class/gpio directory. Note that first you have to export GPIOs.
  • LCD – 4.3″(480×272), 7″(800×480), 10″(1024×600)
  • Touch_screen – you need calibrate LCD before using touch screen. Type: ts_calibrate and then test it with ts_test
  • ASIX8877 USB-LAN
  • WEB camera A4TECH
  • TL-WN721(TP-LINK USB wireless)
  • WIFI_RTL8188
  • USB_OTG – low/full/high USB host
  • USB_HOST1,2,3 – low/full/high USB host
  • mico_SD_card – used to boot Linux
  • Headphone OUT – Audio output for 60 ohm headphones
  • MIC IN – microphone input
  • I2C2(100KHz) – /dev/i2c-2
  • I2C1(100KHz) – /dev/i2c-1
  • UART1 – /dev/ttyS0
  • UART3 – /dev/ttyS1

Changing A13-OLinuxino LCD or VGA resolution

The default SD card setup is made with settings for LCD 7”(800×480). If you want to change some other LCD or VGA resolution then you have to start change_display_a13.sh script file in /root directory.
Type:
# ./change_display_a13.sh

and choose the desired resolution of desired interface(LCD or VGA)
The supported resolution are:

LCD:
1. 4.3”(480×272)
2. 7”(800×480)
3. 10”(1024×600)

VGA:
0. 1024×768
1. 800×600

New Product in stock: MOD-USB3G

Image

MOD-USB3G is 3G wireless modem with these features:

    • SIMcard connector
    • microSD card connector where cards up to 8GB can be put and will be visible as mass storage
    • HSUPA/HSDPA/WCDMA-850-1900-2100Mhz
    • GSM/GPRS/EDGE 850-900-1800-1900Mhz
    • HSUPA Dn 7.2Mbps Up 5.76Mbps
    • HSDPA Dn 7.2Mbps UP: 384kbps
    • EDGE Dn 236.8kbps
    • Support Voice and SMS
    • USB
    • Supported by A13/A10S/A20 Debian and Android
    • Size 88x26x12mm

We tested MOD-USB3G and it works with all A13/A10S/A20 OLinuXino we have both with Android and with Debian images. Now you can have mobile Internet connection with good speed everywhere you go. MOD-USB3G will work with your laptop and desktop computers too.

The low cost EUR 15 makes all these old GSM/GPRS solutions with Telit/Simcom etc look expensive, slow and obsolete.

Sneak preview of A13-SOM

Image

A13-SOM is the next System On Module which we work on. It will be offered in two versions with 256MB and with 512MB of RAM.

A13-SOM have:

  • A13 Cortex-A8 SoC @ 1Ghz, NEON, GPU, VPU, MALI400
  • DDR3 RAM (256 or 512MB)
  • micro SD-card connector
  • power supply circuit
  • console UART connector
  • RESET and BOOT buttons
  • status LED
  • LCD connector
  • GPIO connectors
  • size 60x30mm

With size of just 60×30 mm A13-SOM will allow rapid design of compact and handheld Linux devices.

All GPIOs and LCD ports are available on connectors with 0.05″ the same used in A20-SOM and AM3352-SOM.

Three stackable snap-on PCBs will be available also:

  • Flash module with 4GB NAND Flash and/or 16MB Serial SPI flash where A13 could boot from
  • WIFI module with RTL8188CUS and LiPo charger/Lipo battery
  • Wired Ethernet 100 MB + 3 USB hosts module

any of these could snap-on together on top of A13-SOM

The prices of A13-SOM are not yet finalized, but our target is to start from EUR 15 for 1000 pcs. The production of A13-SOM and the stackable modules is planned for November.

Fedora support for A10, A10S, A13 and A20 SoC from Allwinner

Image

Hans de Goede is Fedora Linux maintainer and one of the very active members of Linux-Sunxi community which does the community Linux support for Allwinner SoCs.

He recently announced Fedora 19 is available for Allwinner A10, A10s, A13, A20 https://groups.google.com/forum/#!topic/linux-sunxi/PLgUj-KefKQ

If you want to try it you can download the image from:

http://scotland.proximity.on.ca/contrib-images/hansg/Fedora-19-a10-armhfp-r1.img.xz

then write it to SD card 8GB or bigger, 38 boards are supported including all OLinuXinos

If you want to build Fedora from sources yourself you can use this script Fedora image yourself by using the scripts available at

https://github.com/jwrdegoede/sunxi-fedora-scripts.git

source: cnx-soft blog

Embedded GUI with A13-OLinuXino LCD4.3″TS and Embedded Qt

Nick Guthrie posted on our forum for his project https://www.olimex.com/forum/index.php?topic=1595.0#msg7254
His school funded him to work on summer Open Source project to make howto for using Embedded Qt, his documents are at:

http://nickguthrie.com/embedd_gui/doc/

He had documented the entire process including building the cross-compiling toolchain, installing Debian, installing Qt, and building and running applications. He is also preparing binaries which could be upload and used on A13 with 4.3″ LCD.

Video

A13 Touchscreen support for Debian

Image

I posted for how to add Touchscreen support for Debian for A13 in December 2012, but things changed a bit since then so I got GitHub pull request from Nikita Maslov. We tested his patches and they work fine on A13 so his request was pull and merged in our GitHub account.

On top of this he made small post on his blog how to implement it, which I link here: http://www.dimrobotics.com/2013/06/olinuxino-a13-touchscreen-support-in.html

Complete range of Allwinner SoC now are in our online shop

Image

https://www.olimex.com/Products/Components/IC/

In our IC section now you can buy all of Allwinner SoC in single quantity: A10, A10S, A13, A20 and A31, together with Power Managment ICs necessary for their operation: AXP152 for A10S, AXP209 for A10, A13, A20 and the monster AXP221 with 21 programmable voltages for A31.

DCDC step up and down converters, USB power management and current limiters, DDR3 and NAND flash, everything you need to build your Linux prototype is available.

A13-OLinuXino + A13-LCD7″TS + QT5 video

Found this video on youtube, looks amazing.
Miroslav Bendik has a few more videos and projects with A13-OLinuXino:

https://plus.google.com/115147343948842453031/posts

Video

Previous Older Entries

Follow

Get every new post delivered to your Inbox.

Join 459 other followers