<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.olimex.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Scott</id>
	<title>Olimex - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.olimex.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Scott"/>
	<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/Special:Contributions/Scott"/>
	<updated>2026-05-12T21:21:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1236</id>
		<title>Build Bootable SD Card with Debian</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1236"/>
		<updated>2014-06-09T03:34:38Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Building Uboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The A13-OLinuXino-WIFI board ships with pre-loaded Android 4.0.3 image on the NAND flash, so it runs out of the box and you can have access to millions of applications on Google Play.&lt;br /&gt;
&lt;br /&gt;
There are also prebuilt SD card images that will boot to debian, they are linked to on the main A13 wiki page. These are suitable for anyone that doesn't want special kernel options.&lt;br /&gt;
&lt;br /&gt;
For those who want to use and develop on this board with Linux and require non standard kernel configurations this wiki explains step by step instructions to create an SD-card image that boots Debian on A13-OLinuXino. Big thanks to Dimitar Gamishev who initially demonstrated the whole build process. &lt;br /&gt;
&lt;br /&gt;
Note: The content is largely taken from this page of instructions&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ building bootable sd card with debian linux image for a13 olinuxino]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/FirstSteps U-boot Sunxi Wiki with detailed info]&lt;br /&gt;
&lt;br /&gt;
== Tools required ==&lt;br /&gt;
&lt;br /&gt;
* A13-OLinuXino or A13-OLinuXino-WIFI&lt;br /&gt;
* Micro SD card larger than 2g&lt;br /&gt;
* A method to check the system worked, VGA screen or serial cable&lt;br /&gt;
* A computer that can run linux (These instructions do not work for windows)&lt;br /&gt;
Note: you can install Ubuntu freely to work on a machine that currently has windows. You will have the option to boot to either windows or linux&lt;br /&gt;
* Method to read or write to a Micro SD card from this computer.&lt;br /&gt;
* An internet connection for the linux computer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
===Setup of the toolchain===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-arm-linux-gnueabihf ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# Older (prior to 2013): apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make CROSS_COMPILE=arm-linux-gnueabihf- A13-OLinuXino_config&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make CROSS_COMPILE=arm-linux-gnueabihf-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# (Older (prior 2013): make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see A13-OLinuXino already have support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Building the Kernel===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community Kernel is maintained by Alejandro Mery aka mnemoc on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
Let’s first go back from uboot directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then download the Kernel sources, you should use  allwinner-v3.0-android-v2 branch, the sources are about 700 MB so you will have to wait a bit longer with this download:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone https://github.com/linux-sunxi/linux-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download go to the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd linux-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the a13_configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm a13_defconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
as you see A13-OLinuXino have pre-made configuration in the community kernel sources&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm menuconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this command you can add or remove different modules for the different peripherials in the kernel, be careful when use this as this may cause the kernel to not work properly&lt;br /&gt;
&lt;br /&gt;
The menuconfig created a .config text file, which you can view/edit even with a text editor like vi&lt;br /&gt;
&lt;br /&gt;
if you want to use GPIOs for instance they are not enabled by default and you can do this by adding:&lt;br /&gt;
&lt;br /&gt;
SUN4I_GPIO_UGLY = y inside .config&lt;br /&gt;
&lt;br /&gt;
then you can contiue with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when this finish's you will have uImage ready and you can build the kernel modules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules_install&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DONE! At this point you have uboot and kernel builds ready.&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048 and ending to 34815&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048 end 34815&lt;br /&gt;
&lt;br /&gt;
create second partition&lt;br /&gt;
&lt;br /&gt;
5. n p 2 enter enter&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
if you did everything correctly you should see something like:&lt;br /&gt;
&lt;br /&gt;
Disk /dev/sdX: 2001 MB, 2001731584 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
42 heads, 41 sectors/track, 2270 cylinders, total 3909632 sectors&amp;lt;br /&amp;gt;&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Disk identifier: 0×00000000&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device Boot Start End Blocks Id System&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX1 2048 34815 16384 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX2 34816 3909631 1937408 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then write the partititons to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which the Allwinner bootloader understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second should be normal Linux EXT3 FS&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.ext3 /dev/sdX2&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debian rootfs===&lt;br /&gt;
&lt;br /&gt;
The Linux Kernel and Uboot are ready, now we have the Linux distribution rootfs, 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.&lt;br /&gt;
&lt;br /&gt;
exit the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download debian rootfs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# wget http://hands.com/~lkcl/mele_debian_armhf_minimal.cpio.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mount your sd card EXT3 FS partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX2 /mnt&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and unarchive the rootfs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# gunzip -c /home/user/olinuxino/mele_debian_armhf_minimal.cpio.gz | cpio -i&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;quot;user&amp;quot; is the user name of your root user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
at this point you have Debian on your SD card second partition&lt;br /&gt;
&lt;br /&gt;
===Write Uboot and Kernel you build===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX1 /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the Kernel uImage to root directory in partition 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cp linux-allwinner/arch/arm/boot/uImage /mnt/.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download the script.bin from: &lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin]&lt;br /&gt;
&lt;br /&gt;
and copy it to the same directory as uImage&lt;br /&gt;
&lt;br /&gt;
script.bin is a text file with very important configuration parameters like port GPIO assignments, DDR memory parameters, Video resolution etc, by changing these parameters in the script.bin you can configure your Linux without need to re-compile your kernel again and again this is smart way Allwinner provide for tweaking A13 Linux Kernel&lt;br /&gt;
&lt;br /&gt;
write the Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and copy the Kernel modules for partition 2&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# mount /dev/sdX2 /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cp -a linux-allwinner/out/lib/modules/3.0.42+/ /mnt/lib/modules/.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have an SD card ready to boot debian on A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
Connect USB-SERIAL-CABLE-F to UEXT Tx.Rx and GND, or connect a VGA screen. Put the SD-card in A13-OLinuXino(-WIFI) and apply power, you should see Uboot and then Kernel messages on the console&lt;br /&gt;
&lt;br /&gt;
default username/password is : root / password&lt;br /&gt;
&lt;br /&gt;
== Software Links ==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Linux Linux Sunxi] to build latest Kernel yourself&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/U-boot U-boot] to build community U-boot&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ Building bootable Debian SD card for A13-OLinuXino] Original step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=518.0 Forum post ] with yet another more up to date explanation how to build SD card&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1235</id>
		<title>Build Bootable SD Card with Debian</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1235"/>
		<updated>2014-06-09T03:34:08Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Building Uboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The A13-OLinuXino-WIFI board ships with pre-loaded Android 4.0.3 image on the NAND flash, so it runs out of the box and you can have access to millions of applications on Google Play.&lt;br /&gt;
&lt;br /&gt;
There are also prebuilt SD card images that will boot to debian, they are linked to on the main A13 wiki page. These are suitable for anyone that doesn't want special kernel options.&lt;br /&gt;
&lt;br /&gt;
For those who want to use and develop on this board with Linux and require non standard kernel configurations this wiki explains step by step instructions to create an SD-card image that boots Debian on A13-OLinuXino. Big thanks to Dimitar Gamishev who initially demonstrated the whole build process. &lt;br /&gt;
&lt;br /&gt;
Note: The content is largely taken from this page of instructions&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ building bootable sd card with debian linux image for a13 olinuxino]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/FirstSteps U-boot Sunxi Wiki with detailed info]&lt;br /&gt;
&lt;br /&gt;
== Tools required ==&lt;br /&gt;
&lt;br /&gt;
* A13-OLinuXino or A13-OLinuXino-WIFI&lt;br /&gt;
* Micro SD card larger than 2g&lt;br /&gt;
* A method to check the system worked, VGA screen or serial cable&lt;br /&gt;
* A computer that can run linux (These instructions do not work for windows)&lt;br /&gt;
Note: you can install Ubuntu freely to work on a machine that currently has windows. You will have the option to boot to either windows or linux&lt;br /&gt;
* Method to read or write to a Micro SD card from this computer.&lt;br /&gt;
* An internet connection for the linux computer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
===Setup of the toolchain===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-arm-linux-gnueabihf ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# Older (prior to 2013): apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make CROSS_COMPILE=arm-linux-gnueabihf- A13-OLinuXino_config&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make CROSS_COMPILE=arm-linux-gnueabihf-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# (Older (prior 2013): make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see A13-OLinuXino already have support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Building the Kernel===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community Kernel is maintained by Alejandro Mery aka mnemoc on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
Let’s first go back from uboot directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then download the Kernel sources, you should use  allwinner-v3.0-android-v2 branch, the sources are about 700 MB so you will have to wait a bit longer with this download:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone https://github.com/linux-sunxi/linux-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download go to the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd linux-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the a13_configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm a13_defconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
as you see A13-OLinuXino have pre-made configuration in the community kernel sources&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm menuconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this command you can add or remove different modules for the different peripherials in the kernel, be careful when use this as this may cause the kernel to not work properly&lt;br /&gt;
&lt;br /&gt;
The menuconfig created a .config text file, which you can view/edit even with a text editor like vi&lt;br /&gt;
&lt;br /&gt;
if you want to use GPIOs for instance they are not enabled by default and you can do this by adding:&lt;br /&gt;
&lt;br /&gt;
SUN4I_GPIO_UGLY = y inside .config&lt;br /&gt;
&lt;br /&gt;
then you can contiue with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when this finish's you will have uImage ready and you can build the kernel modules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules_install&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DONE! At this point you have uboot and kernel builds ready.&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048 and ending to 34815&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048 end 34815&lt;br /&gt;
&lt;br /&gt;
create second partition&lt;br /&gt;
&lt;br /&gt;
5. n p 2 enter enter&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
if you did everything correctly you should see something like:&lt;br /&gt;
&lt;br /&gt;
Disk /dev/sdX: 2001 MB, 2001731584 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
42 heads, 41 sectors/track, 2270 cylinders, total 3909632 sectors&amp;lt;br /&amp;gt;&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Disk identifier: 0×00000000&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device Boot Start End Blocks Id System&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX1 2048 34815 16384 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX2 34816 3909631 1937408 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then write the partititons to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which the Allwinner bootloader understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second should be normal Linux EXT3 FS&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.ext3 /dev/sdX2&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debian rootfs===&lt;br /&gt;
&lt;br /&gt;
The Linux Kernel and Uboot are ready, now we have the Linux distribution rootfs, 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.&lt;br /&gt;
&lt;br /&gt;
exit the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download debian rootfs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# wget http://hands.com/~lkcl/mele_debian_armhf_minimal.cpio.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mount your sd card EXT3 FS partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX2 /mnt&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and unarchive the rootfs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# gunzip -c /home/user/olinuxino/mele_debian_armhf_minimal.cpio.gz | cpio -i&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;quot;user&amp;quot; is the user name of your root user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
at this point you have Debian on your SD card second partition&lt;br /&gt;
&lt;br /&gt;
===Write Uboot and Kernel you build===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX1 /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the Kernel uImage to root directory in partition 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cp linux-allwinner/arch/arm/boot/uImage /mnt/.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download the script.bin from: &lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin]&lt;br /&gt;
&lt;br /&gt;
and copy it to the same directory as uImage&lt;br /&gt;
&lt;br /&gt;
script.bin is a text file with very important configuration parameters like port GPIO assignments, DDR memory parameters, Video resolution etc, by changing these parameters in the script.bin you can configure your Linux without need to re-compile your kernel again and again this is smart way Allwinner provide for tweaking A13 Linux Kernel&lt;br /&gt;
&lt;br /&gt;
write the Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and copy the Kernel modules for partition 2&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# mount /dev/sdX2 /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cp -a linux-allwinner/out/lib/modules/3.0.42+/ /mnt/lib/modules/.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have an SD card ready to boot debian on A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
Connect USB-SERIAL-CABLE-F to UEXT Tx.Rx and GND, or connect a VGA screen. Put the SD-card in A13-OLinuXino(-WIFI) and apply power, you should see Uboot and then Kernel messages on the console&lt;br /&gt;
&lt;br /&gt;
default username/password is : root / password&lt;br /&gt;
&lt;br /&gt;
== Software Links ==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Linux Linux Sunxi] to build latest Kernel yourself&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/U-boot U-boot] to build community U-boot&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ Building bootable Debian SD card for A13-OLinuXino] Original step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=518.0 Forum post ] with yet another more up to date explanation how to build SD card&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1234</id>
		<title>Build Bootable SD Card with Debian</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1234"/>
		<updated>2014-06-09T03:33:29Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Building Uboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The A13-OLinuXino-WIFI board ships with pre-loaded Android 4.0.3 image on the NAND flash, so it runs out of the box and you can have access to millions of applications on Google Play.&lt;br /&gt;
&lt;br /&gt;
There are also prebuilt SD card images that will boot to debian, they are linked to on the main A13 wiki page. These are suitable for anyone that doesn't want special kernel options.&lt;br /&gt;
&lt;br /&gt;
For those who want to use and develop on this board with Linux and require non standard kernel configurations this wiki explains step by step instructions to create an SD-card image that boots Debian on A13-OLinuXino. Big thanks to Dimitar Gamishev who initially demonstrated the whole build process. &lt;br /&gt;
&lt;br /&gt;
Note: The content is largely taken from this page of instructions&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ building bootable sd card with debian linux image for a13 olinuxino]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/FirstSteps U-boot Sunxi Wiki with detailed info]&lt;br /&gt;
&lt;br /&gt;
== Tools required ==&lt;br /&gt;
&lt;br /&gt;
* A13-OLinuXino or A13-OLinuXino-WIFI&lt;br /&gt;
* Micro SD card larger than 2g&lt;br /&gt;
* A method to check the system worked, VGA screen or serial cable&lt;br /&gt;
* A computer that can run linux (These instructions do not work for windows)&lt;br /&gt;
Note: you can install Ubuntu freely to work on a machine that currently has windows. You will have the option to boot to either windows or linux&lt;br /&gt;
* Method to read or write to a Micro SD card from this computer.&lt;br /&gt;
* An internet connection for the linux computer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
===Setup of the toolchain===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-arm-linux-gnueabihf ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# Older (prior to 2013): apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make CROSS_COMPILE=arm-linux-gnueabihf- A13-OLinuXino_config&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make CROSS_COMPILE=arm-linux-gnueabihf-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# (Older (prior 2013): make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi&lt;br /&gt;
&lt;br /&gt;
As you can see A13-OLinuXino already have support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Building the Kernel===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community Kernel is maintained by Alejandro Mery aka mnemoc on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
Let’s first go back from uboot directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then download the Kernel sources, you should use  allwinner-v3.0-android-v2 branch, the sources are about 700 MB so you will have to wait a bit longer with this download:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone https://github.com/linux-sunxi/linux-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download go to the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd linux-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the a13_configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm a13_defconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
as you see A13-OLinuXino have pre-made configuration in the community kernel sources&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm menuconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this command you can add or remove different modules for the different peripherials in the kernel, be careful when use this as this may cause the kernel to not work properly&lt;br /&gt;
&lt;br /&gt;
The menuconfig created a .config text file, which you can view/edit even with a text editor like vi&lt;br /&gt;
&lt;br /&gt;
if you want to use GPIOs for instance they are not enabled by default and you can do this by adding:&lt;br /&gt;
&lt;br /&gt;
SUN4I_GPIO_UGLY = y inside .config&lt;br /&gt;
&lt;br /&gt;
then you can contiue with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when this finish's you will have uImage ready and you can build the kernel modules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules_install&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DONE! At this point you have uboot and kernel builds ready.&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048 and ending to 34815&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048 end 34815&lt;br /&gt;
&lt;br /&gt;
create second partition&lt;br /&gt;
&lt;br /&gt;
5. n p 2 enter enter&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
if you did everything correctly you should see something like:&lt;br /&gt;
&lt;br /&gt;
Disk /dev/sdX: 2001 MB, 2001731584 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
42 heads, 41 sectors/track, 2270 cylinders, total 3909632 sectors&amp;lt;br /&amp;gt;&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Disk identifier: 0×00000000&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device Boot Start End Blocks Id System&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX1 2048 34815 16384 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX2 34816 3909631 1937408 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then write the partititons to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which the Allwinner bootloader understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second should be normal Linux EXT3 FS&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.ext3 /dev/sdX2&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debian rootfs===&lt;br /&gt;
&lt;br /&gt;
The Linux Kernel and Uboot are ready, now we have the Linux distribution rootfs, 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.&lt;br /&gt;
&lt;br /&gt;
exit the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download debian rootfs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# wget http://hands.com/~lkcl/mele_debian_armhf_minimal.cpio.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mount your sd card EXT3 FS partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX2 /mnt&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and unarchive the rootfs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# gunzip -c /home/user/olinuxino/mele_debian_armhf_minimal.cpio.gz | cpio -i&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;quot;user&amp;quot; is the user name of your root user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
at this point you have Debian on your SD card second partition&lt;br /&gt;
&lt;br /&gt;
===Write Uboot and Kernel you build===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX1 /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the Kernel uImage to root directory in partition 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cp linux-allwinner/arch/arm/boot/uImage /mnt/.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download the script.bin from: &lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin]&lt;br /&gt;
&lt;br /&gt;
and copy it to the same directory as uImage&lt;br /&gt;
&lt;br /&gt;
script.bin is a text file with very important configuration parameters like port GPIO assignments, DDR memory parameters, Video resolution etc, by changing these parameters in the script.bin you can configure your Linux without need to re-compile your kernel again and again this is smart way Allwinner provide for tweaking A13 Linux Kernel&lt;br /&gt;
&lt;br /&gt;
write the Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and copy the Kernel modules for partition 2&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# mount /dev/sdX2 /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cp -a linux-allwinner/out/lib/modules/3.0.42+/ /mnt/lib/modules/.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have an SD card ready to boot debian on A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
Connect USB-SERIAL-CABLE-F to UEXT Tx.Rx and GND, or connect a VGA screen. Put the SD-card in A13-OLinuXino(-WIFI) and apply power, you should see Uboot and then Kernel messages on the console&lt;br /&gt;
&lt;br /&gt;
default username/password is : root / password&lt;br /&gt;
&lt;br /&gt;
== Software Links ==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Linux Linux Sunxi] to build latest Kernel yourself&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/U-boot U-boot] to build community U-boot&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ Building bootable Debian SD card for A13-OLinuXino] Original step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=518.0 Forum post ] with yet another more up to date explanation how to build SD card&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1233</id>
		<title>Build Bootable SD Card with Debian</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1233"/>
		<updated>2014-06-09T03:32:18Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Building Uboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The A13-OLinuXino-WIFI board ships with pre-loaded Android 4.0.3 image on the NAND flash, so it runs out of the box and you can have access to millions of applications on Google Play.&lt;br /&gt;
&lt;br /&gt;
There are also prebuilt SD card images that will boot to debian, they are linked to on the main A13 wiki page. These are suitable for anyone that doesn't want special kernel options.&lt;br /&gt;
&lt;br /&gt;
For those who want to use and develop on this board with Linux and require non standard kernel configurations this wiki explains step by step instructions to create an SD-card image that boots Debian on A13-OLinuXino. Big thanks to Dimitar Gamishev who initially demonstrated the whole build process. &lt;br /&gt;
&lt;br /&gt;
Note: The content is largely taken from this page of instructions&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ building bootable sd card with debian linux image for a13 olinuxino]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/FirstSteps U-boot Sunxi Wiki with detailed info]&lt;br /&gt;
&lt;br /&gt;
== Tools required ==&lt;br /&gt;
&lt;br /&gt;
* A13-OLinuXino or A13-OLinuXino-WIFI&lt;br /&gt;
* Micro SD card larger than 2g&lt;br /&gt;
* A method to check the system worked, VGA screen or serial cable&lt;br /&gt;
* A computer that can run linux (These instructions do not work for windows)&lt;br /&gt;
Note: you can install Ubuntu freely to work on a machine that currently has windows. You will have the option to boot to either windows or linux&lt;br /&gt;
* Method to read or write to a Micro SD card from this computer.&lt;br /&gt;
* An internet connection for the linux computer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
===Setup of the toolchain===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-arm-linux-gnueabihf ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# Older (prior to 2013): apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make CROSS_COMPILE=arm-linux-gnueabihf- A13-OLinuXino_config&amp;lt;/nowiki&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make CROSS_COMPILE=arm-linux-gnueabihf-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see A13-OLinuXino already have support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Building the Kernel===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community Kernel is maintained by Alejandro Mery aka mnemoc on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
Let’s first go back from uboot directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then download the Kernel sources, you should use  allwinner-v3.0-android-v2 branch, the sources are about 700 MB so you will have to wait a bit longer with this download:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone https://github.com/linux-sunxi/linux-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download go to the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd linux-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the a13_configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm a13_defconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
as you see A13-OLinuXino have pre-made configuration in the community kernel sources&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm menuconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this command you can add or remove different modules for the different peripherials in the kernel, be careful when use this as this may cause the kernel to not work properly&lt;br /&gt;
&lt;br /&gt;
The menuconfig created a .config text file, which you can view/edit even with a text editor like vi&lt;br /&gt;
&lt;br /&gt;
if you want to use GPIOs for instance they are not enabled by default and you can do this by adding:&lt;br /&gt;
&lt;br /&gt;
SUN4I_GPIO_UGLY = y inside .config&lt;br /&gt;
&lt;br /&gt;
then you can contiue with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when this finish's you will have uImage ready and you can build the kernel modules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules_install&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DONE! At this point you have uboot and kernel builds ready.&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048 and ending to 34815&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048 end 34815&lt;br /&gt;
&lt;br /&gt;
create second partition&lt;br /&gt;
&lt;br /&gt;
5. n p 2 enter enter&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
if you did everything correctly you should see something like:&lt;br /&gt;
&lt;br /&gt;
Disk /dev/sdX: 2001 MB, 2001731584 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
42 heads, 41 sectors/track, 2270 cylinders, total 3909632 sectors&amp;lt;br /&amp;gt;&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Disk identifier: 0×00000000&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device Boot Start End Blocks Id System&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX1 2048 34815 16384 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX2 34816 3909631 1937408 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then write the partititons to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which the Allwinner bootloader understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second should be normal Linux EXT3 FS&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.ext3 /dev/sdX2&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debian rootfs===&lt;br /&gt;
&lt;br /&gt;
The Linux Kernel and Uboot are ready, now we have the Linux distribution rootfs, 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.&lt;br /&gt;
&lt;br /&gt;
exit the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download debian rootfs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# wget http://hands.com/~lkcl/mele_debian_armhf_minimal.cpio.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mount your sd card EXT3 FS partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX2 /mnt&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and unarchive the rootfs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# gunzip -c /home/user/olinuxino/mele_debian_armhf_minimal.cpio.gz | cpio -i&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;quot;user&amp;quot; is the user name of your root user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
at this point you have Debian on your SD card second partition&lt;br /&gt;
&lt;br /&gt;
===Write Uboot and Kernel you build===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX1 /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the Kernel uImage to root directory in partition 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cp linux-allwinner/arch/arm/boot/uImage /mnt/.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download the script.bin from: &lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin]&lt;br /&gt;
&lt;br /&gt;
and copy it to the same directory as uImage&lt;br /&gt;
&lt;br /&gt;
script.bin is a text file with very important configuration parameters like port GPIO assignments, DDR memory parameters, Video resolution etc, by changing these parameters in the script.bin you can configure your Linux without need to re-compile your kernel again and again this is smart way Allwinner provide for tweaking A13 Linux Kernel&lt;br /&gt;
&lt;br /&gt;
write the Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and copy the Kernel modules for partition 2&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# mount /dev/sdX2 /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cp -a linux-allwinner/out/lib/modules/3.0.42+/ /mnt/lib/modules/.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have an SD card ready to boot debian on A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
Connect USB-SERIAL-CABLE-F to UEXT Tx.Rx and GND, or connect a VGA screen. Put the SD-card in A13-OLinuXino(-WIFI) and apply power, you should see Uboot and then Kernel messages on the console&lt;br /&gt;
&lt;br /&gt;
default username/password is : root / password&lt;br /&gt;
&lt;br /&gt;
== Software Links ==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Linux Linux Sunxi] to build latest Kernel yourself&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/U-boot U-boot] to build community U-boot&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ Building bootable Debian SD card for A13-OLinuXino] Original step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=518.0 Forum post ] with yet another more up to date explanation how to build SD card&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1232</id>
		<title>Build Bootable SD Card with Debian</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1232"/>
		<updated>2014-06-09T03:28:00Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Building Uboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The A13-OLinuXino-WIFI board ships with pre-loaded Android 4.0.3 image on the NAND flash, so it runs out of the box and you can have access to millions of applications on Google Play.&lt;br /&gt;
&lt;br /&gt;
There are also prebuilt SD card images that will boot to debian, they are linked to on the main A13 wiki page. These are suitable for anyone that doesn't want special kernel options.&lt;br /&gt;
&lt;br /&gt;
For those who want to use and develop on this board with Linux and require non standard kernel configurations this wiki explains step by step instructions to create an SD-card image that boots Debian on A13-OLinuXino. Big thanks to Dimitar Gamishev who initially demonstrated the whole build process. &lt;br /&gt;
&lt;br /&gt;
Note: The content is largely taken from this page of instructions&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ building bootable sd card with debian linux image for a13 olinuxino]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/FirstSteps U-boot Sunxi Wiki with detailed info]&lt;br /&gt;
&lt;br /&gt;
== Tools required ==&lt;br /&gt;
&lt;br /&gt;
* A13-OLinuXino or A13-OLinuXino-WIFI&lt;br /&gt;
* Micro SD card larger than 2g&lt;br /&gt;
* A method to check the system worked, VGA screen or serial cable&lt;br /&gt;
* A computer that can run linux (These instructions do not work for windows)&lt;br /&gt;
Note: you can install Ubuntu freely to work on a machine that currently has windows. You will have the option to boot to either windows or linux&lt;br /&gt;
* Method to read or write to a Micro SD card from this computer.&lt;br /&gt;
* An internet connection for the linux computer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
===Setup of the toolchain===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-arm-linux-gnueabihf ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# Older (prior to 2013): apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make CROSS_COMPILE=arm-linux-gnueabihf- A13-OLinuXino_config&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make CROSS_COMPILE=arm-linux-gnueabihf-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see A13-OLinuXino already have support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Building the Kernel===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community Kernel is maintained by Alejandro Mery aka mnemoc on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
Let’s first go back from uboot directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then download the Kernel sources, you should use  allwinner-v3.0-android-v2 branch, the sources are about 700 MB so you will have to wait a bit longer with this download:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone https://github.com/linux-sunxi/linux-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download go to the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd linux-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the a13_configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm a13_defconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
as you see A13-OLinuXino have pre-made configuration in the community kernel sources&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm menuconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this command you can add or remove different modules for the different peripherials in the kernel, be careful when use this as this may cause the kernel to not work properly&lt;br /&gt;
&lt;br /&gt;
The menuconfig created a .config text file, which you can view/edit even with a text editor like vi&lt;br /&gt;
&lt;br /&gt;
if you want to use GPIOs for instance they are not enabled by default and you can do this by adding:&lt;br /&gt;
&lt;br /&gt;
SUN4I_GPIO_UGLY = y inside .config&lt;br /&gt;
&lt;br /&gt;
then you can contiue with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when this finish's you will have uImage ready and you can build the kernel modules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules_install&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DONE! At this point you have uboot and kernel builds ready.&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048 and ending to 34815&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048 end 34815&lt;br /&gt;
&lt;br /&gt;
create second partition&lt;br /&gt;
&lt;br /&gt;
5. n p 2 enter enter&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
if you did everything correctly you should see something like:&lt;br /&gt;
&lt;br /&gt;
Disk /dev/sdX: 2001 MB, 2001731584 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
42 heads, 41 sectors/track, 2270 cylinders, total 3909632 sectors&amp;lt;br /&amp;gt;&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Disk identifier: 0×00000000&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device Boot Start End Blocks Id System&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX1 2048 34815 16384 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX2 34816 3909631 1937408 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then write the partititons to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which the Allwinner bootloader understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second should be normal Linux EXT3 FS&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.ext3 /dev/sdX2&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debian rootfs===&lt;br /&gt;
&lt;br /&gt;
The Linux Kernel and Uboot are ready, now we have the Linux distribution rootfs, 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.&lt;br /&gt;
&lt;br /&gt;
exit the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download debian rootfs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# wget http://hands.com/~lkcl/mele_debian_armhf_minimal.cpio.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mount your sd card EXT3 FS partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX2 /mnt&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and unarchive the rootfs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# gunzip -c /home/user/olinuxino/mele_debian_armhf_minimal.cpio.gz | cpio -i&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;quot;user&amp;quot; is the user name of your root user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
at this point you have Debian on your SD card second partition&lt;br /&gt;
&lt;br /&gt;
===Write Uboot and Kernel you build===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX1 /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the Kernel uImage to root directory in partition 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cp linux-allwinner/arch/arm/boot/uImage /mnt/.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download the script.bin from: &lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin]&lt;br /&gt;
&lt;br /&gt;
and copy it to the same directory as uImage&lt;br /&gt;
&lt;br /&gt;
script.bin is a text file with very important configuration parameters like port GPIO assignments, DDR memory parameters, Video resolution etc, by changing these parameters in the script.bin you can configure your Linux without need to re-compile your kernel again and again this is smart way Allwinner provide for tweaking A13 Linux Kernel&lt;br /&gt;
&lt;br /&gt;
write the Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and copy the Kernel modules for partition 2&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# mount /dev/sdX2 /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cp -a linux-allwinner/out/lib/modules/3.0.42+/ /mnt/lib/modules/.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have an SD card ready to boot debian on A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
Connect USB-SERIAL-CABLE-F to UEXT Tx.Rx and GND, or connect a VGA screen. Put the SD-card in A13-OLinuXino(-WIFI) and apply power, you should see Uboot and then Kernel messages on the console&lt;br /&gt;
&lt;br /&gt;
default username/password is : root / password&lt;br /&gt;
&lt;br /&gt;
== Software Links ==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Linux Linux Sunxi] to build latest Kernel yourself&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/U-boot U-boot] to build community U-boot&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ Building bootable Debian SD card for A13-OLinuXino] Original step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=518.0 Forum post ] with yet another more up to date explanation how to build SD card&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1231</id>
		<title>Build Bootable SD Card with Debian</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=1231"/>
		<updated>2014-06-09T03:26:26Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Setup of the toolchain */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The A13-OLinuXino-WIFI board ships with pre-loaded Android 4.0.3 image on the NAND flash, so it runs out of the box and you can have access to millions of applications on Google Play.&lt;br /&gt;
&lt;br /&gt;
There are also prebuilt SD card images that will boot to debian, they are linked to on the main A13 wiki page. These are suitable for anyone that doesn't want special kernel options.&lt;br /&gt;
&lt;br /&gt;
For those who want to use and develop on this board with Linux and require non standard kernel configurations this wiki explains step by step instructions to create an SD-card image that boots Debian on A13-OLinuXino. Big thanks to Dimitar Gamishev who initially demonstrated the whole build process. &lt;br /&gt;
&lt;br /&gt;
Note: The content is largely taken from this page of instructions&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ building bootable sd card with debian linux image for a13 olinuxino]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/FirstSteps U-boot Sunxi Wiki with detailed info]&lt;br /&gt;
&lt;br /&gt;
== Tools required ==&lt;br /&gt;
&lt;br /&gt;
* A13-OLinuXino or A13-OLinuXino-WIFI&lt;br /&gt;
* Micro SD card larger than 2g&lt;br /&gt;
* A method to check the system worked, VGA screen or serial cable&lt;br /&gt;
* A computer that can run linux (These instructions do not work for windows)&lt;br /&gt;
Note: you can install Ubuntu freely to work on a machine that currently has windows. You will have the option to boot to either windows or linux&lt;br /&gt;
* Method to read or write to a Micro SD card from this computer.&lt;br /&gt;
* An internet connection for the linux computer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
===Setup of the toolchain===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-arm-linux-gnueabihf ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# Older (prior to 2013): apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13-olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see A13-OLinuXino already have support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Building the Kernel===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community Kernel is maintained by Alejandro Mery aka mnemoc on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
Let’s first go back from uboot directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then download the Kernel sources, you should use  allwinner-v3.0-android-v2 branch, the sources are about 700 MB so you will have to wait a bit longer with this download:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone https://github.com/linux-sunxi/linux-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download go to the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd linux-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the a13_configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm a13_defconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
as you see A13-OLinuXino have pre-made configuration in the community kernel sources&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm menuconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this command you can add or remove different modules for the different peripherials in the kernel, be careful when use this as this may cause the kernel to not work properly&lt;br /&gt;
&lt;br /&gt;
The menuconfig created a .config text file, which you can view/edit even with a text editor like vi&lt;br /&gt;
&lt;br /&gt;
if you want to use GPIOs for instance they are not enabled by default and you can do this by adding:&lt;br /&gt;
&lt;br /&gt;
SUN4I_GPIO_UGLY = y inside .config&lt;br /&gt;
&lt;br /&gt;
then you can contiue with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when this finish's you will have uImage ready and you can build the kernel modules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules_install&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DONE! At this point you have uboot and kernel builds ready.&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048 and ending to 34815&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048 end 34815&lt;br /&gt;
&lt;br /&gt;
create second partition&lt;br /&gt;
&lt;br /&gt;
5. n p 2 enter enter&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
if you did everything correctly you should see something like:&lt;br /&gt;
&lt;br /&gt;
Disk /dev/sdX: 2001 MB, 2001731584 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
42 heads, 41 sectors/track, 2270 cylinders, total 3909632 sectors&amp;lt;br /&amp;gt;&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Disk identifier: 0×00000000&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device Boot Start End Blocks Id System&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX1 2048 34815 16384 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX2 34816 3909631 1937408 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then write the partititons to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which the Allwinner bootloader understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second should be normal Linux EXT3 FS&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.ext3 /dev/sdX2&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debian rootfs===&lt;br /&gt;
&lt;br /&gt;
The Linux Kernel and Uboot are ready, now we have the Linux distribution rootfs, 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.&lt;br /&gt;
&lt;br /&gt;
exit the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download debian rootfs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# wget http://hands.com/~lkcl/mele_debian_armhf_minimal.cpio.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mount your sd card EXT3 FS partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX2 /mnt&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and unarchive the rootfs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# gunzip -c /home/user/olinuxino/mele_debian_armhf_minimal.cpio.gz | cpio -i&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;quot;user&amp;quot; is the user name of your root user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
at this point you have Debian on your SD card second partition&lt;br /&gt;
&lt;br /&gt;
===Write Uboot and Kernel you build===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX1 /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the Kernel uImage to root directory in partition 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cp linux-allwinner/arch/arm/boot/uImage /mnt/.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download the script.bin from: &lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin]&lt;br /&gt;
&lt;br /&gt;
and copy it to the same directory as uImage&lt;br /&gt;
&lt;br /&gt;
script.bin is a text file with very important configuration parameters like port GPIO assignments, DDR memory parameters, Video resolution etc, by changing these parameters in the script.bin you can configure your Linux without need to re-compile your kernel again and again this is smart way Allwinner provide for tweaking A13 Linux Kernel&lt;br /&gt;
&lt;br /&gt;
write the Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and copy the Kernel modules for partition 2&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# mount /dev/sdX2 /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cp -a linux-allwinner/out/lib/modules/3.0.42+/ /mnt/lib/modules/.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have an SD card ready to boot debian on A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
Connect USB-SERIAL-CABLE-F to UEXT Tx.Rx and GND, or connect a VGA screen. Put the SD-card in A13-OLinuXino(-WIFI) and apply power, you should see Uboot and then Kernel messages on the console&lt;br /&gt;
&lt;br /&gt;
default username/password is : root / password&lt;br /&gt;
&lt;br /&gt;
== Software Links ==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Linux Linux Sunxi] to build latest Kernel yourself&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/U-boot U-boot] to build community U-boot&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ Building bootable Debian SD card for A13-OLinuXino] Original step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=518.0 Forum post ] with yet another more up to date explanation how to build SD card&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=915</id>
		<title>Shield-EKG-EMG</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=915"/>
		<updated>2013-11-02T16:35:22Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Firmware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:SHIELD-EKG-EMG-01.jpg|thumb| Shield-EKG-EMG]]&lt;br /&gt;
The EKG-EMG shield when combined with a duino device can provide a low cost ekg signal of the hearts actions&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/open-source-hardware product page]&lt;br /&gt;
&lt;br /&gt;
== How to use, other parts required ==&lt;br /&gt;
To make an EKG system the following parts are required&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/open-source-hardware This shield (Shield-EKG-EMG)]&lt;br /&gt;
&lt;br /&gt;
*[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG-PA/open-source-hardware Passive probes designed for this board]&amp;lt;br&amp;gt;&lt;br /&gt;
Note: you can also make your own using an audio jack, the connections are depicted in the shield schematic&lt;br /&gt;
&lt;br /&gt;
*Select a suitable duino board that can run the software choosen&amp;lt;br&amp;gt;&lt;br /&gt;
[https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-328/open-source-hardware example:OLIMEXINO-328]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When all parts are assembled follow the [https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/resources/SHIELD-EKG-EMG.pdf manual] section 4.1 to install software on the arduino and PC&lt;br /&gt;
&lt;br /&gt;
== Noise affects ==&lt;br /&gt;
The shield attempts to reduce or remove 50 or 60hz interference from the measured signal. Interference from the electrical systems around the person under measurement is a well known challenge for EKG devices.&lt;br /&gt;
&lt;br /&gt;
The human body acts as an antenna, the EKG shield amplifies signals by 205 times. The voltage levels picked up at the skin due to heart action is around 1mV. Noise pick up from an electrical cable close to the user can easily approach 1mV. When both the heart influenced voltage and the electrical noise voltage feeds into the system both are amplified.&lt;br /&gt;
&lt;br /&gt;
A bezzelworth filter is present on the output of the shield with the aim of reducing this noise. A challenge exists when filtering the noise. The QRS peak in the wave form (fast spike up due to heart action) is often affected by filtering at 50 / 60hz. No filters are prefect therefore attempts to filter the output of an EKG often affects the QRS peak which is a signal of interest when analizing heart action&lt;br /&gt;
&lt;br /&gt;
Several reports have identified significant noise being measured when using the EKG and a duino device. A common method to address this is software filtering. A project has addressed this. &lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?feature=player_embedded&amp;amp;v=uuGDnuqZqu8&amp;amp;noredirect=1 youtube video on project]&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!V1BGBRiC!PXVXyzFHln5-yeulstJlSW7AnNsbKL3UXtWwdrxkDKM Link to software code for project]&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
===Firmware===&lt;br /&gt;
The following source code can be opened using the arduino IDE&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/resources/ShieldEkgEmgDemo.zip EKG Demo]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User interface software===&lt;br /&gt;
&lt;br /&gt;
== Documents ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
[[Category:Shields]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=913</id>
		<title>Shield-EKG-EMG</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=913"/>
		<updated>2013-11-02T04:45:54Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:SHIELD-EKG-EMG-01.jpg|thumb| Shield-EKG-EMG]]&lt;br /&gt;
The EKG-EMG shield when combined with a duino device can provide a low cost ekg signal of the hearts actions&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/open-source-hardware product page]&lt;br /&gt;
&lt;br /&gt;
== How to use, other parts required ==&lt;br /&gt;
To make an EKG system the following parts are required&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/open-source-hardware This shield (Shield-EKG-EMG)]&lt;br /&gt;
&lt;br /&gt;
*[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG-PA/open-source-hardware Passive probes designed for this board]&amp;lt;br&amp;gt;&lt;br /&gt;
Note: you can also make your own using an audio jack, the connections are depicted in the shield schematic&lt;br /&gt;
&lt;br /&gt;
*Select a suitable duino board that can run the software choosen&amp;lt;br&amp;gt;&lt;br /&gt;
[https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-328/open-source-hardware example:OLIMEXINO-328]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When all parts are assembled follow the [https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/resources/SHIELD-EKG-EMG.pdf manual] section 4.1 to install software on the arduino and PC&lt;br /&gt;
&lt;br /&gt;
== Noise affects ==&lt;br /&gt;
The shield attempts to reduce or remove 50 or 60hz interference from the measured signal. Interference from the electrical systems around the person under measurement is a well known challenge for EKG devices.&lt;br /&gt;
&lt;br /&gt;
The human body acts as an antenna, the EKG shield amplifies signals by 205 times. The voltage levels picked up at the skin due to heart action is around 1mV. Noise pick up from an electrical cable close to the user can easily approach 1mV. When both the heart influenced voltage and the electrical noise voltage feeds into the system both are amplified.&lt;br /&gt;
&lt;br /&gt;
A bezzelworth filter is present on the output of the shield with the aim of reducing this noise. A challenge exists when filtering the noise. The QRS peak in the wave form (fast spike up due to heart action) is often affected by filtering at 50 / 60hz. No filters are prefect therefore attempts to filter the output of an EKG often affects the QRS peak which is a signal of interest when analizing heart action&lt;br /&gt;
&lt;br /&gt;
Several reports have identified significant noise being measured when using the EKG and a duino device. A common method to address this is software filtering. A project has addressed this. &lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?feature=player_embedded&amp;amp;v=uuGDnuqZqu8&amp;amp;noredirect=1 youtube video on project]&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!V1BGBRiC!PXVXyzFHln5-yeulstJlSW7AnNsbKL3UXtWwdrxkDKM Link to software code for project]&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
===Firmware===&lt;br /&gt;
[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/resources/ShieldEkgEmgDemo.zip EKG Demo]&amp;lt;br&amp;gt;&lt;br /&gt;
[https://www.olimex.com/Products/EEG/OpenEEG/EEG-SMT/resources/EEG-SMT_firmware.zip Source code for EEG firmware for arduino]&lt;br /&gt;
&lt;br /&gt;
===User interface software===&lt;br /&gt;
&lt;br /&gt;
== Documents ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
[[Category:Shields]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=912</id>
		<title>Shield-EKG-EMG</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=912"/>
		<updated>2013-11-02T04:23:46Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:SHIELD-EKG-EMG-01.jpg|thumb| Shield-EKG-EMG]]&lt;br /&gt;
The EKG-EMG shield when combined with a duino device can provide a low cost ekg signal of the hearts actions&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/open-source-hardware product page]&lt;br /&gt;
&lt;br /&gt;
== How to use, other parts required ==&lt;br /&gt;
To make an EKG system the following parts are required&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/open-source-hardware This shield (Shield-EKG-EMG)]&lt;br /&gt;
&lt;br /&gt;
*[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG-PA/open-source-hardware Passive probes designed for this board]&amp;lt;br&amp;gt;&lt;br /&gt;
Note: you can also make your own using an audio jack, the connections are depicted in the shield schematic&lt;br /&gt;
&lt;br /&gt;
*Select a suitable duino board that can run the software choosen&amp;lt;br&amp;gt;&lt;br /&gt;
[https://www.olimex.com/Products/Duino/AVR/OLIMEXINO-328/open-source-hardware example:OLIMEXINO-328]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When all parts are assembled follow the [https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/resources/SHIELD-EKG-EMG.pdf manual] section 4.1 to install software on the arduino and PC&lt;br /&gt;
&lt;br /&gt;
== Noise affects ==&lt;br /&gt;
The shield attempts to reduce or remove 50 or 60hz interference from the measured signal. Interference from the electrical systems around the person under measurement is a well known challenge for EKG devices.&lt;br /&gt;
&lt;br /&gt;
The human body acts as an antenna, the EKG shield amplifies signals by 205 times. The voltage levels picked up at the skin due to heart action is around 1mV. Noise pick up from an electrical cable close to the user can easily approach 1mV. When both the heart influenced voltage and the electrical noise voltage feeds into the system both are amplified.&lt;br /&gt;
&lt;br /&gt;
A bezzelworth filter is present on the output of the shield with the aim of reducing this noise. A challenge exists when filtering the noise. The QRS peak in the wave form (fast spike up due to heart action) is often affected by filtering at 50 / 60hz. No filters are prefect therefore attempts to filter the output of an EKG often affects the QRS peak which is a signal of interest when analizing heart action&lt;br /&gt;
&lt;br /&gt;
Several reports have identified significant noise being measured when using the EKG and a duino device. A common method to address this is software filtering. A project has addressed this. &lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?feature=player_embedded&amp;amp;v=uuGDnuqZqu8&amp;amp;noredirect=1 youtube video on project]&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!V1BGBRiC!PXVXyzFHln5-yeulstJlSW7AnNsbKL3UXtWwdrxkDKM Link to software code for project]&lt;br /&gt;
&lt;br /&gt;
== Documents ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
[[Category:Shields]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=911</id>
		<title>Shield-EKG-EMG</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=911"/>
		<updated>2013-11-02T04:02:57Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:SHIELD-EKG-EMG-01.jpg|thumb| Shield-EKG-EMG]]&lt;br /&gt;
The EKG-EMG shield when combined with a duino device can provide a low cost ekg signal of the hearts actions&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/open-source-hardware product page]&lt;br /&gt;
&lt;br /&gt;
== Noise affects ==&lt;br /&gt;
The shield attempts to reduce or remove 50 or 60hz interference from the measured signal. Interference from the electrical systems around the person under measurement is a well known challenge for EKG devices.&lt;br /&gt;
&lt;br /&gt;
The human body acts as an antenna, the EKG shield amplifies signals by 205 times. The voltage levels picked up at the skin due to heart action is around 1mV. Noise pick up from an electrical cable close to the user can easily approach 1mV. When both the heart influenced voltage and the electrical noise voltage feeds into the system both are amplified.&lt;br /&gt;
&lt;br /&gt;
A bezzelworth filter is present on the output of the shield with the aim of reducing this noise. A challenge exists when filtering the noise. The QRS peak in the wave form (fast spike up due to heart action) is often affected by filtering at 50 / 60hz. No filters are prefect therefore attempts to filter the output of an EKG often affects the QRS peak which is a signal of interest when analizing heart action&lt;br /&gt;
&lt;br /&gt;
Several reports have identified significant noise being measured when using the EKG and a duino device. A common method to address this is software filtering. A project has addressed this. &lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?feature=player_embedded&amp;amp;v=uuGDnuqZqu8&amp;amp;noredirect=1 youtube video on project]&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!V1BGBRiC!PXVXyzFHln5-yeulstJlSW7AnNsbKL3UXtWwdrxkDKM Link to software code for project]&lt;br /&gt;
&lt;br /&gt;
== Documents ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
[[Category:Shields]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=File:SHIELD-EKG-EMG-01.jpg&amp;diff=910</id>
		<title>File:SHIELD-EKG-EMG-01.jpg</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=File:SHIELD-EKG-EMG-01.jpg&amp;diff=910"/>
		<updated>2013-11-02T04:00:22Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=909</id>
		<title>Shield-EKG-EMG</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=909"/>
		<updated>2013-11-02T03:59:13Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Noise affects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The EKG-EMG shield when combined with a duino device can provide a low cost ekg signal of the hearts actions&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/open-source-hardware product page]&lt;br /&gt;
&lt;br /&gt;
== Noise affects ==&lt;br /&gt;
The shield attempts to reduce or remove 50 or 60hz interference from the measured signal. Interference from the electrical systems around the person under measurement is a well known challenge for EKG devices.&lt;br /&gt;
&lt;br /&gt;
The human body acts as an antenna, the EKG shield amplifies signals by 205 times. The voltage levels picked up at the skin due to heart action is around 1mV. Noise pick up from an electrical cable close to the user can easily approach 1mV. When both the heart influenced voltage and the electrical noise voltage feeds into the system both are amplified.&lt;br /&gt;
&lt;br /&gt;
A bezzelworth filter is present on the output of the shield with the aim of reducing this noise. A challenge exists when filtering the noise. The QRS peak in the wave form (fast spike up due to heart action) is often affected by filtering at 50 / 60hz. No filters are prefect therefore attempts to filter the output of an EKG often affects the QRS peak which is a signal of interest when analizing heart action&lt;br /&gt;
&lt;br /&gt;
Several reports have identified significant noise being measured when using the EKG and a duino device. A common method to address this is software filtering. A project has addressed this. &lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?feature=player_embedded&amp;amp;v=uuGDnuqZqu8&amp;amp;noredirect=1 youtube video on project]&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!V1BGBRiC!PXVXyzFHln5-yeulstJlSW7AnNsbKL3UXtWwdrxkDKM Link to software code for project]&lt;br /&gt;
&lt;br /&gt;
== Documents ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
[[Category:Shields]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=908</id>
		<title>Shield-EKG-EMG</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Shield-EKG-EMG&amp;diff=908"/>
		<updated>2013-11-02T03:45:41Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The EKG-EMG shield when combined with a duino device can provide a low cost ekg signal of the hearts actions&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/Products/Duino/Shields/SHIELD-EKG-EMG/open-source-hardware product page]&lt;br /&gt;
&lt;br /&gt;
== Noise affects ==&lt;br /&gt;
The shield attempts to reduce or remove 50 or 60hz interference from the measured signal. Interference from the electrical systems around the person under measurement is a well known challenge for EKG devices.&lt;br /&gt;
&lt;br /&gt;
The human body acts as an antenna, the EKG shield amplifies signals by 205 times. The voltage levels picked up at the skin due to heart action is around 1mV. Noise pick up from an electrical cable close to the user can easily approach 1mV. When both the heart influenced voltage and the electrical noise voltage feeds into the system both are amplified.&lt;br /&gt;
&lt;br /&gt;
A butterworth filter is present on the output of the shield with the aim of reducing this noise. A challenge exists when filtering the noise. The QRS peak in the wave form (fast spike up due to heart action) is often affected by filtering at 50 / 60hz. No filters are prefect therefore attempts to filter the output of an EKG often affects the QRS peak which is a signal of interest when analizing heart action&lt;br /&gt;
&lt;br /&gt;
Several reports have identified significant noise being measured when using the EKG and a duino device. A common method to address this is software filtering. A project has addressed this. &lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?feature=player_embedded&amp;amp;v=uuGDnuqZqu8&amp;amp;noredirect=1 youtube video on project]&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!V1BGBRiC!PXVXyzFHln5-yeulstJlSW7AnNsbKL3UXtWwdrxkDKM Link to software code for project]&lt;br /&gt;
&lt;br /&gt;
== Documents ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
[[Category:Shields]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=MOD-EKG-3TRACE&amp;diff=903</id>
		<title>MOD-EKG-3TRACE</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=MOD-EKG-3TRACE&amp;diff=903"/>
		<updated>2013-10-30T15:29:27Z</updated>

		<summary type="html">&lt;p&gt;Scott: Scott moved page MOD-EKG-3TRACE to NANO-ECG/EKG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[NANO-ECG/EKG]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=657</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=657"/>
		<updated>2013-05-18T15:30:38Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Do something useful, Modify the hello world to set GPIO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Setup Eclipse====&lt;br /&gt;
&lt;br /&gt;
To setup eclipse to create the hello world program complete the following steps&lt;br /&gt;
&lt;br /&gt;
- Start eclipse&lt;br /&gt;
&lt;br /&gt;
- Create a new project by clicking File -&amp;gt; New -&amp;gt; Makefile project with existing code&amp;lt;br/&amp;gt;&lt;br /&gt;
- Enter a project name&amp;lt;br/&amp;gt;&lt;br /&gt;
- locate the folder with the source code previously downloaded - the folder should be named olinuxino/u-boot-sunxi&amp;lt;br/&amp;gt;&lt;br /&gt;
- Select Cross gcc&amp;lt;br/&amp;gt;&lt;br /&gt;
- Press OK, it may take some time to index&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EclipseBuild.png|thumb| Eclipse Build Setup]]&lt;br /&gt;
To setup the build command&amp;lt;br/&amp;gt;&lt;br /&gt;
- wait for the project to stop indexing&amp;lt;br/&amp;gt;&lt;br /&gt;
- when ready press project then Properties this will bring up a window&amp;lt;br/&amp;gt;&lt;br /&gt;
- Within the properties window click on C/C++ Build&amp;lt;br/&amp;gt;&lt;br /&gt;
- Beside build command enter in the box&amp;lt;br/&amp;gt;&lt;br /&gt;
make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you click Ok the system will be ready to build when build is pressed.&lt;br /&gt;
&lt;br /&gt;
==== Licensing ====&lt;br /&gt;
&lt;br /&gt;
Use of any of the existing code within u boot is ok however this code is licensed under GPL and therefore if any of it is included in code created, the code created must also be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
Creating a stand alone program that uses u boot is ok and doesn't require licensing under GPL however including any source files within like GPIO will mean the code created must be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
There is plenty of info on GPL online for further info.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
All devices within the A13 processor are memory mapped therefore changing a memory location with data will take affect on the associated hardware.&lt;br /&gt;
&lt;br /&gt;
The hello world program can be modified as follows to turn on the LED on the olinuxino A13 board.&lt;br /&gt;
&lt;br /&gt;
Add in the following definitions under the includes&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: all of the information in these defines are contained within the A10 detailed manual&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define GPIOBase 0x01C20800&lt;br /&gt;
#define GPIOIncrement 0x24&lt;br /&gt;
&lt;br /&gt;
#define ALLWINNER_GPIO_G    GPIOBase + (6*GPIOIncrement)&lt;br /&gt;
&lt;br /&gt;
#define Port_CFG1 0x04 //pin direction and function 8 to 15&lt;br /&gt;
#define Port_DAT  0x10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add in the following code at the top of the main file&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//set these to volatile to ensure actions on them aren't compiled out&lt;br /&gt;
volatile uint32_t  	*portGConfig;&lt;br /&gt;
volatile uint32_t  	*portGData;&lt;br /&gt;
&lt;br /&gt;
//setup pointers for GPIO registers&lt;br /&gt;
portGConfig = (uint32_t *)(ALLWINNER_GPIO_G + Port_CFG1);&lt;br /&gt;
portGData = (uint32_t *)(ALLWINNER_GPIO_G + Port_DAT);&lt;br /&gt;
&lt;br /&gt;
//configure port G pin 9 to output&lt;br /&gt;
*portGConfig |= 0x10;&lt;br /&gt;
//set output to on&lt;br /&gt;
*portGData |= 0x0200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the new program, run it and the GPIO should turn on.&lt;br /&gt;
&lt;br /&gt;
'''GPIO issue'''&lt;br /&gt;
&lt;br /&gt;
The above code works but the LED only turns on if printf is used. This appears to be caused by compiling optimization.&lt;br /&gt;
&lt;br /&gt;
Not sure how to fix this with the u boot make files however the make file in the following section has optimization turned down to allow the GPIO setting to not be compiled out.&lt;br /&gt;
&lt;br /&gt;
===Building quickly and adding new files===&lt;br /&gt;
&lt;br /&gt;
Building the stand alone program at the moment requires all of uboot to be compiled, this can take several minutes depending on the machine used.&lt;br /&gt;
&lt;br /&gt;
It is also difficult to add extra files which makes it hard for more complex projects.&lt;br /&gt;
&lt;br /&gt;
To speed this up and make it easier to add in new files for compilation. The text in the following wiki page can be used to create a make file&lt;br /&gt;
&lt;br /&gt;
[[Stand_Alone_MakeFile]]&lt;br /&gt;
&lt;br /&gt;
Create a file in the standalone directory called &amp;quot;myMakefile&amp;quot;, add in the text in the above wiki page.&lt;br /&gt;
&lt;br /&gt;
In a terminal go to the standalone directory and type make -f myMakefile&lt;br /&gt;
&lt;br /&gt;
This should compile the hello_world program. It will also generate some assembly files which can be useful to use when optimizing your code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Adding new header files can be done without any change as long as they are referenced in the hello_world file.&lt;br /&gt;
&lt;br /&gt;
Adding new c files is difficult with the original make files. With the new make file just add the new file name in the &amp;quot;SOURCES&amp;quot; line after hello_world.c&amp;lt;br/&amp;gt;&lt;br /&gt;
For example if you add in a gpio.c file the first line should become&amp;lt;br/&amp;gt;&lt;br /&gt;
SOURCES=hello_world.c gpio.c&lt;br /&gt;
&lt;br /&gt;
you can now quickly compile and add in new files&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=656</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=656"/>
		<updated>2013-05-18T14:33:38Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Do something useful, Modify the hello world to set GPIO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Setup Eclipse====&lt;br /&gt;
&lt;br /&gt;
To setup eclipse to create the hello world program complete the following steps&lt;br /&gt;
&lt;br /&gt;
- Start eclipse&lt;br /&gt;
&lt;br /&gt;
- Create a new project by clicking File -&amp;gt; New -&amp;gt; Makefile project with existing code&amp;lt;br/&amp;gt;&lt;br /&gt;
- Enter a project name&amp;lt;br/&amp;gt;&lt;br /&gt;
- locate the folder with the source code previously downloaded - the folder should be named olinuxino/u-boot-sunxi&amp;lt;br/&amp;gt;&lt;br /&gt;
- Select Cross gcc&amp;lt;br/&amp;gt;&lt;br /&gt;
- Press OK, it may take some time to index&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EclipseBuild.png|thumb| Eclipse Build Setup]]&lt;br /&gt;
To setup the build command&amp;lt;br/&amp;gt;&lt;br /&gt;
- wait for the project to stop indexing&amp;lt;br/&amp;gt;&lt;br /&gt;
- when ready press project then Properties this will bring up a window&amp;lt;br/&amp;gt;&lt;br /&gt;
- Within the properties window click on C/C++ Build&amp;lt;br/&amp;gt;&lt;br /&gt;
- Beside build command enter in the box&amp;lt;br/&amp;gt;&lt;br /&gt;
make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you click Ok the system will be ready to build when build is pressed.&lt;br /&gt;
&lt;br /&gt;
==== Licensing ====&lt;br /&gt;
&lt;br /&gt;
Use of any of the existing code within u boot is ok however this code is licensed under GPL and therefore if any of it is included in code created, the code created must also be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
Creating a stand alone program that uses u boot is ok and doesn't require licensing under GPL however including any source files within like GPIO will mean the code created must be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
There is plenty of info on GPL online for further info.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
All devices within the A13 processor are memory mapped therefore changing a memory location with data will take affect on the associated hardware.&lt;br /&gt;
&lt;br /&gt;
The hello world program can be modified as follows to turn on the LED on the olinuxino A13 board.&lt;br /&gt;
&lt;br /&gt;
Add in the following definitions under the includes&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: all of the information in these defines are contained within the A10 detailed manual&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define GPIOBase 0x01C20800&lt;br /&gt;
#define GPIOIncrement 0x24&lt;br /&gt;
&lt;br /&gt;
#define ALLWINNER_GPIO_G    GPIOBase + (6*GPIOIncrement)&lt;br /&gt;
&lt;br /&gt;
#define Port_CFG1 0x04 //pin direction and function 8 to 15&lt;br /&gt;
#define Port_DAT  0x10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add in the following code at the top of the main file&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint32_t  	*portGConfig;&lt;br /&gt;
uint32_t  	*portGData;&lt;br /&gt;
&lt;br /&gt;
//setup pointers for GPIO registers&lt;br /&gt;
portGConfig = (uint32_t *)(ALLWINNER_GPIO_G + Port_CFG1);&lt;br /&gt;
portGData = (uint32_t *)(ALLWINNER_GPIO_G + Port_DAT);&lt;br /&gt;
&lt;br /&gt;
//configure port G pin 9 to output&lt;br /&gt;
*portGConfig |= 0x10;&lt;br /&gt;
//set output to on&lt;br /&gt;
*portGData |= 0x0200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the new program, run it and the GPIO should turn on.&lt;br /&gt;
&lt;br /&gt;
'''GPIO issue'''&lt;br /&gt;
&lt;br /&gt;
The above code works but the LED only turns on if printf is used. This appears to be caused by compiling optimization.&lt;br /&gt;
&lt;br /&gt;
Not sure how to fix this with the u boot make files however the make file in the following section has optimization turned down to allow the GPIO setting to not be compiled out.&lt;br /&gt;
&lt;br /&gt;
===Building quickly and adding new files===&lt;br /&gt;
&lt;br /&gt;
Building the stand alone program at the moment requires all of uboot to be compiled, this can take several minutes depending on the machine used.&lt;br /&gt;
&lt;br /&gt;
It is also difficult to add extra files which makes it hard for more complex projects.&lt;br /&gt;
&lt;br /&gt;
To speed this up and make it easier to add in new files for compilation. The text in the following wiki page can be used to create a make file&lt;br /&gt;
&lt;br /&gt;
[[Stand_Alone_MakeFile]]&lt;br /&gt;
&lt;br /&gt;
Create a file in the standalone directory called &amp;quot;myMakefile&amp;quot;, add in the text in the above wiki page.&lt;br /&gt;
&lt;br /&gt;
In a terminal go to the standalone directory and type make -f myMakefile&lt;br /&gt;
&lt;br /&gt;
This should compile the hello_world program. It will also generate some assembly files which can be useful to use when optimizing your code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Adding new header files can be done without any change as long as they are referenced in the hello_world file.&lt;br /&gt;
&lt;br /&gt;
Adding new c files is difficult with the original make files. With the new make file just add the new file name in the &amp;quot;SOURCES&amp;quot; line after hello_world.c&amp;lt;br/&amp;gt;&lt;br /&gt;
For example if you add in a gpio.c file the first line should become&amp;lt;br/&amp;gt;&lt;br /&gt;
SOURCES=hello_world.c gpio.c&lt;br /&gt;
&lt;br /&gt;
you can now quickly compile and add in new files&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=655</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=655"/>
		<updated>2013-05-18T13:53:31Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Building quickly and adding new files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Setup Eclipse====&lt;br /&gt;
&lt;br /&gt;
To setup eclipse to create the hello world program complete the following steps&lt;br /&gt;
&lt;br /&gt;
- Start eclipse&lt;br /&gt;
&lt;br /&gt;
- Create a new project by clicking File -&amp;gt; New -&amp;gt; Makefile project with existing code&amp;lt;br/&amp;gt;&lt;br /&gt;
- Enter a project name&amp;lt;br/&amp;gt;&lt;br /&gt;
- locate the folder with the source code previously downloaded - the folder should be named olinuxino/u-boot-sunxi&amp;lt;br/&amp;gt;&lt;br /&gt;
- Select Cross gcc&amp;lt;br/&amp;gt;&lt;br /&gt;
- Press OK, it may take some time to index&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EclipseBuild.png|thumb| Eclipse Build Setup]]&lt;br /&gt;
To setup the build command&amp;lt;br/&amp;gt;&lt;br /&gt;
- wait for the project to stop indexing&amp;lt;br/&amp;gt;&lt;br /&gt;
- when ready press project then Properties this will bring up a window&amp;lt;br/&amp;gt;&lt;br /&gt;
- Within the properties window click on C/C++ Build&amp;lt;br/&amp;gt;&lt;br /&gt;
- Beside build command enter in the box&amp;lt;br/&amp;gt;&lt;br /&gt;
make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you click Ok the system will be ready to build when build is pressed.&lt;br /&gt;
&lt;br /&gt;
==== Licensing ====&lt;br /&gt;
&lt;br /&gt;
Use of any of the existing code within u boot is ok however this code is licensed under GPL and therefore if any of it is included in code created, the code created must also be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
Creating a stand alone program that uses u boot is ok and doesn't require licensing under GPL however including any source files within like GPIO will mean the code created must be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
There is plenty of info on GPL online for further info.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
All devices within the A13 processor are memory mapped therefore changing a memory location with data will take affect on the associated hardware.&lt;br /&gt;
&lt;br /&gt;
The hello world program can be modified as follows to turn on the LED on the olinuxino A13 board.&lt;br /&gt;
&lt;br /&gt;
Add in the following definitions under the includes&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: all of the information in these defines are contained within the A10 detailed manual&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define GPIOBase 0x01C20800&lt;br /&gt;
#define GPIOIncrement 0x24&lt;br /&gt;
&lt;br /&gt;
#define ALLWINNER_GPIO_G    GPIOBase + (6*GPIOIncrement)&lt;br /&gt;
&lt;br /&gt;
#define Port_CFG1 0x04 //pin direction and function 8 to 15&lt;br /&gt;
#define Port_DAT  0x10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add in the following code at the top of the main file&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint32_t  	*portGConfig;&lt;br /&gt;
uint32_t  	*portGData;&lt;br /&gt;
&lt;br /&gt;
//setup pointers for GPIO registers&lt;br /&gt;
portGConfig = (uint32_t *)(ALLWINNER_GPIO_G + Port_CFG1);&lt;br /&gt;
portGData = (uint32_t *)(ALLWINNER_GPIO_G + Port_DAT);&lt;br /&gt;
&lt;br /&gt;
//configure port G pin 9 to output&lt;br /&gt;
*portGConfig |= 0x10;&lt;br /&gt;
//set output to on&lt;br /&gt;
*portGData |= 0x0200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the new program, run it and the GPIO should turn on.&lt;br /&gt;
&lt;br /&gt;
===Building quickly and adding new files===&lt;br /&gt;
&lt;br /&gt;
Building the stand alone program at the moment requires all of uboot to be compiled, this can take several minutes depending on the machine used.&lt;br /&gt;
&lt;br /&gt;
It is also difficult to add extra files which makes it hard for more complex projects.&lt;br /&gt;
&lt;br /&gt;
To speed this up and make it easier to add in new files for compilation. The text in the following wiki page can be used to create a make file&lt;br /&gt;
&lt;br /&gt;
[[Stand_Alone_MakeFile]]&lt;br /&gt;
&lt;br /&gt;
Create a file in the standalone directory called &amp;quot;myMakefile&amp;quot;, add in the text in the above wiki page.&lt;br /&gt;
&lt;br /&gt;
In a terminal go to the standalone directory and type make -f myMakefile&lt;br /&gt;
&lt;br /&gt;
This should compile the hello_world program. It will also generate some assembly files which can be useful to use when optimizing your code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Adding new header files can be done without any change as long as they are referenced in the hello_world file.&lt;br /&gt;
&lt;br /&gt;
Adding new c files is difficult with the original make files. With the new make file just add the new file name in the &amp;quot;SOURCES&amp;quot; line after hello_world.c&amp;lt;br/&amp;gt;&lt;br /&gt;
For example if you add in a gpio.c file the first line should become&amp;lt;br/&amp;gt;&lt;br /&gt;
SOURCES=hello_world.c gpio.c&lt;br /&gt;
&lt;br /&gt;
you can now quickly compile and add in new files&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Stand_Alone_MakeFile&amp;diff=654</id>
		<title>Stand Alone MakeFile</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Stand_Alone_MakeFile&amp;diff=654"/>
		<updated>2013-05-18T13:47:53Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SOURCES=hello_world.c&lt;br /&gt;
CC=arm-linux-gnueabi-gcc&lt;br /&gt;
LD=arm-linux-gnueabi-ld.bfd&lt;br /&gt;
CFLAGS=-c -g -O0 -save-temps -fverbose-asm -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x4A000000 -DCONFIG_SPL_TEXT_BASE=0x30 -I/home/seth/olinuxino/u-boot-sunxi/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabi/4.6.1/include -pipe  -DCONFIG_ARM -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -march=armv7-a  -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fstack-usage -fno-toplevel-reorder&lt;br /&gt;
LDFLAGS=-g -Ttext 0x48000000&lt;br /&gt;
OBJECTS=$(SOURCES:.c=.o)&lt;br /&gt;
EXECUTABLE=hello_world&lt;br /&gt;
EXEBIN=$(EXECUTABLE).bin&lt;br /&gt;
&lt;br /&gt;
all: clean $(SOURCES) $(EXECUTABLE)&lt;br /&gt;
&lt;br /&gt;
$(EXECUTABLE): $(OBJECTS)&lt;br /&gt;
	$(LD) $(LDFLAGS) $(OBJECTS) libstubs.o -o $@&lt;br /&gt;
	arm-linux-gnueabi-objcopy -O binary $(EXECUTABLE) $(EXEBIN) 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
clean: &lt;br /&gt;
	rm -f $(EXECUTABLE) $(OBJECTS) $(EXEBIN)&lt;br /&gt;
&lt;br /&gt;
.c.o:&lt;br /&gt;
	$(CC) $(CFLAGS) $&amp;lt; -o $@&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=653</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=653"/>
		<updated>2013-05-18T13:47:24Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Building quickly and adding new files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Setup Eclipse====&lt;br /&gt;
&lt;br /&gt;
To setup eclipse to create the hello world program complete the following steps&lt;br /&gt;
&lt;br /&gt;
- Start eclipse&lt;br /&gt;
&lt;br /&gt;
- Create a new project by clicking File -&amp;gt; New -&amp;gt; Makefile project with existing code&amp;lt;br/&amp;gt;&lt;br /&gt;
- Enter a project name&amp;lt;br/&amp;gt;&lt;br /&gt;
- locate the folder with the source code previously downloaded - the folder should be named olinuxino/u-boot-sunxi&amp;lt;br/&amp;gt;&lt;br /&gt;
- Select Cross gcc&amp;lt;br/&amp;gt;&lt;br /&gt;
- Press OK, it may take some time to index&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EclipseBuild.png|thumb| Eclipse Build Setup]]&lt;br /&gt;
To setup the build command&amp;lt;br/&amp;gt;&lt;br /&gt;
- wait for the project to stop indexing&amp;lt;br/&amp;gt;&lt;br /&gt;
- when ready press project then Properties this will bring up a window&amp;lt;br/&amp;gt;&lt;br /&gt;
- Within the properties window click on C/C++ Build&amp;lt;br/&amp;gt;&lt;br /&gt;
- Beside build command enter in the box&amp;lt;br/&amp;gt;&lt;br /&gt;
make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you click Ok the system will be ready to build when build is pressed.&lt;br /&gt;
&lt;br /&gt;
==== Licensing ====&lt;br /&gt;
&lt;br /&gt;
Use of any of the existing code within u boot is ok however this code is licensed under GPL and therefore if any of it is included in code created, the code created must also be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
Creating a stand alone program that uses u boot is ok and doesn't require licensing under GPL however including any source files within like GPIO will mean the code created must be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
There is plenty of info on GPL online for further info.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
All devices within the A13 processor are memory mapped therefore changing a memory location with data will take affect on the associated hardware.&lt;br /&gt;
&lt;br /&gt;
The hello world program can be modified as follows to turn on the LED on the olinuxino A13 board.&lt;br /&gt;
&lt;br /&gt;
Add in the following definitions under the includes&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: all of the information in these defines are contained within the A10 detailed manual&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define GPIOBase 0x01C20800&lt;br /&gt;
#define GPIOIncrement 0x24&lt;br /&gt;
&lt;br /&gt;
#define ALLWINNER_GPIO_G    GPIOBase + (6*GPIOIncrement)&lt;br /&gt;
&lt;br /&gt;
#define Port_CFG1 0x04 //pin direction and function 8 to 15&lt;br /&gt;
#define Port_DAT  0x10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add in the following code at the top of the main file&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint32_t  	*portGConfig;&lt;br /&gt;
uint32_t  	*portGData;&lt;br /&gt;
&lt;br /&gt;
//setup pointers for GPIO registers&lt;br /&gt;
portGConfig = (uint32_t *)(ALLWINNER_GPIO_G + Port_CFG1);&lt;br /&gt;
portGData = (uint32_t *)(ALLWINNER_GPIO_G + Port_DAT);&lt;br /&gt;
&lt;br /&gt;
//configure port G pin 9 to output&lt;br /&gt;
*portGConfig |= 0x10;&lt;br /&gt;
//set output to on&lt;br /&gt;
*portGData |= 0x0200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the new program, run it and the GPIO should turn on.&lt;br /&gt;
&lt;br /&gt;
===Building quickly and adding new files===&lt;br /&gt;
&lt;br /&gt;
Building the stand alone program at the moment requires all of uboot to be compiled, this can take several minutes depending on the machine used.&lt;br /&gt;
&lt;br /&gt;
It is also difficult to add extra files which makes it hard for more complex projects.&lt;br /&gt;
&lt;br /&gt;
To speed this up and make it easier to add in new files for compilation. The text in the following wiki page can be used to create a make file&lt;br /&gt;
&lt;br /&gt;
[[Stand_Alone_MakeFile]]&lt;br /&gt;
&lt;br /&gt;
Create a file in the standalone directory called &amp;quot;myMakefile&amp;quot;, add in the text in the above wiki page.&lt;br /&gt;
&lt;br /&gt;
In a terminal go to the standalone directory and type make -f myMakefile&lt;br /&gt;
&lt;br /&gt;
This should compile the hello_world program.&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Stand_Alone_MakeFile&amp;diff=652</id>
		<title>Stand Alone MakeFile</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Stand_Alone_MakeFile&amp;diff=652"/>
		<updated>2013-05-18T13:43:42Z</updated>

		<summary type="html">&lt;p&gt;Scott: Created page with &amp;quot;&amp;lt;pre&amp;gt; SOURCES=hello_world.c gpio.c CC=arm-linux-gnueabi-gcc LD=arm-linux-gnueabi-ld.bfd CFLAGS=-c -g -O0 -save-temps -fverbose-asm -fno-common -ffixed-r8 -msoft-float  -D__KER...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
SOURCES=hello_world.c gpio.c&lt;br /&gt;
CC=arm-linux-gnueabi-gcc&lt;br /&gt;
LD=arm-linux-gnueabi-ld.bfd&lt;br /&gt;
CFLAGS=-c -g -O0 -save-temps -fverbose-asm -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DCONFIG_SYS_TEXT_BASE=0x4A000000 -DCONFIG_SPL_TEXT_BASE=0x30 -I/home/seth/olinuxino/u-boot-sunxi/include -fno-builtin -ffreestanding -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabi/4.6.1/include -pipe  -DCONFIG_ARM -D__ARM__ -marm -mno-thumb-interwork -mabi=aapcs-linux -march=armv7-a  -Wall -Wstrict-prototypes -fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fstack-usage -fno-toplevel-reorder&lt;br /&gt;
LDFLAGS=-g -Ttext 0x48000000&lt;br /&gt;
OBJECTS=$(SOURCES:.c=.o)&lt;br /&gt;
EXECUTABLE=hello_world&lt;br /&gt;
EXEBIN=$(EXECUTABLE).bin&lt;br /&gt;
&lt;br /&gt;
all: clean $(SOURCES) $(EXECUTABLE)&lt;br /&gt;
&lt;br /&gt;
$(EXECUTABLE): $(OBJECTS)&lt;br /&gt;
	$(LD) $(LDFLAGS) $(OBJECTS) libstubs.o -o $@&lt;br /&gt;
	arm-linux-gnueabi-objcopy -O binary $(EXECUTABLE) $(EXEBIN) 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
clean: &lt;br /&gt;
	rm -f $(EXECUTABLE) $(OBJECTS) $(EXEBIN)&lt;br /&gt;
&lt;br /&gt;
.c.o:&lt;br /&gt;
	$(CC) $(CFLAGS) $&amp;lt; -o $@&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=651</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=651"/>
		<updated>2013-05-18T13:41:45Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Do something useful, Modify the hello world to set GPIO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Setup Eclipse====&lt;br /&gt;
&lt;br /&gt;
To setup eclipse to create the hello world program complete the following steps&lt;br /&gt;
&lt;br /&gt;
- Start eclipse&lt;br /&gt;
&lt;br /&gt;
- Create a new project by clicking File -&amp;gt; New -&amp;gt; Makefile project with existing code&amp;lt;br/&amp;gt;&lt;br /&gt;
- Enter a project name&amp;lt;br/&amp;gt;&lt;br /&gt;
- locate the folder with the source code previously downloaded - the folder should be named olinuxino/u-boot-sunxi&amp;lt;br/&amp;gt;&lt;br /&gt;
- Select Cross gcc&amp;lt;br/&amp;gt;&lt;br /&gt;
- Press OK, it may take some time to index&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EclipseBuild.png|thumb| Eclipse Build Setup]]&lt;br /&gt;
To setup the build command&amp;lt;br/&amp;gt;&lt;br /&gt;
- wait for the project to stop indexing&amp;lt;br/&amp;gt;&lt;br /&gt;
- when ready press project then Properties this will bring up a window&amp;lt;br/&amp;gt;&lt;br /&gt;
- Within the properties window click on C/C++ Build&amp;lt;br/&amp;gt;&lt;br /&gt;
- Beside build command enter in the box&amp;lt;br/&amp;gt;&lt;br /&gt;
make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you click Ok the system will be ready to build when build is pressed.&lt;br /&gt;
&lt;br /&gt;
==== Licensing ====&lt;br /&gt;
&lt;br /&gt;
Use of any of the existing code within u boot is ok however this code is licensed under GPL and therefore if any of it is included in code created, the code created must also be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
Creating a stand alone program that uses u boot is ok and doesn't require licensing under GPL however including any source files within like GPIO will mean the code created must be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
There is plenty of info on GPL online for further info.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
All devices within the A13 processor are memory mapped therefore changing a memory location with data will take affect on the associated hardware.&lt;br /&gt;
&lt;br /&gt;
The hello world program can be modified as follows to turn on the LED on the olinuxino A13 board.&lt;br /&gt;
&lt;br /&gt;
Add in the following definitions under the includes&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: all of the information in these defines are contained within the A10 detailed manual&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define GPIOBase 0x01C20800&lt;br /&gt;
#define GPIOIncrement 0x24&lt;br /&gt;
&lt;br /&gt;
#define ALLWINNER_GPIO_G    GPIOBase + (6*GPIOIncrement)&lt;br /&gt;
&lt;br /&gt;
#define Port_CFG1 0x04 //pin direction and function 8 to 15&lt;br /&gt;
#define Port_DAT  0x10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add in the following code at the top of the main file&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint32_t  	*portGConfig;&lt;br /&gt;
uint32_t  	*portGData;&lt;br /&gt;
&lt;br /&gt;
//setup pointers for GPIO registers&lt;br /&gt;
portGConfig = (uint32_t *)(ALLWINNER_GPIO_G + Port_CFG1);&lt;br /&gt;
portGData = (uint32_t *)(ALLWINNER_GPIO_G + Port_DAT);&lt;br /&gt;
&lt;br /&gt;
//configure port G pin 9 to output&lt;br /&gt;
*portGConfig |= 0x10;&lt;br /&gt;
//set output to on&lt;br /&gt;
*portGData |= 0x0200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the new program, run it and the GPIO should turn on.&lt;br /&gt;
&lt;br /&gt;
===Building quickly and adding new files===&lt;br /&gt;
&lt;br /&gt;
Building the stand alone program at the moment requires all of uboot to be compiled, this can take several minutes depending on the machine used.&lt;br /&gt;
&lt;br /&gt;
To speed this up and make it easier to add in new files for compilation. The text in the following wiki page can be used to create a make file&lt;br /&gt;
&lt;br /&gt;
[[Stand_Alone_MakeFile]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=650</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=650"/>
		<updated>2013-05-18T13:21:45Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Do something useful, Modify the hello world to set GPIO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Setup Eclipse====&lt;br /&gt;
&lt;br /&gt;
To setup eclipse to create the hello world program complete the following steps&lt;br /&gt;
&lt;br /&gt;
- Start eclipse&lt;br /&gt;
&lt;br /&gt;
- Create a new project by clicking File -&amp;gt; New -&amp;gt; Makefile project with existing code&amp;lt;br/&amp;gt;&lt;br /&gt;
- Enter a project name&amp;lt;br/&amp;gt;&lt;br /&gt;
- locate the folder with the source code previously downloaded - the folder should be named olinuxino/u-boot-sunxi&amp;lt;br/&amp;gt;&lt;br /&gt;
- Select Cross gcc&amp;lt;br/&amp;gt;&lt;br /&gt;
- Press OK, it may take some time to index&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EclipseBuild.png|thumb| Eclipse Build Setup]]&lt;br /&gt;
To setup the build command&amp;lt;br/&amp;gt;&lt;br /&gt;
- wait for the project to stop indexing&amp;lt;br/&amp;gt;&lt;br /&gt;
- when ready press project then Properties this will bring up a window&amp;lt;br/&amp;gt;&lt;br /&gt;
- Within the properties window click on C/C++ Build&amp;lt;br/&amp;gt;&lt;br /&gt;
- Beside build command enter in the box&amp;lt;br/&amp;gt;&lt;br /&gt;
make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you click Ok the system will be ready to build when build is pressed.&lt;br /&gt;
&lt;br /&gt;
==== Licensing ====&lt;br /&gt;
&lt;br /&gt;
Use of any of the existing code within u boot is ok however this code is licensed under GPL and therefore if any of it is included in code created, the code created must also be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
Creating a stand alone program that uses u boot is ok and doesn't require licensing under GPL however including any source files within like GPIO will mean the code created must be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
There is plenty of info on GPL online for further info.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
All devices within the A13 processor are memory mapped therefore changing a memory location with data will take affect on the associated hardware.&lt;br /&gt;
&lt;br /&gt;
The hello world program can be modified as follows to turn on the LED on the olinuxino A13 board.&lt;br /&gt;
&lt;br /&gt;
Add in the following definitions under the includes&amp;lt;br/&amp;gt;&lt;br /&gt;
Note: all of the information in these defines are contained within the A10 detailed manual&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#define GPIOBase 0x01C20800&lt;br /&gt;
#define GPIOIncrement 0x24&lt;br /&gt;
&lt;br /&gt;
#define ALLWINNER_GPIO_G    GPIOBase + (6*GPIOIncrement)&lt;br /&gt;
&lt;br /&gt;
#define Port_CFG1 0x04 //pin direction and function 8 to 15&lt;br /&gt;
#define Port_DAT  0x10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add in the following code at the top of the main file&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uint32_t  	*portGConfig;&lt;br /&gt;
uint32_t  	*portGData;&lt;br /&gt;
&lt;br /&gt;
//setup pointers for GPIO registers&lt;br /&gt;
portGConfig = (uint32_t *)(ALLWINNER_GPIO_G + Port_CFG1);&lt;br /&gt;
portGData = (uint32_t *)(ALLWINNER_GPIO_G + Port_DAT);&lt;br /&gt;
&lt;br /&gt;
//configure port G pin 9 to output&lt;br /&gt;
*portGConfig |= 0x10;&lt;br /&gt;
//set output to on&lt;br /&gt;
*portGData |= 0x0200;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the new program, run it and the GPIO should turn on.&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=649</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=649"/>
		<updated>2013-05-11T11:28:52Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Setup Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Setup Eclipse====&lt;br /&gt;
&lt;br /&gt;
To setup eclipse to create the hello world program complete the following steps&lt;br /&gt;
&lt;br /&gt;
- Start eclipse&lt;br /&gt;
&lt;br /&gt;
- Create a new project by clicking File -&amp;gt; New -&amp;gt; Makefile project with existing code&amp;lt;br/&amp;gt;&lt;br /&gt;
- Enter a project name&amp;lt;br/&amp;gt;&lt;br /&gt;
- locate the folder with the source code previously downloaded - the folder should be named olinuxino/u-boot-sunxi&amp;lt;br/&amp;gt;&lt;br /&gt;
- Select Cross gcc&amp;lt;br/&amp;gt;&lt;br /&gt;
- Press OK, it may take some time to index&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EclipseBuild.png|thumb| Eclipse Build Setup]]&lt;br /&gt;
To setup the build command&amp;lt;br/&amp;gt;&lt;br /&gt;
- wait for the project to stop indexing&amp;lt;br/&amp;gt;&lt;br /&gt;
- when ready press project then Properties this will bring up a window&amp;lt;br/&amp;gt;&lt;br /&gt;
- Within the properties window click on C/C++ Build&amp;lt;br/&amp;gt;&lt;br /&gt;
- Beside build command enter in the box&amp;lt;br/&amp;gt;&lt;br /&gt;
make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you click Ok the system will be ready to build when build is pressed.&lt;br /&gt;
&lt;br /&gt;
==== Licensing ====&lt;br /&gt;
&lt;br /&gt;
Use of any of the existing code within u boot is ok however this code is licensed under GPL and therefore if any of it is included in code created, the code created must also be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
Creating a stand alone program that uses u boot is ok and doesn't require licensing under GPL however including any source files within like GPIO will mean the code created must be licensed under GPL.&lt;br /&gt;
&lt;br /&gt;
There is plenty of info on GPL online for further info.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=648</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=648"/>
		<updated>2013-05-11T11:17:31Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Setup Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Setup Eclipse====&lt;br /&gt;
&lt;br /&gt;
To setup eclipse to create the hello world program complete the following steps&lt;br /&gt;
&lt;br /&gt;
- Start eclipse&lt;br /&gt;
&lt;br /&gt;
- Create a new project by clicking File -&amp;gt; New -&amp;gt; Makefile project with existing code&amp;lt;br/&amp;gt;&lt;br /&gt;
- Enter a project name&amp;lt;br/&amp;gt;&lt;br /&gt;
- locate the folder with the source code previously downloaded - the folder should be named olinuxino/u-boot-sunxi&amp;lt;br/&amp;gt;&lt;br /&gt;
- Select Cross gcc&amp;lt;br/&amp;gt;&lt;br /&gt;
- Press OK, it may take some time to index&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:EclipseBuild.png|thumb| Eclipse Build Setup]]&lt;br /&gt;
To setup the build command&amp;lt;br/&amp;gt;&lt;br /&gt;
- wait for the project to stop indexing&amp;lt;br/&amp;gt;&lt;br /&gt;
- when ready press project then Properties this will bring up a window&amp;lt;br/&amp;gt;&lt;br /&gt;
- Within the properties window click on C/C++ Build&amp;lt;br/&amp;gt;&lt;br /&gt;
- Beside build command enter in the box&amp;lt;br/&amp;gt;&lt;br /&gt;
make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you click Ok the system will be ready to build when build is pressed.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=File:EclipseBuild.png&amp;diff=647</id>
		<title>File:EclipseBuild.png</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=File:EclipseBuild.png&amp;diff=647"/>
		<updated>2013-05-11T11:14:36Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=646</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=646"/>
		<updated>2013-05-11T10:54:27Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Setup Eclipse */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Setup Eclipse====&lt;br /&gt;
&lt;br /&gt;
To setup eclipse to create the hello world program complete the following steps&lt;br /&gt;
&lt;br /&gt;
- Start eclipse&lt;br /&gt;
&lt;br /&gt;
- Create a new project by clicking File -&amp;gt; New -&amp;gt; Makefile project with existing code&amp;lt;br/&amp;gt;&lt;br /&gt;
- Enter a project name&amp;lt;br/&amp;gt;&lt;br /&gt;
- locate the folder with the source code previously downloaded - the folder should be named olinuxino/u-boot-sunxi&amp;lt;br/&amp;gt;&lt;br /&gt;
- Select Cross gcc&amp;lt;br/&amp;gt;&lt;br /&gt;
- Press OK, it may take some time to index&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To setup the build command&amp;lt;br/&amp;gt;&lt;br /&gt;
- wait for the project to stop indexing&amp;lt;br/&amp;gt;&lt;br /&gt;
- when ready press project then Properties this will bring up a window&amp;lt;br/&amp;gt;&lt;br /&gt;
- Within the properties window click on C/C++ Build&amp;lt;br/&amp;gt;&lt;br /&gt;
- Beside build command enter in the box&amp;lt;br/&amp;gt;&lt;br /&gt;
make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you click Ok the system will be ready to build when build is pressed.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=632</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=632"/>
		<updated>2013-05-06T12:10:26Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Setup Eclipse tool chain */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Setup Eclipse====&lt;br /&gt;
&lt;br /&gt;
To setup eclipse to create the hello world program complete the following steps&lt;br /&gt;
&lt;br /&gt;
- Start eclipse&lt;br /&gt;
&lt;br /&gt;
- Create a new project by clicking File -&amp;gt; New -&amp;gt; Makefile project with existing code&amp;lt;br/&amp;gt;&lt;br /&gt;
- Enter a project name&amp;lt;br/&amp;gt;&lt;br /&gt;
- locate the folder with the source code previously downloaded - the folder should be named olinuxino/u-boot-sunxi&amp;lt;br/&amp;gt;&lt;br /&gt;
- Select Cross gcc&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
---To be continued---&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=631</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=631"/>
		<updated>2013-05-06T11:47:02Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Setup Eclipse tool chain */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=630</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=630"/>
		<updated>2013-05-06T11:42:20Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Setup Eclipse tool chain */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
Eclipse is an IDE (Integrated Development Environment). Its a program that allows for one click building as well as making it easier to navigate code across files.&lt;br /&gt;
&lt;br /&gt;
To install Eclipse follow the instructions here&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=629</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=629"/>
		<updated>2013-05-06T11:10:52Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Setup Eclipse tool chain===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=626</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=626"/>
		<updated>2013-05-03T04:18:57Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Building Uboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd u-boot-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=625</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=625"/>
		<updated>2013-05-03T04:17:50Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Run the hello world program from the SD card */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file &amp;lt;br&amp;gt;&lt;br /&gt;
u-boot-sunxi/include/configs/sunxi-common.h&lt;br /&gt;
&lt;br /&gt;
Change the line 129 from&lt;br /&gt;
&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x50000000&amp;lt;br&amp;gt;&lt;br /&gt;
to&amp;lt;br&amp;gt;&lt;br /&gt;
#define CONFIG-STANDALONE_LOAD_ADDR  0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=624</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=624"/>
		<updated>2013-05-03T04:13:09Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located in directory the git repository was downloaded to and in the following path&lt;br /&gt;
&lt;br /&gt;
u-boot-sunxi/examples/standalone&amp;lt;br&amp;gt;&lt;br /&gt;
The file is named: hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file ????&lt;br /&gt;
Change the line ??? to 0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=623</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=623"/>
		<updated>2013-05-03T02:54:45Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Building Uboot */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If errors come up that suggest its unable to find arm-4.6-linux-gnueabi-gcc its likely the compilation is expecting the files in a different place or to be named differently to how they were installed.&amp;lt;br&amp;gt;&lt;br /&gt;
To resolve this you can use symbolic links&lt;br /&gt;
example&lt;br /&gt;
&lt;br /&gt;
ln -s /usr/bin/arm-linux-gnueabi-gcc-4.6 /usr/bin/arm-4.6-linux-gnueabi-gcc&lt;br /&gt;
&lt;br /&gt;
Once you have compiled you can see A13-OLinuXino already has support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located at&lt;br /&gt;
???????? hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file ????&lt;br /&gt;
Change the line ??? to 0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=622</id>
		<title>A13-OLinuXino</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=622"/>
		<updated>2013-04-30T14:31:37Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:A13-OLinuXino-MAXI-WIFI-1.jpg|thumb| A13-OlinuXino-WIFI]]&lt;br /&gt;
&lt;br /&gt;
[[File:A13-OLinuXino-MICRO.jpg|thumb| A13-OlinuXino-MICRO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 processor from Allwinner runs at 1GHz with a Mali400 GPU. It was designed for integration into tablets. Olimex has made several development board designs based around this chip. This wiki page contains information about hardware and software to help make use of these development boards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 based boards currently available are&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/ A13-OLinuXino-WIFI] - Recommended if your developing software for the A13 for the first time as its the only one with network connectivity.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/ A13-OLinuXino] - This is the same as the WIFI version but without WIFI module and NAND flash. Note: Android requires NAND flash to run, so this board can't run Android.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/ A13-OLinuXino-MICRO] - Similar to the A13-OlinuXino but with less extras&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Projects people from the olinuxino community are working on or have finished and how they did it.&lt;br /&gt;
&lt;br /&gt;
'''LINUX:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Run Debian and u-boot, Step by step instructions how to make SD card image.&amp;lt;br&amp;gt;&lt;br /&gt;
[[Prebuilt SD card images running debian]] &lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/23/a13-olinuxino-playing-with-gpios/ Change GPIOs using scripts in linux]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=436.msg4066#msg4066 A13 OLinuXino fast GPIO with /dev/mem now achieve up to 2 Mhz toggle]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=899.0 A13 kernel module for direct support of UEXT MOD-IO board, adding ADC, relays etc, cool project can be used as reference how to make your own kernel modules]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B7WHuNCASY8cWnRrQ0tGVFMybFk Instructions how to run MOD-BT with A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2013/04/18/a13-olinuxino-wifi-and-opencv-face-detection-project/ A13-Olinuxino-WIFI and opencv face detection]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2013/04/02/scratch-control-for-mod-io/ Controlling Relays, Switching ON/OFF of 220V appliances and home automation]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2013/03/28/make-door-security-logger-with-a13-olinuxino-wifi-opencv/ Door security logger, image capture]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2013/03/08/gps-logger-with-google-maps-viewer-made-with-a13-olinuxino-and-mod-gps/ GPS logger with google maps viewer, MOD-GPS module on UEXT]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2013/02/25/a13-olinuxino-web-server-with-mod-rgb-controlling-rgb-led-stripe-over-internet/ Web server with MOD-RGB controlling RGB LED strip]&lt;br /&gt;
&lt;br /&gt;
'''ANDROID:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/ Interface MOD-IO board with I2C under Android ]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2013/03/13/mame4droid-is-running-on-a13-olinuxino/ Run old games on android mame4droid]&lt;br /&gt;
&lt;br /&gt;
'''No OS'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[Bare Metal programming A13]] Programming directly for the chip without an OS&lt;br /&gt;
&lt;br /&gt;
'''FreedomBox:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://wiki.debian.org/FreedomBox/UniLeipzigPractical FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
Schematics and board designs can be found here&lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE Olimex Hardware]&lt;br /&gt;
&lt;br /&gt;
Designs were created with Eagle&lt;br /&gt;
&lt;br /&gt;
A limited functionality freeware version of Eagle can be downloaded here&lt;br /&gt;
&lt;br /&gt;
[http://www.cadsoftusa.com/download-eagle/freeware/?language=en Eagle Freeware]&lt;br /&gt;
&lt;br /&gt;
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here&lt;br /&gt;
&lt;br /&gt;
[http://dl.linux-sunxi.org/A10/ A10 datasheet]&lt;br /&gt;
&lt;br /&gt;
A serial connection can be made to the A13 board, which can help with debugging and is a booting option&lt;br /&gt;
&lt;br /&gt;
[[Serial connection to A13]] Description of how to connect a computer to the A13 board over serial.&lt;br /&gt;
&lt;br /&gt;
===Power===&lt;br /&gt;
&lt;br /&gt;
The A13-OLinuXino can be partially powered over Micro USB, but to power all peripherals, a 6+ watt DC power supply between 6 and 16 volts can be used.  The connector is a positive-center 2.5mm barrel plug.  There is also an on-board connector for a Li-PO battery.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Main_Page A generic wiki for the allwinner devices is here. It contains some great detailed info]&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal programming - no OS ===&lt;br /&gt;
&lt;br /&gt;
It is possible to program and debug code written directly on the chip without an OS such as linux or android.&amp;lt;br /&amp;gt;&lt;br /&gt;
The advantage is no kernel overhead and tighter control of the CPU operation.&lt;br /&gt;
&lt;br /&gt;
[[Bare Metal programming A13]]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - Nand flash ===&lt;br /&gt;
&lt;br /&gt;
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.&lt;br /&gt;
&lt;br /&gt;
The image in the Nand flash can be updated using the tools found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B7WHuNCASY8cWlZ2djh4X0QtV0U/edit?usp=sharing LiveSuit for Windows]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/LiveSuit LiveSuit for loading images]&lt;br /&gt;
&lt;br /&gt;
to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.&lt;br /&gt;
&lt;br /&gt;
Prebuilt images that can be programmed into the Nand flash can be found here.&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlR3hSS0R5aHpoVmM Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)] &lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwleXBMellGdWJ3RUk Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution ]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlbWVBN2RWVXBhTXc/edit?usp=sharing Android 4.1 NAND flash prebuild image for LCD480x272]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlcHFOcUxtQ1N5RDQ/edit A13-LCD43 script.bin]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - SD card ===&lt;br /&gt;
The A13 board can boot from an SD card. Just plug it in an imaged uSD card and connect power.&lt;br /&gt;
&lt;br /&gt;
Note: The SD card can easily be corrupted if power is removed while the system is booting or writing to system files.&lt;br /&gt;
To avoid this do not remove power while it is booting and shut the system down properly before disconnecting power.&lt;br /&gt;
&lt;br /&gt;
==== Prebuilt images ====&lt;br /&gt;
&lt;br /&gt;
Some prebuilt images have been created, follow the link below for details.&lt;br /&gt;
&lt;br /&gt;
[[Prebuilt SD card images running debian]]&lt;br /&gt;
&lt;br /&gt;
==== Build your own kernel and image onto SD card ====&lt;br /&gt;
&lt;br /&gt;
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
====Setup and configure the installed debian image====&lt;br /&gt;
&lt;br /&gt;
There are several settings that can be made for a particular hardware configuration in the script file. &lt;br /&gt;
&lt;br /&gt;
The following link explains the script file as well as wifi or ethernet setup and GPIO settings &lt;br /&gt;
&lt;br /&gt;
[[Configuration of hardware in the debian image]]&lt;br /&gt;
&lt;br /&gt;
====Installing UsbVideoClass(UVC) on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To work with USB Video Cameras you have to enable the UVC support in the kernel. The link below explains how to do it.&lt;br /&gt;
&lt;br /&gt;
[[UVC support]]&lt;br /&gt;
&lt;br /&gt;
====Setup VLC player for video streaming on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To setup video streaming you should first have installed UVC support so you can connect USB cameras to A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
[[VLC streaming]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a program to run on the A13-OlinuXino board ===&lt;br /&gt;
&lt;br /&gt;
[[Programming for A13 in debian]] Step by step instructions to make your first hello world program run on the A13 board running debian.&lt;br /&gt;
&lt;br /&gt;
=== Software Links ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Sunxi-tools Tools to hack A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/11/23/running-debian-with-xfce4-on-a13-olinuxino/ Installing Xfce4 graphical interface on Debian] How to install XFCE4 on A13-OLinuXino&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.0.3 ICS ===&lt;br /&gt;
&lt;br /&gt;
A13-SDK contain everything you need to build Android ACS 4.0.3 NAND image for A13-OLinuXino-WIFI. Both mirrors contain same image a13.tar.gz which you should unpack and follow the instructions inside. Builds on Debian 64bit as on Ubuntu have some problems with Java which we never managed to solve.&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!CgYGRQZL!BJXNQSQcRxLYswtsPI-EsjNTV0kk381Qzfs96Dx0Sn4 Mega upload mirror]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwldWIzY29GNDJ2ZW8 Gdrive mirror]&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.1 JB ===&lt;br /&gt;
&lt;br /&gt;
This is version 1.5 of A13-SDK which builds Android 4.1 Jelly Beans image. It works slower than 4.0.3 and we personally do not see any advantage to use 4.1 vs 4.0.3&lt;br /&gt;
&lt;br /&gt;
[http://emicrotec.at/public/ Andreas Auer kindly offered to host this 4GB image]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== List of Contributors ==&lt;br /&gt;
&lt;br /&gt;
'''Henrik Nordstrom''' - a.k.a. hno, uboot for A13 development, A1X guru, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Dimitar Gamishev''' - a.k.a. HEHOPMAJIEH, Linux kernel configuration for OLinuXino, Android images, LCD touchscreen&lt;br /&gt;
&lt;br /&gt;
'''Alexandro Mery''' - a.k.a. mnemoc, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Davide Fabbri''' - Linaro kernel and lubuntu image&lt;br /&gt;
&lt;br /&gt;
'''Scott Anderson''' - A13 wiki maintainer&lt;br /&gt;
&lt;br /&gt;
'''Jeffrey Wischkaemper''' - a.k.a. jwischka,  A13-OLinuXino Debian image with X &lt;br /&gt;
&lt;br /&gt;
'''Maxime Ripard''' - ARM Linux patches&lt;br /&gt;
&lt;br /&gt;
'''Jason Plum''' - Arch Linux support&lt;br /&gt;
&lt;br /&gt;
[[Category:A13]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=621</id>
		<title>A13-OLinuXino</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=621"/>
		<updated>2013-04-30T14:16:04Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:A13-OLinuXino-MAXI-WIFI-1.jpg|thumb| A13-OlinuXino-WIFI]]&lt;br /&gt;
&lt;br /&gt;
[[File:A13-OLinuXino-MICRO.jpg|thumb| A13-OlinuXino-MICRO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 processor from Allwinner runs at 1GHz with a Mali400 GPU. It was designed for integration into tablets. Olimex has made several development board designs based around this chip. This wiki page contains information about hardware and software to help make use of these development boards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 based boards currently available are&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/ A13-OLinuXino-WIFI] - Recommended if your developing software for the A13 for the first time as its the only one with network connectivity.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/ A13-OLinuXino] - This is the same as the WIFI version but without WIFI module and NAND flash. Note: Android requires NAND flash to run, so this board can't run Android.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/ A13-OLinuXino-MICRO] - Similar to the A13-OlinuXino but with less extras&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Projects people from the olinuxino community are working on or have finished and how they did it.&lt;br /&gt;
&lt;br /&gt;
'''LINUX:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Run Debian and u-boot, Step by step instructions how to make SD card image.&amp;lt;br&amp;gt;&lt;br /&gt;
[[Prebuilt SD card images running debian]] &lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/23/a13-olinuxino-playing-with-gpios/ Change GPIOs using scripts in linux]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=436.msg4066#msg4066 A13 OLinuXino fast GPIO with /dev/mem now achieve up to 2 Mhz toggle]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=899.0 A13 kernel module for direct support of UEXT MOD-IO board, adding ADC, relays etc, cool project can be used as reference how to make your own kernel modules]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B7WHuNCASY8cWnRrQ0tGVFMybFk Instructions how to run MOD-BT with A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2013/04/18/a13-olinuxino-wifi-and-opencv-face-detection-project/ A13-Olinuxino-WIFI and opencv face detection]&lt;br /&gt;
&lt;br /&gt;
'''ANDROID:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/ Interface MOD-IO board with I2C under Android ]&lt;br /&gt;
&lt;br /&gt;
'''No OS'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[Bare Metal programming A13]] Programming directly for the chip without an OS&lt;br /&gt;
&lt;br /&gt;
'''FreedomBox:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://wiki.debian.org/FreedomBox/UniLeipzigPractical FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
Schematics and board designs can be found here&lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE Olimex Hardware]&lt;br /&gt;
&lt;br /&gt;
Designs were created with Eagle&lt;br /&gt;
&lt;br /&gt;
A limited functionality freeware version of Eagle can be downloaded here&lt;br /&gt;
&lt;br /&gt;
[http://www.cadsoftusa.com/download-eagle/freeware/?language=en Eagle Freeware]&lt;br /&gt;
&lt;br /&gt;
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here&lt;br /&gt;
&lt;br /&gt;
[http://dl.linux-sunxi.org/A10/ A10 datasheet]&lt;br /&gt;
&lt;br /&gt;
A serial connection can be made to the A13 board, which can help with debugging and is a booting option&lt;br /&gt;
&lt;br /&gt;
[[Serial connection to A13]] Description of how to connect a computer to the A13 board over serial.&lt;br /&gt;
&lt;br /&gt;
===Power===&lt;br /&gt;
&lt;br /&gt;
The A13-OLinuXino can be partially powered over Micro USB, but to power all peripherals, a 6+ watt DC power supply between 6 and 16 volts can be used.  The connector is a positive-center 2.5mm barrel plug.  There is also an on-board connector for a Li-PO battery.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Main_Page A generic wiki for the allwinner devices is here. It contains some great detailed info]&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal programming - no OS ===&lt;br /&gt;
&lt;br /&gt;
It is possible to program and debug code written directly on the chip without an OS such as linux or android.&amp;lt;br /&amp;gt;&lt;br /&gt;
The advantage is no kernel overhead and tighter control of the CPU operation.&lt;br /&gt;
&lt;br /&gt;
[[Bare Metal programming A13]]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - Nand flash ===&lt;br /&gt;
&lt;br /&gt;
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.&lt;br /&gt;
&lt;br /&gt;
The image in the Nand flash can be updated using the tools found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B7WHuNCASY8cWlZ2djh4X0QtV0U/edit?usp=sharing LiveSuit for Windows]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/LiveSuit LiveSuit for loading images]&lt;br /&gt;
&lt;br /&gt;
to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.&lt;br /&gt;
&lt;br /&gt;
Prebuilt images that can be programmed into the Nand flash can be found here.&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlR3hSS0R5aHpoVmM Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)] &lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwleXBMellGdWJ3RUk Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution ]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlbWVBN2RWVXBhTXc/edit?usp=sharing Android 4.1 NAND flash prebuild image for LCD480x272]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlcHFOcUxtQ1N5RDQ/edit A13-LCD43 script.bin]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - SD card ===&lt;br /&gt;
The A13 board can boot from an SD card. Just plug it in an imaged uSD card and connect power.&lt;br /&gt;
&lt;br /&gt;
Note: The SD card can easily be corrupted if power is removed while the system is booting or writing to system files.&lt;br /&gt;
To avoid this do not remove power while it is booting and shut the system down properly before disconnecting power.&lt;br /&gt;
&lt;br /&gt;
==== Prebuilt images ====&lt;br /&gt;
&lt;br /&gt;
Some prebuilt images have been created, follow the link below for details.&lt;br /&gt;
&lt;br /&gt;
[[Prebuilt SD card images running debian]]&lt;br /&gt;
&lt;br /&gt;
==== Build your own kernel and image onto SD card ====&lt;br /&gt;
&lt;br /&gt;
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
====Setup and configure the installed debian image====&lt;br /&gt;
&lt;br /&gt;
There are several settings that can be made for a particular hardware configuration in the script file. &lt;br /&gt;
&lt;br /&gt;
The following link explains the script file as well as wifi or ethernet setup and GPIO settings &lt;br /&gt;
&lt;br /&gt;
[[Configuration of hardware in the debian image]]&lt;br /&gt;
&lt;br /&gt;
====Installing UsbVideoClass(UVC) on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To work with USB Video Cameras you have to enable the UVC support in the kernel. The link below explains how to do it.&lt;br /&gt;
&lt;br /&gt;
[[UVC support]]&lt;br /&gt;
&lt;br /&gt;
====Setup VLC player for video streaming on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To setup video streaming you should first have installed UVC support so you can connect USB cameras to A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
[[VLC streaming]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a program to run on the A13-OlinuXino board ===&lt;br /&gt;
&lt;br /&gt;
[[Programming for A13 in debian]] Step by step instructions to make your first hello world program run on the A13 board running debian.&lt;br /&gt;
&lt;br /&gt;
=== Software Links ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Sunxi-tools Tools to hack A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/11/23/running-debian-with-xfce4-on-a13-olinuxino/ Installing Xfce4 graphical interface on Debian] How to install XFCE4 on A13-OLinuXino&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.0.3 ICS ===&lt;br /&gt;
&lt;br /&gt;
A13-SDK contain everything you need to build Android ACS 4.0.3 NAND image for A13-OLinuXino-WIFI. Both mirrors contain same image a13.tar.gz which you should unpack and follow the instructions inside. Builds on Debian 64bit as on Ubuntu have some problems with Java which we never managed to solve.&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!CgYGRQZL!BJXNQSQcRxLYswtsPI-EsjNTV0kk381Qzfs96Dx0Sn4 Mega upload mirror]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwldWIzY29GNDJ2ZW8 Gdrive mirror]&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.1 JB ===&lt;br /&gt;
&lt;br /&gt;
This is version 1.5 of A13-SDK which builds Android 4.1 Jelly Beans image. It works slower than 4.0.3 and we personally do not see any advantage to use 4.1 vs 4.0.3&lt;br /&gt;
&lt;br /&gt;
[http://emicrotec.at/public/ Andreas Auer kindly offered to host this 4GB image]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== List of Contributors ==&lt;br /&gt;
&lt;br /&gt;
'''Henrik Nordstrom''' - a.k.a. hno, uboot for A13 development, A1X guru, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Dimitar Gamishev''' - a.k.a. HEHOPMAJIEH, Linux kernel configuration for OLinuXino, Android images, LCD touchscreen&lt;br /&gt;
&lt;br /&gt;
'''Alexandro Mery''' - a.k.a. mnemoc, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Davide Fabbri''' - Linaro kernel and lubuntu image&lt;br /&gt;
&lt;br /&gt;
'''Scott Anderson''' - A13 wiki maintainer&lt;br /&gt;
&lt;br /&gt;
'''Jeffrey Wischkaemper''' - a.k.a. jwischka,  A13-OLinuXino Debian image with X &lt;br /&gt;
&lt;br /&gt;
'''Maxime Ripard''' - ARM Linux patches&lt;br /&gt;
&lt;br /&gt;
'''Jason Plum''' - Arch Linux support&lt;br /&gt;
&lt;br /&gt;
[[Category:A13]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=620</id>
		<title>A13-OLinuXino</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=620"/>
		<updated>2013-04-30T14:12:30Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:A13-OLinuXino-MAXI-WIFI-1.jpg|thumb| A13-OlinuXino-WIFI]]&lt;br /&gt;
&lt;br /&gt;
[[File:A13-OLinuXino-MICRO.jpg|thumb| A13-OlinuXino-MICRO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 processor from Allwinner runs at 1GHz with a Mali400 GPU. It was designed for integration into tablets. Olimex has made several development board designs based around this chip. This wiki page contains information about hardware and software to help make use of these development boards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 based boards currently available are&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/ A13-OLinuXino-WIFI] - Recommended if your developing software for the A13 for the first time as its the only one with network connectivity.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/ A13-OLinuXino] - This is the same as the WIFI version but without WIFI module and NAND flash. Note: Android requires NAND flash to run, so this board can't run Android.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/ A13-OLinuXino-MICRO] - Similar to the A13-OlinuXino but with less extras&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Projects people from the olinuxino community are working on or have finished and how they did it.&lt;br /&gt;
&lt;br /&gt;
'''LINUX:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Run Debian and u-boot, Step by step instructions how to make SD card image.&amp;lt;br&amp;gt;&lt;br /&gt;
[[Prebuilt SD card images running debian]] &lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/23/a13-olinuxino-playing-with-gpios/ Change GPIOs using scripts in linux]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=436.msg4066#msg4066 A13 OLinuXino fast GPIO with /dev/mem now achieve up to 2 Mhz toggle]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=899.0 A13 kernel module for direct support of UEXT MOD-IO board, adding ADC, relays etc, cool project can be used as reference how to make your own kernel modules]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B7WHuNCASY8cWnRrQ0tGVFMybFk Instructions how to run MOD-BT with A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
'''ANDROID:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/ Interface MOD-IO board with I2C under Android ]&lt;br /&gt;
&lt;br /&gt;
'''No OS'''&amp;lt;br&amp;gt;&lt;br /&gt;
[[Bare Metal programming A13]] Programming directly for the chip without an OS&lt;br /&gt;
&lt;br /&gt;
'''FreedomBox:'''&amp;lt;br&amp;gt;&lt;br /&gt;
[https://wiki.debian.org/FreedomBox/UniLeipzigPractical FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
Schematics and board designs can be found here&lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE Olimex Hardware]&lt;br /&gt;
&lt;br /&gt;
Designs were created with Eagle&lt;br /&gt;
&lt;br /&gt;
A limited functionality freeware version of Eagle can be downloaded here&lt;br /&gt;
&lt;br /&gt;
[http://www.cadsoftusa.com/download-eagle/freeware/?language=en Eagle Freeware]&lt;br /&gt;
&lt;br /&gt;
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here&lt;br /&gt;
&lt;br /&gt;
[http://dl.linux-sunxi.org/A10/ A10 datasheet]&lt;br /&gt;
&lt;br /&gt;
A serial connection can be made to the A13 board, which can help with debugging and is a booting option&lt;br /&gt;
&lt;br /&gt;
[[Serial connection to A13]] Description of how to connect a computer to the A13 board over serial.&lt;br /&gt;
&lt;br /&gt;
===Power===&lt;br /&gt;
&lt;br /&gt;
The A13-OLinuXino can be partially powered over Micro USB, but to power all peripherals, a 6+ watt DC power supply between 6 and 16 volts can be used.  The connector is a positive-center 2.5mm barrel plug.  There is also an on-board connector for a Li-PO battery.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Main_Page A generic wiki for the allwinner devices is here. It contains some great detailed info]&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal programming - no OS ===&lt;br /&gt;
&lt;br /&gt;
It is possible to program and debug code written directly on the chip without an OS such as linux or android.&amp;lt;br /&amp;gt;&lt;br /&gt;
The advantage is no kernel overhead and tighter control of the CPU operation.&lt;br /&gt;
&lt;br /&gt;
[[Bare Metal programming A13]]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - Nand flash ===&lt;br /&gt;
&lt;br /&gt;
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.&lt;br /&gt;
&lt;br /&gt;
The image in the Nand flash can be updated using the tools found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B7WHuNCASY8cWlZ2djh4X0QtV0U/edit?usp=sharing LiveSuit for Windows]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/LiveSuit LiveSuit for loading images]&lt;br /&gt;
&lt;br /&gt;
to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.&lt;br /&gt;
&lt;br /&gt;
Prebuilt images that can be programmed into the Nand flash can be found here.&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlR3hSS0R5aHpoVmM Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)] &lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwleXBMellGdWJ3RUk Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution ]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlbWVBN2RWVXBhTXc/edit?usp=sharing Android 4.1 NAND flash prebuild image for LCD480x272]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlcHFOcUxtQ1N5RDQ/edit A13-LCD43 script.bin]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - SD card ===&lt;br /&gt;
The A13 board can boot from an SD card. Just plug it in an imaged uSD card and connect power.&lt;br /&gt;
&lt;br /&gt;
Note: The SD card can easily be corrupted if power is removed while the system is booting or writing to system files.&lt;br /&gt;
To avoid this do not remove power while it is booting and shut the system down properly before disconnecting power.&lt;br /&gt;
&lt;br /&gt;
==== Prebuilt images ====&lt;br /&gt;
&lt;br /&gt;
Some prebuilt images have been created, follow the link below for details.&lt;br /&gt;
&lt;br /&gt;
[[Prebuilt SD card images running debian]]&lt;br /&gt;
&lt;br /&gt;
==== Build your own kernel and image onto SD card ====&lt;br /&gt;
&lt;br /&gt;
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
====Setup and configure the installed debian image====&lt;br /&gt;
&lt;br /&gt;
There are several settings that can be made for a particular hardware configuration in the script file. &lt;br /&gt;
&lt;br /&gt;
The following link explains the script file as well as wifi or ethernet setup and GPIO settings &lt;br /&gt;
&lt;br /&gt;
[[Configuration of hardware in the debian image]]&lt;br /&gt;
&lt;br /&gt;
====Installing UsbVideoClass(UVC) on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To work with USB Video Cameras you have to enable the UVC support in the kernel. The link below explains how to do it.&lt;br /&gt;
&lt;br /&gt;
[[UVC support]]&lt;br /&gt;
&lt;br /&gt;
====Setup VLC player for video streaming on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To setup video streaming you should first have installed UVC support so you can connect USB cameras to A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
[[VLC streaming]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a program to run on the A13-OlinuXino board ===&lt;br /&gt;
&lt;br /&gt;
[[Programming for A13 in debian]] Step by step instructions to make your first hello world program run on the A13 board running debian.&lt;br /&gt;
&lt;br /&gt;
=== Software Links ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Sunxi-tools Tools to hack A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/11/23/running-debian-with-xfce4-on-a13-olinuxino/ Installing Xfce4 graphical interface on Debian] How to install XFCE4 on A13-OLinuXino&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.0.3 ICS ===&lt;br /&gt;
&lt;br /&gt;
A13-SDK contain everything you need to build Android ACS 4.0.3 NAND image for A13-OLinuXino-WIFI. Both mirrors contain same image a13.tar.gz which you should unpack and follow the instructions inside. Builds on Debian 64bit as on Ubuntu have some problems with Java which we never managed to solve.&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!CgYGRQZL!BJXNQSQcRxLYswtsPI-EsjNTV0kk381Qzfs96Dx0Sn4 Mega upload mirror]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwldWIzY29GNDJ2ZW8 Gdrive mirror]&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.1 JB ===&lt;br /&gt;
&lt;br /&gt;
This is version 1.5 of A13-SDK which builds Android 4.1 Jelly Beans image. It works slower than 4.0.3 and we personally do not see any advantage to use 4.1 vs 4.0.3&lt;br /&gt;
&lt;br /&gt;
[http://emicrotec.at/public/ Andreas Auer kindly offered to host this 4GB image]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== List of Contributors ==&lt;br /&gt;
&lt;br /&gt;
'''Henrik Nordstrom''' - a.k.a. hno, uboot for A13 development, A1X guru, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Dimitar Gamishev''' - a.k.a. HEHOPMAJIEH, Linux kernel configuration for OLinuXino, Android images, LCD touchscreen&lt;br /&gt;
&lt;br /&gt;
'''Alexandro Mery''' - a.k.a. mnemoc, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Davide Fabbri''' - Linaro kernel and lubuntu image&lt;br /&gt;
&lt;br /&gt;
'''Scott Anderson''' - A13 wiki maintainer&lt;br /&gt;
&lt;br /&gt;
'''Jeffrey Wischkaemper''' - a.k.a. jwischka,  A13-OLinuXino Debian image with X &lt;br /&gt;
&lt;br /&gt;
'''Maxime Ripard''' - ARM Linux patches&lt;br /&gt;
&lt;br /&gt;
'''Jason Plum''' - Arch Linux support&lt;br /&gt;
&lt;br /&gt;
[[Category:A13]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=619</id>
		<title>A13-OLinuXino</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=619"/>
		<updated>2013-04-30T13:49:05Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Bare Metal programming - no OS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:A13-OLinuXino-MAXI-WIFI-1.jpg|thumb| A13-OlinuXino-WIFI]]&lt;br /&gt;
&lt;br /&gt;
[[File:A13-OLinuXino-MICRO.jpg|thumb| A13-OlinuXino-MICRO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 processor from Allwinner runs at 1GHz with a Mali400 GPU. It was designed for integration into tablets. Olimex has made several development board designs based around this chip. This wiki page contains information about hardware and software to help make use of these development boards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 based boards currently available are&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/ A13-OLinuXino-WIFI] - Recommended if your developing software for the A13 for the first time as its the only one with network connectivity.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/ A13-OLinuXino] - This is the same as the WIFI version but without WIFI module and NAND flash. Note: Android requires NAND flash to run, so this board can't run Android.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/ A13-OLinuXino-MICRO] - Similar to the A13-OlinuXino but with less extras&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Projects people from the olinuxino community are working on or have finished and how they did it.&lt;br /&gt;
&lt;br /&gt;
'''LINUX:'''&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Run Debian and u-boot, Step by step instructions how to make SD card image.&amp;lt;br&amp;gt;&lt;br /&gt;
[[Prebuilt SD card images running debian]] &lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/23/a13-olinuxino-playing-with-gpios/ Change GPIOs using scripts in linux]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=436.msg4066#msg4066 A13 OLinuXino fast GPIO with /dev/mem now achieve up to 2 Mhz toggle]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=899.0 A13 kernel module for direct support of UEXT MOD-IO board, adding ADC, relays etc, cool project can be used as reference how to make your own kernel modules]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B7WHuNCASY8cWnRrQ0tGVFMybFk Instructions how to run MOD-BT with A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
'''ANDROID:'''&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/ Interface MOD-IO board with I2C under Android ]&lt;br /&gt;
&lt;br /&gt;
'''FreedomBox:'''&lt;br /&gt;
&lt;br /&gt;
[https://wiki.debian.org/FreedomBox/UniLeipzigPractical FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
Schematics and board designs can be found here&lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE Olimex Hardware]&lt;br /&gt;
&lt;br /&gt;
Designs were created with Eagle&lt;br /&gt;
&lt;br /&gt;
A limited functionality freeware version of Eagle can be downloaded here&lt;br /&gt;
&lt;br /&gt;
[http://www.cadsoftusa.com/download-eagle/freeware/?language=en Eagle Freeware]&lt;br /&gt;
&lt;br /&gt;
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here&lt;br /&gt;
&lt;br /&gt;
[http://dl.linux-sunxi.org/A10/ A10 datasheet]&lt;br /&gt;
&lt;br /&gt;
A serial connection can be made to the A13 board, which can help with debugging and is a booting option&lt;br /&gt;
&lt;br /&gt;
[[Serial connection to A13]] Description of how to connect a computer to the A13 board over serial.&lt;br /&gt;
&lt;br /&gt;
===Power===&lt;br /&gt;
&lt;br /&gt;
The A13-OLinuXino can be partially powered over Micro USB, but to power all peripherals, a 6+ watt DC power supply between 6 and 16 volts can be used.  The connector is a positive-center 2.5mm barrel plug.  There is also an on-board connector for a Li-PO battery.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Main_Page A generic wiki for the allwinner devices is here. It contains some great detailed info]&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal programming - no OS ===&lt;br /&gt;
&lt;br /&gt;
It is possible to program and debug code written directly on the chip without an OS such as linux or android.&amp;lt;br /&amp;gt;&lt;br /&gt;
The advantage is no kernel overhead and tighter control of the CPU operation.&lt;br /&gt;
&lt;br /&gt;
[[Bare Metal programming A13]]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - Nand flash ===&lt;br /&gt;
&lt;br /&gt;
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.&lt;br /&gt;
&lt;br /&gt;
The image in the Nand flash can be updated using the tools found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B7WHuNCASY8cWlZ2djh4X0QtV0U/edit?usp=sharing LiveSuit for Windows]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/LiveSuit LiveSuit for loading images]&lt;br /&gt;
&lt;br /&gt;
to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.&lt;br /&gt;
&lt;br /&gt;
Prebuilt images that can be programmed into the Nand flash can be found here.&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlR3hSS0R5aHpoVmM Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)] &lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwleXBMellGdWJ3RUk Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution ]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlbWVBN2RWVXBhTXc/edit?usp=sharing Android 4.1 NAND flash prebuild image for LCD480x272]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlcHFOcUxtQ1N5RDQ/edit A13-LCD43 script.bin]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - SD card ===&lt;br /&gt;
The A13 board can boot from an SD card. Just plug it in an imaged uSD card and connect power.&lt;br /&gt;
&lt;br /&gt;
Note: The SD card can easily be corrupted if power is removed while the system is booting or writing to system files.&lt;br /&gt;
To avoid this do not remove power while it is booting and shut the system down properly before disconnecting power.&lt;br /&gt;
&lt;br /&gt;
==== Prebuilt images ====&lt;br /&gt;
&lt;br /&gt;
Some prebuilt images have been created, follow the link below for details.&lt;br /&gt;
&lt;br /&gt;
[[Prebuilt SD card images running debian]]&lt;br /&gt;
&lt;br /&gt;
==== Build your own kernel and image onto SD card ====&lt;br /&gt;
&lt;br /&gt;
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
====Setup and configure the installed debian image====&lt;br /&gt;
&lt;br /&gt;
There are several settings that can be made for a particular hardware configuration in the script file. &lt;br /&gt;
&lt;br /&gt;
The following link explains the script file as well as wifi or ethernet setup and GPIO settings &lt;br /&gt;
&lt;br /&gt;
[[Configuration of hardware in the debian image]]&lt;br /&gt;
&lt;br /&gt;
====Installing UsbVideoClass(UVC) on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To work with USB Video Cameras you have to enable the UVC support in the kernel. The link below explains how to do it.&lt;br /&gt;
&lt;br /&gt;
[[UVC support]]&lt;br /&gt;
&lt;br /&gt;
====Setup VLC player for video streaming on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To setup video streaming you should first have installed UVC support so you can connect USB cameras to A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
[[VLC streaming]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a program to run on the A13-OlinuXino board ===&lt;br /&gt;
&lt;br /&gt;
[[Programming for A13 in debian]] Step by step instructions to make your first hello world program run on the A13 board running debian.&lt;br /&gt;
&lt;br /&gt;
=== Software Links ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Sunxi-tools Tools to hack A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/11/23/running-debian-with-xfce4-on-a13-olinuxino/ Installing Xfce4 graphical interface on Debian] How to install XFCE4 on A13-OLinuXino&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.0.3 ICS ===&lt;br /&gt;
&lt;br /&gt;
A13-SDK contain everything you need to build Android ACS 4.0.3 NAND image for A13-OLinuXino-WIFI. Both mirrors contain same image a13.tar.gz which you should unpack and follow the instructions inside. Builds on Debian 64bit as on Ubuntu have some problems with Java which we never managed to solve.&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!CgYGRQZL!BJXNQSQcRxLYswtsPI-EsjNTV0kk381Qzfs96Dx0Sn4 Mega upload mirror]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwldWIzY29GNDJ2ZW8 Gdrive mirror]&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.1 JB ===&lt;br /&gt;
&lt;br /&gt;
This is version 1.5 of A13-SDK which builds Android 4.1 Jelly Beans image. It works slower than 4.0.3 and we personally do not see any advantage to use 4.1 vs 4.0.3&lt;br /&gt;
&lt;br /&gt;
[http://emicrotec.at/public/ Andreas Auer kindly offered to host this 4GB image]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== List of Contributors ==&lt;br /&gt;
&lt;br /&gt;
'''Henrik Nordstrom''' - a.k.a. hno, uboot for A13 development, A1X guru, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Dimitar Gamishev''' - a.k.a. HEHOPMAJIEH, Linux kernel configuration for OLinuXino, Android images, LCD touchscreen&lt;br /&gt;
&lt;br /&gt;
'''Alexandro Mery''' - a.k.a. mnemoc, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Davide Fabbri''' - Linaro kernel and lubuntu image&lt;br /&gt;
&lt;br /&gt;
'''Scott Anderson''' - A13 wiki maintainer&lt;br /&gt;
&lt;br /&gt;
'''Jeffrey Wischkaemper''' - a.k.a. jwischka,  A13-OLinuXino Debian image with X &lt;br /&gt;
&lt;br /&gt;
'''Maxime Ripard''' - ARM Linux patches&lt;br /&gt;
&lt;br /&gt;
'''Jason Plum''' - Arch Linux support&lt;br /&gt;
&lt;br /&gt;
[[Category:A13]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=618</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=618"/>
		<updated>2013-04-30T13:38:41Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see A13-OLinuXino already have support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Copying u boot to SD card===&lt;br /&gt;
Now the SD card is formatted and uboot has been compiled we can copy the files to the SD card.&lt;br /&gt;
&lt;br /&gt;
write Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===The hello world program compilation===&lt;br /&gt;
The compilation performed in a previous step compiled uboot but it also compiled a few stand alone programs which is the name u boot uses for programs that can be executed by uboot. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories olinuxino/examples/standalone/hello_world.c&lt;br /&gt;
&lt;br /&gt;
The compiled hello world program will be located at&lt;br /&gt;
???????? hello_world.bin&lt;br /&gt;
&lt;br /&gt;
copy this to a computer with a serial connection to the A13 olinuxino&lt;br /&gt;
&lt;br /&gt;
===Using uboot on the A13olinuxino===&lt;br /&gt;
Take the created SD card and with the power disconnected from the olinuxino board plug the SD card into the board.&lt;br /&gt;
&lt;br /&gt;
Connect the computer to the A13 olinuxino serial port with an appropriate level translator (the olinuxino serial levels are 0-3v3 they must be increased to RS232 levels)&lt;br /&gt;
&lt;br /&gt;
Setup your computer to look at the serial port. If a windows XP computer is used do this by starting hyperterminal.&amp;lt;br&amp;gt;&lt;br /&gt;
The serial settings are 115200 baud, 8 bits, 1 stop&lt;br /&gt;
&lt;br /&gt;
Turn the power on. &lt;br /&gt;
&lt;br /&gt;
Immediately data will be sent out the serial port, This is uboot starting up, after a few seconds data will stop sending and u boot is ready to use.&lt;br /&gt;
&lt;br /&gt;
typing in the terminal &amp;quot;help&amp;quot; will list the available commands&lt;br /&gt;
&lt;br /&gt;
The use of U boot is explained in [http://www.denx.de/wiki/DULG/Manual U boot manual] look for the section &amp;quot;u-boot command line interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
type &amp;quot;loadb&amp;quot; &amp;lt;br&amp;gt;&lt;br /&gt;
at this point uboot is waiting for the computer to send the binary file to it, it will not respond to commands until the binary is sent.&amp;lt;br&amp;gt;&lt;br /&gt;
To do this using hyperterminal click on tools -&amp;gt; send file -&amp;gt; locate the hello_world.bin and click send. After some time this will indicate its sent&lt;br /&gt;
&lt;br /&gt;
If no errors came up the terminal will report the file was loaded to 0x50000000 which is a location in RAM so now the file is in the ram of the A13olinuxino ready to be executed.&lt;br /&gt;
&lt;br /&gt;
To execute type &amp;quot;go 0x50000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If the terminal writes a few lines and says &amp;quot;Hit any key to exit ... &amp;quot;. You have executed your first program without linux on the A13olinuxino.&lt;br /&gt;
&lt;br /&gt;
===Run the hello world program from the SD card===&lt;br /&gt;
Nobody wants to run their code with a serial console forever here is how to load it from the SD card.&lt;br /&gt;
&lt;br /&gt;
At the moment a bug exists in the uboot code for the sunxi branch, this bug happens to overwrite sections of memory at 0x50000000 when the SD card is accessed. This wouldn't normally be a problem however the code is compiled to only operate from 0x50000000 the exact same location in RAM. &amp;lt;br&amp;gt;&lt;br /&gt;
This issue was reported to Henrik Nordström one of the developers for the sunxi branch of uboot, He quickly responded noting it was a bug and promptly fixed it in the development branch.&amp;lt;br&amp;gt;&lt;br /&gt;
A work around until this change is committed to the main branch is to change the make file setting of where the program is compiled to execute from. &lt;br /&gt;
In the file ????&lt;br /&gt;
Change the line ??? to 0x48000000&lt;br /&gt;
&lt;br /&gt;
0x48000000 is the area that was going to hold the kernel so we know its free.&lt;br /&gt;
&lt;br /&gt;
To recompile go to the directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the hello_world.bin can be copied to the SD card&lt;br /&gt;
&lt;br /&gt;
Move the SD card to the olinuxino board, power it on with the serial connection connected.&lt;br /&gt;
&lt;br /&gt;
If you type &amp;quot;help&amp;quot; you will notice the command fatls&lt;br /&gt;
&lt;br /&gt;
We are using a fat file system and fat ls will list the files available. To do this type the following in the terminal&lt;br /&gt;
&lt;br /&gt;
fatls mmc 0 0x48000000 hello_world.bin&lt;br /&gt;
&lt;br /&gt;
it will say something like &amp;quot;read 566 bytes&amp;quot; number of bytes may be different. If it says this the load was successful and the binary file is in ram at 0x48000000 as specified&lt;br /&gt;
&lt;br /&gt;
To execute again type &lt;br /&gt;
&lt;br /&gt;
go 0x48000000&lt;br /&gt;
&lt;br /&gt;
You may be thinking im still using the computer to execute this so what is the advantage. All of the commands sent can be scripted so that the stand alone program will load from the SD card and execute once the power is turned on.&lt;br /&gt;
&lt;br /&gt;
===Do something useful, Modify the hello world to set GPIO===&lt;br /&gt;
COMING SOON&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=617</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=617"/>
		<updated>2013-04-30T12:51:48Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup computer for cross compiling and compiling uboot===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see A13-OLinuXino already have support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
then write the partitions to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which U-boot understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Running hello world===&lt;br /&gt;
The compilation performed in the previous step compiles uboot and it compiles a few stand alone programs as uboot calls them. One stand alone program is the hello world program&lt;br /&gt;
&lt;br /&gt;
The hello world program code will be located in the directory previously created and in the following sub directories /examples/standalone/hello_world.c&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=616</id>
		<title>Bare Metal programming A13</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Bare_Metal_programming_A13&amp;diff=616"/>
		<updated>2013-04-30T12:29:21Z</updated>

		<summary type="html">&lt;p&gt;Scott: Created page with &amp;quot; Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out mo...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
Programming with no OS, development tools and poor documentation isn't easy therefore this page is currently a work in progress. It will be updated as the author works out more about the process&lt;br /&gt;
&lt;br /&gt;
== Stand alone program running with uboot==&lt;br /&gt;
The linux operating systems shown in the wiki runs on an SD card however it is booted using u-boot. U-boot sets up the CPU, memory and a few other things then starts Linux executing.&amp;lt;br&amp;gt;&lt;br /&gt;
The following method outlines how to create a program that replaces linux but still relies on u-boot for setup.&lt;br /&gt;
&lt;br /&gt;
=== Tools===&lt;br /&gt;
- Computer for cross compiling the program and uboot, such as a linux computer&amp;lt;br&amp;gt;&lt;br /&gt;
- SD card and SD card reader / writer&amp;lt;br&amp;gt;&lt;br /&gt;
- A13 olinuxino board&amp;lt;br&amp;gt;&lt;br /&gt;
- Serial adapter for the A13 olinuxino board (Only way to work with uboot as no screen is configured in uboot)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Setup u-boot ===&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=615</id>
		<title>A13-OLinuXino</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=615"/>
		<updated>2013-04-30T12:16:51Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Bare Metal programming - no OS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:A13-OLinuXino-MAXI-WIFI-1.jpg|thumb| A13-OlinuXino-WIFI]]&lt;br /&gt;
&lt;br /&gt;
[[File:A13-OLinuXino-MICRO.jpg|thumb| A13-OlinuXino-MICRO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 processor from Allwinner runs at 1GHz with a Mali400 GPU. It was designed for integration into tablets. Olimex has made several development board designs based around this chip. This wiki page contains information about hardware and software to help make use of these development boards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 based boards currently available are&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/ A13-OLinuXino-WIFI] - Recommended if your developing software for the A13 for the first time as its the only one with network connectivity.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/ A13-OLinuXino] - This is the same as the WIFI version but without WIFI module and NAND flash. Note: Android requires NAND flash to run, so this board can't run Android.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/ A13-OLinuXino-MICRO] - Similar to the A13-OlinuXino but with less extras&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Projects people from the olinuxino community are working on or have finished and how they did it.&lt;br /&gt;
&lt;br /&gt;
'''LINUX:'''&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Run Debian and u-boot, Step by step instructions how to make SD card image.&amp;lt;br&amp;gt;&lt;br /&gt;
[[Prebuilt SD card images running debian]] &lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/23/a13-olinuxino-playing-with-gpios/ Change GPIOs using scripts in linux]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=436.msg4066#msg4066 A13 OLinuXino fast GPIO with /dev/mem now achieve up to 2 Mhz toggle]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=899.0 A13 kernel module for direct support of UEXT MOD-IO board, adding ADC, relays etc, cool project can be used as reference how to make your own kernel modules]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B7WHuNCASY8cWnRrQ0tGVFMybFk Instructions how to run MOD-BT with A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
'''ANDROID:'''&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/ Interface MOD-IO board with I2C under Android ]&lt;br /&gt;
&lt;br /&gt;
'''FreedomBox:'''&lt;br /&gt;
&lt;br /&gt;
[https://wiki.debian.org/FreedomBox/UniLeipzigPractical FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
Schematics and board designs can be found here&lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE Olimex Hardware]&lt;br /&gt;
&lt;br /&gt;
Designs were created with Eagle&lt;br /&gt;
&lt;br /&gt;
A limited functionality freeware version of Eagle can be downloaded here&lt;br /&gt;
&lt;br /&gt;
[http://www.cadsoftusa.com/download-eagle/freeware/?language=en Eagle Freeware]&lt;br /&gt;
&lt;br /&gt;
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here&lt;br /&gt;
&lt;br /&gt;
[http://dl.linux-sunxi.org/A10/ A10 datasheet]&lt;br /&gt;
&lt;br /&gt;
A serial connection can be made to the A13 board, which can help with debugging and is a booting option&lt;br /&gt;
&lt;br /&gt;
[[Serial connection to A13]] Description of how to connect a computer to the A13 board over serial.&lt;br /&gt;
&lt;br /&gt;
===Power===&lt;br /&gt;
&lt;br /&gt;
The A13-OLinuXino can be partially powered over Micro USB, but to power all peripherals, a 6+ watt DC power supply between 6 and 16 volts can be used.  The connector is a positive-center 2.5mm barrel plug.  There is also an on-board connector for a Li-PO battery.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Main_Page A generic wiki for the allwinner devices is here. It contains some great detailed info]&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal programming - no OS ===&lt;br /&gt;
&lt;br /&gt;
Using the JTAG port on the A13 board and eclipse it is possible to program and debug code written directly on the chip without an OS.&amp;lt;br /&amp;gt;&lt;br /&gt;
The advantage is no kernel overhead and tighter control of the CPU operation.&lt;br /&gt;
&lt;br /&gt;
[[Bare Metal programming A13]]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - Nand flash ===&lt;br /&gt;
&lt;br /&gt;
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.&lt;br /&gt;
&lt;br /&gt;
The image in the Nand flash can be updated using the tools found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B7WHuNCASY8cWlZ2djh4X0QtV0U/edit?usp=sharing LiveSuit for Windows]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/LiveSuit LiveSuit for loading images]&lt;br /&gt;
&lt;br /&gt;
to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.&lt;br /&gt;
&lt;br /&gt;
Prebuilt images that can be programmed into the Nand flash can be found here.&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlR3hSS0R5aHpoVmM Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)] &lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwleXBMellGdWJ3RUk Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution ]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlbWVBN2RWVXBhTXc/edit?usp=sharing Android 4.1 NAND flash prebuild image for LCD480x272]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlcHFOcUxtQ1N5RDQ/edit A13-LCD43 script.bin]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - SD card ===&lt;br /&gt;
The A13 board can boot from an SD card. Just plug it in an imaged uSD card and connect power.&lt;br /&gt;
&lt;br /&gt;
Note: The SD card can easily be corrupted if power is removed while the system is booting or writing to system files.&lt;br /&gt;
To avoid this do not remove power while it is booting and shut the system down properly before disconnecting power.&lt;br /&gt;
&lt;br /&gt;
==== Prebuilt images ====&lt;br /&gt;
&lt;br /&gt;
Some prebuilt images have been created, follow the link below for details.&lt;br /&gt;
&lt;br /&gt;
[[Prebuilt SD card images running debian]]&lt;br /&gt;
&lt;br /&gt;
==== Build your own kernel and image onto SD card ====&lt;br /&gt;
&lt;br /&gt;
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
====Setup and configure the installed debian image====&lt;br /&gt;
&lt;br /&gt;
There are several settings that can be made for a particular hardware configuration in the script file. &lt;br /&gt;
&lt;br /&gt;
The following link explains the script file as well as wifi or ethernet setup and GPIO settings &lt;br /&gt;
&lt;br /&gt;
[[Configuration of hardware in the debian image]]&lt;br /&gt;
&lt;br /&gt;
====Installing UsbVideoClass(UVC) on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To work with USB Video Cameras you have to enable the UVC support in the kernel. The link below explains how to do it.&lt;br /&gt;
&lt;br /&gt;
[[UVC support]]&lt;br /&gt;
&lt;br /&gt;
====Setup VLC player for video streaming on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To setup video streaming you should first have installed UVC support so you can connect USB cameras to A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
[[VLC streaming]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a program to run on the A13-OlinuXino board ===&lt;br /&gt;
&lt;br /&gt;
[[Programming for A13 in debian]] Step by step instructions to make your first hello world program run on the A13 board running debian.&lt;br /&gt;
&lt;br /&gt;
=== Software Links ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Sunxi-tools Tools to hack A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/11/23/running-debian-with-xfce4-on-a13-olinuxino/ Installing Xfce4 graphical interface on Debian] How to install XFCE4 on A13-OLinuXino&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.0.3 ICS ===&lt;br /&gt;
&lt;br /&gt;
A13-SDK contain everything you need to build Android ACS 4.0.3 NAND image for A13-OLinuXino-WIFI. Both mirrors contain same image a13.tar.gz which you should unpack and follow the instructions inside. Builds on Debian 64bit as on Ubuntu have some problems with Java which we never managed to solve.&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!CgYGRQZL!BJXNQSQcRxLYswtsPI-EsjNTV0kk381Qzfs96Dx0Sn4 Mega upload mirror]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwldWIzY29GNDJ2ZW8 Gdrive mirror]&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.1 JB ===&lt;br /&gt;
&lt;br /&gt;
This is version 1.5 of A13-SDK which builds Android 4.1 Jelly Beans image. It works slower than 4.0.3 and we personally do not see any advantage to use 4.1 vs 4.0.3&lt;br /&gt;
&lt;br /&gt;
[http://emicrotec.at/public/ Andreas Auer kindly offered to host this 4GB image]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== List of Contributors ==&lt;br /&gt;
&lt;br /&gt;
'''Henrik Nordstrom''' - a.k.a. hno, uboot for A13 development, A1X guru, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Dimitar Gamishev''' - a.k.a. HEHOPMAJIEH, Linux kernel configuration for OLinuXino, Android images, LCD touchscreen&lt;br /&gt;
&lt;br /&gt;
'''Alexandro Mery''' - a.k.a. mnemoc, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Davide Fabbri''' - Linaro kernel and lubuntu image&lt;br /&gt;
&lt;br /&gt;
'''Scott Anderson''' - A13 wiki maintainer&lt;br /&gt;
&lt;br /&gt;
'''Jeffrey Wischkaemper''' - a.k.a. jwischka,  A13-OLinuXino Debian image with X &lt;br /&gt;
&lt;br /&gt;
'''Maxime Ripard''' - ARM Linux patches&lt;br /&gt;
&lt;br /&gt;
'''Jason Plum''' - Arch Linux support&lt;br /&gt;
&lt;br /&gt;
[[Category:A13]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=614</id>
		<title>A13-OLinuXino</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=614"/>
		<updated>2013-04-30T12:13:28Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:A13-OLinuXino-MAXI-WIFI-1.jpg|thumb| A13-OlinuXino-WIFI]]&lt;br /&gt;
&lt;br /&gt;
[[File:A13-OLinuXino-MICRO.jpg|thumb| A13-OlinuXino-MICRO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 processor from Allwinner runs at 1GHz with a Mali400 GPU. It was designed for integration into tablets. Olimex has made several development board designs based around this chip. This wiki page contains information about hardware and software to help make use of these development boards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 based boards currently available are&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/ A13-OLinuXino-WIFI] - Recommended if your developing software for the A13 for the first time as its the only one with network connectivity.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/ A13-OLinuXino] - This is the same as the WIFI version but without WIFI module and NAND flash. Note: Android requires NAND flash to run, so this board can't run Android.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/ A13-OLinuXino-MICRO] - Similar to the A13-OlinuXino but with less extras&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Projects people from the olinuxino community are working on or have finished and how they did it.&lt;br /&gt;
&lt;br /&gt;
'''LINUX:'''&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Run Debian and u-boot, Step by step instructions how to make SD card image.&amp;lt;br&amp;gt;&lt;br /&gt;
[[Prebuilt SD card images running debian]] &lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/23/a13-olinuxino-playing-with-gpios/ Change GPIOs using scripts in linux]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=436.msg4066#msg4066 A13 OLinuXino fast GPIO with /dev/mem now achieve up to 2 Mhz toggle]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=899.0 A13 kernel module for direct support of UEXT MOD-IO board, adding ADC, relays etc, cool project can be used as reference how to make your own kernel modules]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B7WHuNCASY8cWnRrQ0tGVFMybFk Instructions how to run MOD-BT with A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
'''ANDROID:'''&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/ Interface MOD-IO board with I2C under Android ]&lt;br /&gt;
&lt;br /&gt;
'''FreedomBox:'''&lt;br /&gt;
&lt;br /&gt;
[https://wiki.debian.org/FreedomBox/UniLeipzigPractical FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
Schematics and board designs can be found here&lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE Olimex Hardware]&lt;br /&gt;
&lt;br /&gt;
Designs were created with Eagle&lt;br /&gt;
&lt;br /&gt;
A limited functionality freeware version of Eagle can be downloaded here&lt;br /&gt;
&lt;br /&gt;
[http://www.cadsoftusa.com/download-eagle/freeware/?language=en Eagle Freeware]&lt;br /&gt;
&lt;br /&gt;
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here&lt;br /&gt;
&lt;br /&gt;
[http://dl.linux-sunxi.org/A10/ A10 datasheet]&lt;br /&gt;
&lt;br /&gt;
A serial connection can be made to the A13 board, which can help with debugging and is a booting option&lt;br /&gt;
&lt;br /&gt;
[[Serial connection to A13]] Description of how to connect a computer to the A13 board over serial.&lt;br /&gt;
&lt;br /&gt;
===Power===&lt;br /&gt;
&lt;br /&gt;
The A13-OLinuXino can be partially powered over Micro USB, but to power all peripherals, a 6+ watt DC power supply between 6 and 16 volts can be used.  The connector is a positive-center 2.5mm barrel plug.  There is also an on-board connector for a Li-PO battery.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Main_Page A generic wiki for the allwinner devices is here. It contains some great detailed info]&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal programming - no OS ===&lt;br /&gt;
&lt;br /&gt;
Using the JTAG port on the A13 board and eclipse it is possible to program and debug code written directly on the chip without an OS.&amp;lt;br /&amp;gt;&lt;br /&gt;
The advantage is no kernel overhead and tighter control of the CPU operation.&lt;br /&gt;
&lt;br /&gt;
Due to the lack of documentation from Allwinner the chip manufacturer nobody has yet been able to program directly on the chip.&lt;br /&gt;
&lt;br /&gt;
If anyone is successful or gathers more information on this please post on the forum and the wiki will be updated.&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - Nand flash ===&lt;br /&gt;
&lt;br /&gt;
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.&lt;br /&gt;
&lt;br /&gt;
The image in the Nand flash can be updated using the tools found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B7WHuNCASY8cWlZ2djh4X0QtV0U/edit?usp=sharing LiveSuit for Windows]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/LiveSuit LiveSuit for loading images]&lt;br /&gt;
&lt;br /&gt;
to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.&lt;br /&gt;
&lt;br /&gt;
Prebuilt images that can be programmed into the Nand flash can be found here.&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlR3hSS0R5aHpoVmM Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)] &lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwleXBMellGdWJ3RUk Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution ]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlbWVBN2RWVXBhTXc/edit?usp=sharing Android 4.1 NAND flash prebuild image for LCD480x272]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlcHFOcUxtQ1N5RDQ/edit A13-LCD43 script.bin]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - SD card ===&lt;br /&gt;
The A13 board can boot from an SD card. Just plug it in an imaged uSD card and connect power.&lt;br /&gt;
&lt;br /&gt;
Note: The SD card can easily be corrupted if power is removed while the system is booting or writing to system files.&lt;br /&gt;
To avoid this do not remove power while it is booting and shut the system down properly before disconnecting power.&lt;br /&gt;
&lt;br /&gt;
==== Prebuilt images ====&lt;br /&gt;
&lt;br /&gt;
Some prebuilt images have been created, follow the link below for details.&lt;br /&gt;
&lt;br /&gt;
[[Prebuilt SD card images running debian]]&lt;br /&gt;
&lt;br /&gt;
==== Build your own kernel and image onto SD card ====&lt;br /&gt;
&lt;br /&gt;
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
====Setup and configure the installed debian image====&lt;br /&gt;
&lt;br /&gt;
There are several settings that can be made for a particular hardware configuration in the script file. &lt;br /&gt;
&lt;br /&gt;
The following link explains the script file as well as wifi or ethernet setup and GPIO settings &lt;br /&gt;
&lt;br /&gt;
[[Configuration of hardware in the debian image]]&lt;br /&gt;
&lt;br /&gt;
====Installing UsbVideoClass(UVC) on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To work with USB Video Cameras you have to enable the UVC support in the kernel. The link below explains how to do it.&lt;br /&gt;
&lt;br /&gt;
[[UVC support]]&lt;br /&gt;
&lt;br /&gt;
====Setup VLC player for video streaming on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To setup video streaming you should first have installed UVC support so you can connect USB cameras to A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
[[VLC streaming]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a program to run on the A13-OlinuXino board ===&lt;br /&gt;
&lt;br /&gt;
[[Programming for A13 in debian]] Step by step instructions to make your first hello world program run on the A13 board running debian.&lt;br /&gt;
&lt;br /&gt;
=== Software Links ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Sunxi-tools Tools to hack A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/11/23/running-debian-with-xfce4-on-a13-olinuxino/ Installing Xfce4 graphical interface on Debian] How to install XFCE4 on A13-OLinuXino&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.0.3 ICS ===&lt;br /&gt;
&lt;br /&gt;
A13-SDK contain everything you need to build Android ACS 4.0.3 NAND image for A13-OLinuXino-WIFI. Both mirrors contain same image a13.tar.gz which you should unpack and follow the instructions inside. Builds on Debian 64bit as on Ubuntu have some problems with Java which we never managed to solve.&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!CgYGRQZL!BJXNQSQcRxLYswtsPI-EsjNTV0kk381Qzfs96Dx0Sn4 Mega upload mirror]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwldWIzY29GNDJ2ZW8 Gdrive mirror]&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.1 JB ===&lt;br /&gt;
&lt;br /&gt;
This is version 1.5 of A13-SDK which builds Android 4.1 Jelly Beans image. It works slower than 4.0.3 and we personally do not see any advantage to use 4.1 vs 4.0.3&lt;br /&gt;
&lt;br /&gt;
[http://emicrotec.at/public/ Andreas Auer kindly offered to host this 4GB image]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== List of Contributors ==&lt;br /&gt;
&lt;br /&gt;
'''Henrik Nordstrom''' - a.k.a. hno, uboot for A13 development, A1X guru, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Dimitar Gamishev''' - a.k.a. HEHOPMAJIEH, Linux kernel configuration for OLinuXino, Android images, LCD touchscreen&lt;br /&gt;
&lt;br /&gt;
'''Alexandro Mery''' - a.k.a. mnemoc, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Davide Fabbri''' - Linaro kernel and lubuntu image&lt;br /&gt;
&lt;br /&gt;
'''Scott Anderson''' - A13 wiki maintainer&lt;br /&gt;
&lt;br /&gt;
'''Jeffrey Wischkaemper''' - a.k.a. jwischka,  A13-OLinuXino Debian image with X &lt;br /&gt;
&lt;br /&gt;
'''Maxime Ripard''' - ARM Linux patches&lt;br /&gt;
&lt;br /&gt;
'''Jason Plum''' - Arch Linux support&lt;br /&gt;
&lt;br /&gt;
[[Category:A13]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=613</id>
		<title>A13-OLinuXino</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=613"/>
		<updated>2013-04-30T12:09:07Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:A13-OLinuXino-MAXI-WIFI-1.jpg|thumb| A13-OlinuXino-WIFI]]&lt;br /&gt;
&lt;br /&gt;
[[File:A13-OLinuXino-MICRO.jpg|thumb| A13-OlinuXino-MICRO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 processor from Allwinner runs at 1GHz with a Mali400 GPU. It was designed for integration into tablets. Olimex has made several development board designs based around this chip. This wiki page contains information about hardware and software to help make use of these development boards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 based boards currently available are&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/ A13-OLinuXino-WIFI] - Recommended if your developing software for the A13 for the first time as its the only one with network connectivity.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/ A13-OLinuXino] - This is the same as the WIFI version but without WIFI module and NAND flash. Note: Android requires NAND flash to run, so this board can't run Android.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/ A13-OLinuXino-MICRO] - Similar to the A13-OlinuXino but with less extras&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Projects people from the olinuxino community are working on or have finished and how they did it.&lt;br /&gt;
&lt;br /&gt;
'''LINUX:'''&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Run Debian and u-boot, Step by step instructions how to make SD card image.&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/23/a13-olinuxino-playing-with-gpios/ Change GPIOs using scripts in linux]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=436.msg4066#msg4066 A13 OLinuXino fast GPIO with /dev/mem now achieve up to 2 Mhz toggle]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=899.0 A13 kernel module for direct support of UEXT MOD-IO board, adding ADC, relays etc, cool project can be used as reference how to make your own kernel modules]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B7WHuNCASY8cWnRrQ0tGVFMybFk Instructions how to run MOD-BT with A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
'''ANDROID:'''&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/ Interface MOD-IO board with I2C under Android ]&lt;br /&gt;
&lt;br /&gt;
'''FreedomBox:'''&lt;br /&gt;
&lt;br /&gt;
[https://wiki.debian.org/FreedomBox/UniLeipzigPractical FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
Schematics and board designs can be found here&lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE Olimex Hardware]&lt;br /&gt;
&lt;br /&gt;
Designs were created with Eagle&lt;br /&gt;
&lt;br /&gt;
A limited functionality freeware version of Eagle can be downloaded here&lt;br /&gt;
&lt;br /&gt;
[http://www.cadsoftusa.com/download-eagle/freeware/?language=en Eagle Freeware]&lt;br /&gt;
&lt;br /&gt;
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here&lt;br /&gt;
&lt;br /&gt;
[http://dl.linux-sunxi.org/A10/ A10 datasheet]&lt;br /&gt;
&lt;br /&gt;
A serial connection can be made to the A13 board, which can help with debugging and is a booting option&lt;br /&gt;
&lt;br /&gt;
[[Serial connection to A13]] Description of how to connect a computer to the A13 board over serial.&lt;br /&gt;
&lt;br /&gt;
===Power===&lt;br /&gt;
&lt;br /&gt;
The A13-OLinuXino can be partially powered over Micro USB, but to power all peripherals, a 6+ watt DC power supply between 6 and 16 volts can be used.  The connector is a positive-center 2.5mm barrel plug.  There is also an on-board connector for a Li-PO battery.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Main_Page A generic wiki for the allwinner devices is here. It contains some great detailed info]&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal programming - no OS ===&lt;br /&gt;
&lt;br /&gt;
Using the JTAG port on the A13 board and eclipse it is possible to program and debug code written directly on the chip without an OS.&amp;lt;br /&amp;gt;&lt;br /&gt;
The advantage is no kernel overhead and tighter control of the CPU operation.&lt;br /&gt;
&lt;br /&gt;
Due to the lack of documentation from Allwinner the chip manufacturer nobody has yet been able to program directly on the chip.&lt;br /&gt;
&lt;br /&gt;
If anyone is successful or gathers more information on this please post on the forum and the wiki will be updated.&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - Nand flash ===&lt;br /&gt;
&lt;br /&gt;
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.&lt;br /&gt;
&lt;br /&gt;
The image in the Nand flash can be updated using the tools found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B7WHuNCASY8cWlZ2djh4X0QtV0U/edit?usp=sharing LiveSuit for Windows]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/LiveSuit LiveSuit for loading images]&lt;br /&gt;
&lt;br /&gt;
to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.&lt;br /&gt;
&lt;br /&gt;
Prebuilt images that can be programmed into the Nand flash can be found here.&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlR3hSS0R5aHpoVmM Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)] &lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwleXBMellGdWJ3RUk Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution ]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlbWVBN2RWVXBhTXc/edit?usp=sharing Android 4.1 NAND flash prebuild image for LCD480x272]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlcHFOcUxtQ1N5RDQ/edit A13-LCD43 script.bin]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - SD card ===&lt;br /&gt;
The A13 board can boot from an SD card. Just plug it in an imaged uSD card and connect power.&lt;br /&gt;
&lt;br /&gt;
Note: The SD card can easily be corrupted if power is removed while the system is booting or writing to system files.&lt;br /&gt;
To avoid this do not remove power while it is booting and shut the system down properly before disconnecting power.&lt;br /&gt;
&lt;br /&gt;
==== Prebuilt images ====&lt;br /&gt;
&lt;br /&gt;
Some prebuilt images have been created, follow the link below for details.&lt;br /&gt;
&lt;br /&gt;
[[Prebuilt SD card images running debian]]&lt;br /&gt;
&lt;br /&gt;
==== Build your own kernel and image onto SD card ====&lt;br /&gt;
&lt;br /&gt;
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
====Setup and configure the installed debian image====&lt;br /&gt;
&lt;br /&gt;
There are several settings that can be made for a particular hardware configuration in the script file. &lt;br /&gt;
&lt;br /&gt;
The following link explains the script file as well as wifi or ethernet setup and GPIO settings &lt;br /&gt;
&lt;br /&gt;
[[Configuration of hardware in the debian image]]&lt;br /&gt;
&lt;br /&gt;
====Installing UsbVideoClass(UVC) on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To work with USB Video Cameras you have to enable the UVC support in the kernel. The link below explains how to do it.&lt;br /&gt;
&lt;br /&gt;
[[UVC support]]&lt;br /&gt;
&lt;br /&gt;
====Setup VLC player for video streaming on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To setup video streaming you should first have installed UVC support so you can connect USB cameras to A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
[[VLC streaming]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a program to run on the A13-OlinuXino board ===&lt;br /&gt;
&lt;br /&gt;
[[Programming for A13 in debian]] Step by step instructions to make your first hello world program run on the A13 board running debian.&lt;br /&gt;
&lt;br /&gt;
=== Software Links ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Sunxi-tools Tools to hack A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/11/23/running-debian-with-xfce4-on-a13-olinuxino/ Installing Xfce4 graphical interface on Debian] How to install XFCE4 on A13-OLinuXino&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.0.3 ICS ===&lt;br /&gt;
&lt;br /&gt;
A13-SDK contain everything you need to build Android ACS 4.0.3 NAND image for A13-OLinuXino-WIFI. Both mirrors contain same image a13.tar.gz which you should unpack and follow the instructions inside. Builds on Debian 64bit as on Ubuntu have some problems with Java which we never managed to solve.&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!CgYGRQZL!BJXNQSQcRxLYswtsPI-EsjNTV0kk381Qzfs96Dx0Sn4 Mega upload mirror]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwldWIzY29GNDJ2ZW8 Gdrive mirror]&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.1 JB ===&lt;br /&gt;
&lt;br /&gt;
This is version 1.5 of A13-SDK which builds Android 4.1 Jelly Beans image. It works slower than 4.0.3 and we personally do not see any advantage to use 4.1 vs 4.0.3&lt;br /&gt;
&lt;br /&gt;
[http://emicrotec.at/public/ Andreas Auer kindly offered to host this 4GB image]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== List of Contributors ==&lt;br /&gt;
&lt;br /&gt;
'''Henrik Nordstrom''' - a.k.a. hno, uboot for A13 development, A1X guru, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Dimitar Gamishev''' - a.k.a. HEHOPMAJIEH, Linux kernel configuration for OLinuXino, Android images, LCD touchscreen&lt;br /&gt;
&lt;br /&gt;
'''Alexandro Mery''' - a.k.a. mnemoc, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Davide Fabbri''' - Linaro kernel and lubuntu image&lt;br /&gt;
&lt;br /&gt;
'''Scott Anderson''' - A13 wiki maintainer&lt;br /&gt;
&lt;br /&gt;
'''Jeffrey Wischkaemper''' - a.k.a. jwischka,  A13-OLinuXino Debian image with X &lt;br /&gt;
&lt;br /&gt;
'''Maxime Ripard''' - ARM Linux patches&lt;br /&gt;
&lt;br /&gt;
'''Jason Plum''' - Arch Linux support&lt;br /&gt;
&lt;br /&gt;
[[Category:A13]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=612</id>
		<title>A13-OLinuXino</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=612"/>
		<updated>2013-04-30T12:03:24Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:A13-OLinuXino-MAXI-WIFI-1.jpg|thumb| A13-OlinuXino-WIFI]]&lt;br /&gt;
&lt;br /&gt;
[[File:A13-OLinuXino-MICRO.jpg|thumb| A13-OlinuXino-MICRO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 processor from Allwinner runs at 1GHz with a Mali400 GPU. It was designed for integration into tablets. Olimex has made several development board designs based around this chip. This wiki page contains information about hardware and software to help make use of these development boards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 based boards currently available are&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/ A13-OLinuXino-WIFI] - Recommended if your developing software for the A13 for the first time as its the only one with network connectivity.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/ A13-OLinuXino] - This is the same as the WIFI version but without WIFI module and NAND flash. Note: Android requires NAND flash to run, so this board can't run Android.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/ A13-OLinuXino-MICRO] - Similar to the A13-OlinuXino but with less extras&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Projects people from the olinuxino community are working on or have finished and how they did it.&lt;br /&gt;
&lt;br /&gt;
'''LINUX PROJECTS:'''&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/23/a13-olinuxino-playing-with-gpios/ Change GPIOs using scripts in linux]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=436.msg4066#msg4066 A13 OLinuXino fast GPIO with /dev/mem now achieve up to 2 Mhz toggle]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=899.0 A13 kernel module for direct support of UEXT MOD-IO board, adding ADC, relays etc, cool project can be used as reference how to make your own kernel modules]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B7WHuNCASY8cWnRrQ0tGVFMybFk Instructions how to run MOD-BT with A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
'''ANDROID PROJECTS:'''&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/ Interface MOD-IO board with I2C under Android ]&lt;br /&gt;
&lt;br /&gt;
'''FreedomBox:'''&lt;br /&gt;
&lt;br /&gt;
[https://wiki.debian.org/FreedomBox/UniLeipzigPractical FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
Schematics and board designs can be found here&lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE Olimex Hardware]&lt;br /&gt;
&lt;br /&gt;
Designs were created with Eagle&lt;br /&gt;
&lt;br /&gt;
A limited functionality freeware version of Eagle can be downloaded here&lt;br /&gt;
&lt;br /&gt;
[http://www.cadsoftusa.com/download-eagle/freeware/?language=en Eagle Freeware]&lt;br /&gt;
&lt;br /&gt;
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here&lt;br /&gt;
&lt;br /&gt;
[http://dl.linux-sunxi.org/A10/ A10 datasheet]&lt;br /&gt;
&lt;br /&gt;
A serial connection can be made to the A13 board, which can help with debugging and is a booting option&lt;br /&gt;
&lt;br /&gt;
[[Serial connection to A13]] Description of how to connect a computer to the A13 board over serial.&lt;br /&gt;
&lt;br /&gt;
===Power===&lt;br /&gt;
&lt;br /&gt;
The A13-OLinuXino can be partially powered over Micro USB, but to power all peripherals, a 6+ watt DC power supply between 6 and 16 volts can be used.  The connector is a positive-center 2.5mm barrel plug.  There is also an on-board connector for a Li-PO battery.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Main_Page A generic wiki for the allwinner devices is here. It contains some great detailed info]&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal programming - no OS ===&lt;br /&gt;
&lt;br /&gt;
Using the JTAG port on the A13 board and eclipse it is possible to program and debug code written directly on the chip without an OS.&amp;lt;br /&amp;gt;&lt;br /&gt;
The advantage is no kernel overhead and tighter control of the CPU operation.&lt;br /&gt;
&lt;br /&gt;
Due to the lack of documentation from Allwinner the chip manufacturer nobody has yet been able to program directly on the chip.&lt;br /&gt;
&lt;br /&gt;
If anyone is successful or gathers more information on this please post on the forum and the wiki will be updated.&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - Nand flash ===&lt;br /&gt;
&lt;br /&gt;
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.&lt;br /&gt;
&lt;br /&gt;
The image in the Nand flash can be updated using the tools found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B7WHuNCASY8cWlZ2djh4X0QtV0U/edit?usp=sharing LiveSuit for Windows]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/LiveSuit LiveSuit for loading images]&lt;br /&gt;
&lt;br /&gt;
to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.&lt;br /&gt;
&lt;br /&gt;
Prebuilt images that can be programmed into the Nand flash can be found here.&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlR3hSS0R5aHpoVmM Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)] &lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwleXBMellGdWJ3RUk Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution ]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlbWVBN2RWVXBhTXc/edit?usp=sharing Android 4.1 NAND flash prebuild image for LCD480x272]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlcHFOcUxtQ1N5RDQ/edit A13-LCD43 script.bin]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - SD card ===&lt;br /&gt;
The A13 board can boot from an SD card. Just plug it in an imaged uSD card and connect power.&lt;br /&gt;
&lt;br /&gt;
Note: The SD card can easily be corrupted if power is removed while the system is booting or writing to system files.&lt;br /&gt;
To avoid this do not remove power while it is booting and shut the system down properly before disconnecting power.&lt;br /&gt;
&lt;br /&gt;
==== Prebuilt images ====&lt;br /&gt;
&lt;br /&gt;
Some prebuilt images have been created, follow the link below for details.&lt;br /&gt;
&lt;br /&gt;
[[Prebuilt SD card images running debian]]&lt;br /&gt;
&lt;br /&gt;
==== Build your own kernel and image onto SD card ====&lt;br /&gt;
&lt;br /&gt;
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
====Setup and configure the installed debian image====&lt;br /&gt;
&lt;br /&gt;
There are several settings that can be made for a particular hardware configuration in the script file. &lt;br /&gt;
&lt;br /&gt;
The following link explains the script file as well as wifi or ethernet setup and GPIO settings &lt;br /&gt;
&lt;br /&gt;
[[Configuration of hardware in the debian image]]&lt;br /&gt;
&lt;br /&gt;
====Installing UsbVideoClass(UVC) on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To work with USB Video Cameras you have to enable the UVC support in the kernel. The link below explains how to do it.&lt;br /&gt;
&lt;br /&gt;
[[UVC support]]&lt;br /&gt;
&lt;br /&gt;
====Setup VLC player for video streaming on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To setup video streaming you should first have installed UVC support so you can connect USB cameras to A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
[[VLC streaming]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a program to run on the A13-OlinuXino board ===&lt;br /&gt;
&lt;br /&gt;
[[Programming for A13 in debian]] Step by step instructions to make your first hello world program run on the A13 board running debian.&lt;br /&gt;
&lt;br /&gt;
=== Software Links ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Sunxi-tools Tools to hack A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/11/23/running-debian-with-xfce4-on-a13-olinuxino/ Installing Xfce4 graphical interface on Debian] How to install XFCE4 on A13-OLinuXino&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.0.3 ICS ===&lt;br /&gt;
&lt;br /&gt;
A13-SDK contain everything you need to build Android ACS 4.0.3 NAND image for A13-OLinuXino-WIFI. Both mirrors contain same image a13.tar.gz which you should unpack and follow the instructions inside. Builds on Debian 64bit as on Ubuntu have some problems with Java which we never managed to solve.&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!CgYGRQZL!BJXNQSQcRxLYswtsPI-EsjNTV0kk381Qzfs96Dx0Sn4 Mega upload mirror]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwldWIzY29GNDJ2ZW8 Gdrive mirror]&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.1 JB ===&lt;br /&gt;
&lt;br /&gt;
This is version 1.5 of A13-SDK which builds Android 4.1 Jelly Beans image. It works slower than 4.0.3 and we personally do not see any advantage to use 4.1 vs 4.0.3&lt;br /&gt;
&lt;br /&gt;
[http://emicrotec.at/public/ Andreas Auer kindly offered to host this 4GB image]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== List of Contributors ==&lt;br /&gt;
&lt;br /&gt;
'''Henrik Nordstrom''' - a.k.a. hno, uboot for A13 development, A1X guru, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Dimitar Gamishev''' - a.k.a. HEHOPMAJIEH, Linux kernel configuration for OLinuXino, Android images, LCD touchscreen&lt;br /&gt;
&lt;br /&gt;
'''Alexandro Mery''' - a.k.a. mnemoc, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Davide Fabbri''' - Linaro kernel and lubuntu image&lt;br /&gt;
&lt;br /&gt;
'''Scott Anderson''' - A13 wiki maintainer&lt;br /&gt;
&lt;br /&gt;
'''Jeffrey Wischkaemper''' - a.k.a. jwischka,  A13-OLinuXino Debian image with X &lt;br /&gt;
&lt;br /&gt;
'''Maxime Ripard''' - ARM Linux patches&lt;br /&gt;
&lt;br /&gt;
'''Jason Plum''' - Arch Linux support&lt;br /&gt;
&lt;br /&gt;
[[Category:A13]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=611</id>
		<title>A13-OLinuXino</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=611"/>
		<updated>2013-04-30T11:56:25Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:A13-OLinuXino-MAXI-WIFI-1.jpg|thumb| A13-OlinuXino-WIFI]]&lt;br /&gt;
&lt;br /&gt;
[[File:A13-OLinuXino-MICRO.jpg|thumb| A13-OlinuXino-MICRO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 processor from Allwinner runs at 1GHz with a Mali400 GPU. It was designed for integration into tablets. Olimex has made several development board designs based around this chip. This wiki page contains information about hardware and software to help make use of these development boards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 based boards currently available are&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/ A13-OLinuXino-WIFI] - Recommended if your developing software for the A13 for the first time as its the only one with network connectivity.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/ A13-OLinuXino] - This is the same as the WIFI version but without WIFI module and NAND flash. Note: Android requires NAND flash to run, so this board can't run Android.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/ A13-OLinuXino-MICRO] - Similar to the A13-OlinuXino but with less extras&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Projects people from the olinuxino community are working on or have finished and how they did it.&lt;br /&gt;
&lt;br /&gt;
'''LINUX PROJECTS:'''&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/23/a13-olinuxino-playing-with-gpios/ GPIOs ]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=436.msg4066#msg4066 A13 OLinuXino fast GPIO with /dev/mem now achieve up to 2 Mhz toggle]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=899.0 A13 kernel module for direct support of UEXT MOD-IO board, adding ADC, relays etc, cool project can be used as reference how to make your own kernel modules]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B7WHuNCASY8cWnRrQ0tGVFMybFk Instructions how to run MOD-BT with A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
'''ANDROID PROJECTS:'''&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/ Interface MOD-IO board with I2C under Android ]&lt;br /&gt;
&lt;br /&gt;
'''FreedomBox:'''&lt;br /&gt;
&lt;br /&gt;
[https://wiki.debian.org/FreedomBox/UniLeipzigPractical FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
Schematics and board designs can be found here&lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE Olimex Hardware]&lt;br /&gt;
&lt;br /&gt;
Designs were created with Eagle&lt;br /&gt;
&lt;br /&gt;
A limited functionality freeware version of Eagle can be downloaded here&lt;br /&gt;
&lt;br /&gt;
[http://www.cadsoftusa.com/download-eagle/freeware/?language=en Eagle Freeware]&lt;br /&gt;
&lt;br /&gt;
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here&lt;br /&gt;
&lt;br /&gt;
[http://dl.linux-sunxi.org/A10/ A10 datasheet]&lt;br /&gt;
&lt;br /&gt;
A serial connection can be made to the A13 board, which can help with debugging and is a booting option&lt;br /&gt;
&lt;br /&gt;
[[Serial connection to A13]] Description of how to connect a computer to the A13 board over serial.&lt;br /&gt;
&lt;br /&gt;
===Power===&lt;br /&gt;
&lt;br /&gt;
The A13-OLinuXino can be partially powered over Micro USB, but to power all peripherals, a 6+ watt DC power supply between 6 and 16 volts can be used.  The connector is a positive-center 2.5mm barrel plug.  There is also an on-board connector for a Li-PO battery.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Main_Page A generic wiki for the allwinner devices is here. It contains some great detailed info]&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal programming - no OS ===&lt;br /&gt;
&lt;br /&gt;
Using the JTAG port on the A13 board and eclipse it is possible to program and debug code written directly on the chip without an OS.&amp;lt;br /&amp;gt;&lt;br /&gt;
The advantage is no kernel overhead and tighter control of the CPU operation.&lt;br /&gt;
&lt;br /&gt;
Due to the lack of documentation from Allwinner the chip manufacturer nobody has yet been able to program directly on the chip.&lt;br /&gt;
&lt;br /&gt;
If anyone is successful or gathers more information on this please post on the forum and the wiki will be updated.&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - Nand flash ===&lt;br /&gt;
&lt;br /&gt;
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.&lt;br /&gt;
&lt;br /&gt;
The image in the Nand flash can be updated using the tools found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B7WHuNCASY8cWlZ2djh4X0QtV0U/edit?usp=sharing LiveSuit for Windows]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/LiveSuit LiveSuit for loading images]&lt;br /&gt;
&lt;br /&gt;
to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.&lt;br /&gt;
&lt;br /&gt;
Prebuilt images that can be programmed into the Nand flash can be found here.&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlR3hSS0R5aHpoVmM Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)] &lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwleXBMellGdWJ3RUk Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution ]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlbWVBN2RWVXBhTXc/edit?usp=sharing Android 4.1 NAND flash prebuild image for LCD480x272]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlcHFOcUxtQ1N5RDQ/edit A13-LCD43 script.bin]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - SD card ===&lt;br /&gt;
The A13 board can boot from an SD card. Just plug it in an imaged uSD card and connect power.&lt;br /&gt;
&lt;br /&gt;
Note: The SD card can easily be corrupted if power is removed while the system is booting or writing to system files.&lt;br /&gt;
To avoid this do not remove power while it is booting and shut the system down properly before disconnecting power.&lt;br /&gt;
&lt;br /&gt;
==== Prebuilt images ====&lt;br /&gt;
&lt;br /&gt;
Some prebuilt images have been created, follow the link below for details.&lt;br /&gt;
&lt;br /&gt;
[[Prebuilt SD card images running debian]]&lt;br /&gt;
&lt;br /&gt;
==== Build your own kernel and image onto SD card ====&lt;br /&gt;
&lt;br /&gt;
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
====Setup and configure the installed debian image====&lt;br /&gt;
&lt;br /&gt;
There are several settings that can be made for a particular hardware configuration in the script file. &lt;br /&gt;
&lt;br /&gt;
The following link explains the script file as well as wifi or ethernet setup and GPIO settings &lt;br /&gt;
&lt;br /&gt;
[[Configuration of hardware in the debian image]]&lt;br /&gt;
&lt;br /&gt;
====Installing UsbVideoClass(UVC) on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To work with USB Video Cameras you have to enable the UVC support in the kernel. The link below explains how to do it.&lt;br /&gt;
&lt;br /&gt;
[[UVC support]]&lt;br /&gt;
&lt;br /&gt;
====Setup VLC player for video streaming on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To setup video streaming you should first have installed UVC support so you can connect USB cameras to A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
[[VLC streaming]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a program to run on the A13-OlinuXino board ===&lt;br /&gt;
&lt;br /&gt;
[[Programming for A13 in debian]] Step by step instructions to make your first hello world program run on the A13 board running debian.&lt;br /&gt;
&lt;br /&gt;
=== Software Links ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Sunxi-tools Tools to hack A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/11/23/running-debian-with-xfce4-on-a13-olinuxino/ Installing Xfce4 graphical interface on Debian] How to install XFCE4 on A13-OLinuXino&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.0.3 ICS ===&lt;br /&gt;
&lt;br /&gt;
A13-SDK contain everything you need to build Android ACS 4.0.3 NAND image for A13-OLinuXino-WIFI. Both mirrors contain same image a13.tar.gz which you should unpack and follow the instructions inside. Builds on Debian 64bit as on Ubuntu have some problems with Java which we never managed to solve.&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!CgYGRQZL!BJXNQSQcRxLYswtsPI-EsjNTV0kk381Qzfs96Dx0Sn4 Mega upload mirror]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwldWIzY29GNDJ2ZW8 Gdrive mirror]&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.1 JB ===&lt;br /&gt;
&lt;br /&gt;
This is version 1.5 of A13-SDK which builds Android 4.1 Jelly Beans image. It works slower than 4.0.3 and we personally do not see any advantage to use 4.1 vs 4.0.3&lt;br /&gt;
&lt;br /&gt;
[http://emicrotec.at/public/ Andreas Auer kindly offered to host this 4GB image]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== List of Contributors ==&lt;br /&gt;
&lt;br /&gt;
'''Henrik Nordstrom''' - a.k.a. hno, uboot for A13 development, A1X guru, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Dimitar Gamishev''' - a.k.a. HEHOPMAJIEH, Linux kernel configuration for OLinuXino, Android images, LCD touchscreen&lt;br /&gt;
&lt;br /&gt;
'''Alexandro Mery''' - a.k.a. mnemoc, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Davide Fabbri''' - Linaro kernel and lubuntu image&lt;br /&gt;
&lt;br /&gt;
'''Scott Anderson''' - A13 wiki maintainer&lt;br /&gt;
&lt;br /&gt;
'''Jeffrey Wischkaemper''' - a.k.a. jwischka,  A13-OLinuXino Debian image with X &lt;br /&gt;
&lt;br /&gt;
'''Maxime Ripard''' - ARM Linux patches&lt;br /&gt;
&lt;br /&gt;
'''Jason Plum''' - Arch Linux support&lt;br /&gt;
&lt;br /&gt;
[[Category:A13]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=610</id>
		<title>A13-OLinuXino</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=A13-OLinuXino&amp;diff=610"/>
		<updated>2013-04-28T05:06:04Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Software */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:A13-OLinuXino-MAXI-WIFI-1.jpg|thumb| A13-OlinuXino-WIFI]]&lt;br /&gt;
&lt;br /&gt;
[[File:A13-OLinuXino-MICRO.jpg|thumb| A13-OlinuXino-MICRO]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 processor from Allwinner runs at 1GHz with a Mali400 GPU. It was designed for integration into tablets. Olimex has made several development board designs based around this chip. This wiki page contains information about hardware and software to help make use of these development boards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The A13 based boards currently available are&amp;lt;br /&amp;gt;&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-WIFI/ A13-OLinuXino-WIFI] - Recommended if your developing software for the A13 for the first time as its the only one with network connectivity.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/ A13-OLinuXino] - This is the same as the WIFI version but without WIFI module and NAND flash. Note: Android requires NAND flash to run, so this board can't run Android.&lt;br /&gt;
*[https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino-MICRO/ A13-OLinuXino-MICRO] - Similar to the A13-OlinuXino but with less extras&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
&lt;br /&gt;
Schematics and board designs can be found here&lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/tree/master/HARDWARE Olimex Hardware]&lt;br /&gt;
&lt;br /&gt;
Designs were created with Eagle&lt;br /&gt;
&lt;br /&gt;
A limited functionality freeware version of Eagle can be downloaded here&lt;br /&gt;
&lt;br /&gt;
[http://www.cadsoftusa.com/download-eagle/freeware/?language=en Eagle Freeware]&lt;br /&gt;
&lt;br /&gt;
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here&lt;br /&gt;
&lt;br /&gt;
[http://dl.linux-sunxi.org/A10/ A10 datasheet]&lt;br /&gt;
&lt;br /&gt;
A serial connection can be made to the A13 board, which can help with debugging and is a booting option&lt;br /&gt;
&lt;br /&gt;
[[Serial connection to A13]] Description of how to connect a computer to the A13 board over serial.&lt;br /&gt;
&lt;br /&gt;
===Power===&lt;br /&gt;
&lt;br /&gt;
The A13-OLinuXino can be partially powered over Micro USB, but to power all peripherals, a 6+ watt DC power supply between 6 and 16 volts can be used.  The connector is a positive-center 2.5mm barrel plug.  There is also an on-board connector for a Li-PO battery.&lt;br /&gt;
&lt;br /&gt;
==Software==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Main_Page A generic wiki for the allwinner devices is here. It contains some great detailed info]&lt;br /&gt;
&lt;br /&gt;
=== Bare Metal programming - no OS ===&lt;br /&gt;
&lt;br /&gt;
Using the JTAG port on the A13 board and eclipse it is possible to program and debug code written directly on the chip without an OS.&amp;lt;br /&amp;gt;&lt;br /&gt;
The advantage is no kernel overhead and tighter control of the CPU operation.&lt;br /&gt;
&lt;br /&gt;
Due to the lack of documentation from Allwinner the chip manufacturer nobody has yet been able to program directly on the chip.&lt;br /&gt;
&lt;br /&gt;
If anyone is successful or gathers more information on this please post on the forum and the wiki will be updated.&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - Nand flash ===&lt;br /&gt;
&lt;br /&gt;
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.&lt;br /&gt;
&lt;br /&gt;
The image in the Nand flash can be updated using the tools found at the following links:&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B7WHuNCASY8cWlZ2djh4X0QtV0U/edit?usp=sharing LiveSuit for Windows]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/LiveSuit LiveSuit for loading images]&lt;br /&gt;
&lt;br /&gt;
to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.&lt;br /&gt;
&lt;br /&gt;
Prebuilt images that can be programmed into the Nand flash can be found here.&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlR3hSS0R5aHpoVmM Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)] &lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwleXBMellGdWJ3RUk Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution ]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlbWVBN2RWVXBhTXc/edit?usp=sharing Android 4.1 NAND flash prebuild image for LCD480x272]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/file/d/0B-bAEPML8fwlcHFOcUxtQ1N5RDQ/edit A13-LCD43 script.bin]&lt;br /&gt;
&lt;br /&gt;
=== Using an operating system - SD card ===&lt;br /&gt;
The A13 board can boot from an SD card. Just plug it in an imaged uSD card and connect power.&lt;br /&gt;
&lt;br /&gt;
Note: The SD card can easily be corrupted if power is removed while the system is booting or writing to system files.&lt;br /&gt;
To avoid this do not remove power while it is booting and shut the system down properly before disconnecting power.&lt;br /&gt;
&lt;br /&gt;
==== Prebuilt images ====&lt;br /&gt;
&lt;br /&gt;
Some prebuilt images have been created, follow the link below for details.&lt;br /&gt;
&lt;br /&gt;
[[Prebuilt SD card images running debian]]&lt;br /&gt;
&lt;br /&gt;
==== Build your own kernel and image onto SD card ====&lt;br /&gt;
&lt;br /&gt;
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.&lt;br /&gt;
&lt;br /&gt;
[[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
====Setup and configure the installed debian image====&lt;br /&gt;
&lt;br /&gt;
There are several settings that can be made for a particular hardware configuration in the script file. &lt;br /&gt;
&lt;br /&gt;
The following link explains the script file as well as wifi or ethernet setup and GPIO settings &lt;br /&gt;
&lt;br /&gt;
[[Configuration of hardware in the debian image]]&lt;br /&gt;
&lt;br /&gt;
====Installing UsbVideoClass(UVC) on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To work with USB Video Cameras you have to enable the UVC support in the kernel. The link below explains how to do it.&lt;br /&gt;
&lt;br /&gt;
[[UVC support]]&lt;br /&gt;
&lt;br /&gt;
====Setup VLC player for video streaming on A13-OLinuXino board====&lt;br /&gt;
&lt;br /&gt;
To setup video streaming you should first have installed UVC support so you can connect USB cameras to A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
[[VLC streaming]]&lt;br /&gt;
&lt;br /&gt;
=== Creating a program to run on the A13-OlinuXino board ===&lt;br /&gt;
&lt;br /&gt;
[[Programming for A13 in debian]] Step by step instructions to make your first hello world program run on the A13 board running debian.&lt;br /&gt;
&lt;br /&gt;
=== Software Links ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Sunxi-tools Tools to hack A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/11/23/running-debian-with-xfce4-on-a13-olinuxino/ Installing Xfce4 graphical interface on Debian] How to install XFCE4 on A13-OLinuXino&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.0.3 ICS ===&lt;br /&gt;
&lt;br /&gt;
A13-SDK contain everything you need to build Android ACS 4.0.3 NAND image for A13-OLinuXino-WIFI. Both mirrors contain same image a13.tar.gz which you should unpack and follow the instructions inside. Builds on Debian 64bit as on Ubuntu have some problems with Java which we never managed to solve.&lt;br /&gt;
&lt;br /&gt;
[https://mega.co.nz/#!CgYGRQZL!BJXNQSQcRxLYswtsPI-EsjNTV0kk381Qzfs96Dx0Sn4 Mega upload mirror]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwldWIzY29GNDJ2ZW8 Gdrive mirror]&lt;br /&gt;
&lt;br /&gt;
=== A13-SDK Android 4.1 JB ===&lt;br /&gt;
&lt;br /&gt;
This is version 1.5 of A13-SDK which builds Android 4.1 Jelly Beans image. It works slower than 4.0.3 and we personally do not see any advantage to use 4.1 vs 4.0.3&lt;br /&gt;
&lt;br /&gt;
[http://emicrotec.at/public/ Andreas Auer kindly offered to host this 4GB image]&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
&lt;br /&gt;
FreedomBox:&lt;br /&gt;
&lt;br /&gt;
[https://wiki.debian.org/FreedomBox/UniLeipzigPractical FreedomBox/UniLeipzigPractical is the documentation of a freedom box related practical course at the AKSW Research Group at the University of Leipzig]&lt;br /&gt;
&lt;br /&gt;
ANDROID PROJECTS:&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/ Interface MOD-IO board with I2C under Android ]&lt;br /&gt;
&lt;br /&gt;
LINUX PROJECTS:&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/23/a13-olinuxino-playing-with-gpios/ GPIOs ]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=436.msg4066#msg4066 A13 OLinuXino fast GPIO with /dev/mem now achieve up to 2 Mhz toggle]&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=899.0 A13 kernel module for direct support of UEXT MOD-IO board, adding ADC, relays etc, cool project can be used as reference how to make your own kernel modules]&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B7WHuNCASY8cWnRrQ0tGVFMybFk Instructions how to run MOD-BT with A13-OLinuXino]&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
== List of Contributors ==&lt;br /&gt;
&lt;br /&gt;
'''Henrik Nordstrom''' - a.k.a. hno, uboot for A13 development, A1X guru, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Dimitar Gamishev''' - a.k.a. HEHOPMAJIEH, Linux kernel configuration for OLinuXino, Android images, LCD touchscreen&lt;br /&gt;
&lt;br /&gt;
'''Alexandro Mery''' - a.k.a. mnemoc, Linux-Sunxi maintainer&lt;br /&gt;
&lt;br /&gt;
'''Davide Fabbri''' - Linaro kernel and lubuntu image&lt;br /&gt;
&lt;br /&gt;
'''Scott Anderson''' - A13 wiki maintainer&lt;br /&gt;
&lt;br /&gt;
'''Jeffrey Wischkaemper''' - a.k.a. jwischka,  A13-OLinuXino Debian image with X &lt;br /&gt;
&lt;br /&gt;
'''Maxime Ripard''' - ARM Linux patches&lt;br /&gt;
&lt;br /&gt;
'''Jason Plum''' - Arch Linux support&lt;br /&gt;
&lt;br /&gt;
[[Category:A13]]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=609</id>
		<title>Build Bootable SD Card with Debian</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Build_Bootable_SD_Card_with_Debian&amp;diff=609"/>
		<updated>2013-04-28T05:02:21Z</updated>

		<summary type="html">&lt;p&gt;Scott: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The A13-OLinuXino-WIFI board ships with pre-loaded Android 4.0.3 image on the NAND flash, so it runs out of the box and you can have access to millions of applications on Google Play.&lt;br /&gt;
&lt;br /&gt;
There are also prebuilt SD card images that will boot to debian, they are linked to on the main A13 wiki page. These are suitable for anyone that doesn't want special kernel options.&lt;br /&gt;
&lt;br /&gt;
For those who want to use and develop on this board with Linux and require non standard kernel configurations this wiki explains step by step instructions to create an SD-card image that boots Debian on A13-OLinuXino. Big thanks to Dimitar Gamishev who initially demonstrated the whole build process. &lt;br /&gt;
&lt;br /&gt;
Note: The content is largely taken from this page of instructions&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ building bootable sd card with debian linux image for a13 olinuxino]&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/FirstSteps U-boot Sunxi Wiki with detailed info]&lt;br /&gt;
&lt;br /&gt;
== Tools required ==&lt;br /&gt;
&lt;br /&gt;
* A13-OLinuXino or A13-OLinuXino-WIFI&lt;br /&gt;
* Micro SD card larger than 2g&lt;br /&gt;
* A method to check the system worked, VGA screen or serial cable&lt;br /&gt;
* A computer that can run linux (These instructions do not work for windows)&lt;br /&gt;
Note: you can install Ubuntu freely to work on a machine that currently has windows. You will have the option to boot to either windows or linux&lt;br /&gt;
* Method to read or write to a Micro SD card from this computer.&lt;br /&gt;
* An internet connection for the linux computer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Instructions ==&lt;br /&gt;
&lt;br /&gt;
===Setup of the toolchain===&lt;br /&gt;
&lt;br /&gt;
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 so do this type in a terminal.&lt;br /&gt;
&lt;br /&gt;
$ sudo su&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
First update apt-get links by typing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the toolchain by typing the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.6-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with this line you make sure you have all tools necessary for the A13 kernel and uboot build: &lt;br /&gt;
&lt;br /&gt;
* GCC compiler used to compile the kernal&lt;br /&gt;
* The kernel config menu&lt;br /&gt;
* uboot make image which is required to allow the SD card to book into the linux image&lt;br /&gt;
* Git which allows you to download from the github which holds source code for some of the system&lt;br /&gt;
* Some other tools for building the kernel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
after the installation you now have all tools to make your very own A13 kernel image&lt;br /&gt;
&lt;br /&gt;
===Building Uboot===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community uboot is maintained by Henrik Nordström aka hno on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
First let’s make the directory where we will build the A13-OLinuXino Linux:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkdir olinuxino&lt;br /&gt;
# cd olinuxino&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then let’s download the uboot sources from GitHub repository, note there are lot of branches but you have to use sunxi branch, the files are about 70 MB&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download you should have a new directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd uboot-allwinner/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the following command you can start the uboot build:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make a13_olinuxino CROSS_COMPILE=arm-linux-gnueabi-&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see A13-OLinuXino already have support configuration in Allwinner community uboot&lt;br /&gt;
&lt;br /&gt;
At the end of the process you can check if everything is OK by&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls u-boot.bin spl/sunxi-spl.bin&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you got these two files everything is complete, well done so far&lt;br /&gt;
&lt;br /&gt;
===Building the Kernel===&lt;br /&gt;
&lt;br /&gt;
The Allwinner community Kernel is maintained by Alejandro Mery aka mnemoc on #freenode irc channel.&lt;br /&gt;
&lt;br /&gt;
Let’s first go back from uboot directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then download the Kernel sources, you should use  allwinner-v3.0-android-v2 branch, the sources are about 700 MB so you will have to wait a bit longer with this download:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# git clone https://github.com/linux-sunxi/linux-sunxi.git&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the download go to the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd linux-sunxi/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Compile the a13_configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm a13_defconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
as you see A13-OLinuXino have pre-made configuration in the community kernel sources&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm menuconfig&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this command you can add or remove different modules for the different peripherials in the kernel, be careful when use this as this may cause the kernel to not work properly&lt;br /&gt;
&lt;br /&gt;
The menuconfig created a .config text file, which you can view/edit even with a text editor like vi&lt;br /&gt;
&lt;br /&gt;
if you want to use GPIOs for instance they are not enabled by default and you can do this by adding:&lt;br /&gt;
&lt;br /&gt;
SUN4I_GPIO_UGLY = y inside .config&lt;br /&gt;
&lt;br /&gt;
then you can contiue with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when this finish's you will have uImage ready and you can build the kernel modules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules_install&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DONE! At this point you have uboot and kernel builds ready.&lt;br /&gt;
&lt;br /&gt;
===Format and setup the SD-card===&lt;br /&gt;
&lt;br /&gt;
First we have to make the correct card partitions, this is done with fdisk.&lt;br /&gt;
&lt;br /&gt;
Plug SD card into your SD card reader and enter in the terminal&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# ls /dev/sd&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press two times &amp;lt;TAB&amp;gt; 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 &amp;quot;sd&amp;quot; devices remove from the list.&lt;br /&gt;
&lt;br /&gt;
Once you know which device is your sdcard like sda use this text instead of the sdX name in the references below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# fdisk -u=sectors /dev/sdX&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then do these steps:&lt;br /&gt;
&lt;br /&gt;
1.  p&lt;br /&gt;
&lt;br /&gt;
will list your partitions&lt;br /&gt;
&lt;br /&gt;
if there are already partitions on your card do:&lt;br /&gt;
&lt;br /&gt;
2. d 1&lt;br /&gt;
&lt;br /&gt;
to delete them all&lt;br /&gt;
&lt;br /&gt;
3. n p 1&lt;br /&gt;
&lt;br /&gt;
create the first partition, starting from 2048 and ending to 34815&lt;br /&gt;
&lt;br /&gt;
4. beginning 2048 end 34815&lt;br /&gt;
&lt;br /&gt;
create second partition&lt;br /&gt;
&lt;br /&gt;
5. n p 2 enter enter&lt;br /&gt;
&lt;br /&gt;
then list the created partitions:&lt;br /&gt;
&lt;br /&gt;
6. p&lt;br /&gt;
&lt;br /&gt;
if you did everything correctly you should see something like:&lt;br /&gt;
&lt;br /&gt;
Disk /dev/sdX: 2001 MB, 2001731584 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
42 heads, 41 sectors/track, 2270 cylinders, total 3909632 sectors&amp;lt;br /&amp;gt;&lt;br /&gt;
Units = sectors of 1 * 512 = 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&amp;lt;br /&amp;gt;&lt;br /&gt;
Disk identifier: 0×00000000&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Device Boot Start End Blocks Id System&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX1 2048 34815 16384 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
/dev/sdX2 34816 3909631 1937408 83 Linux&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then write the partititons to the card&lt;br /&gt;
&lt;br /&gt;
7. w&lt;br /&gt;
&lt;br /&gt;
now we have to format the file system on the card:&lt;br /&gt;
&lt;br /&gt;
the first partition should be vfat as this is FS which the Allwinner bootloader understands&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.vfat /dev/sdX1&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
the second should be normal Linux EXT3 FS&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mkfs.ext3 /dev/sdX2&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Debian rootfs===&lt;br /&gt;
&lt;br /&gt;
The Linux Kernel and Uboot are ready, now we have the Linux distribution rootfs, 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.&lt;br /&gt;
&lt;br /&gt;
exit the kernel directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd ..&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download debian rootfs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# wget http://hands.com/~lkcl/mele_debian_armhf_minimal.cpio.gz&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
mount your sd card EXT3 FS partition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX2 /mnt&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cd /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and unarchive the rootfs&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# gunzip -c /home/user/olinuxino/mele_debian_armhf_minimal.cpio.gz | cpio -i&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
where &amp;quot;user&amp;quot; is the user name of your root user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
at this point you have Debian on your SD card second partition&lt;br /&gt;
&lt;br /&gt;
===Write Uboot and Kernel you build===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# mount /dev/sdX1 /mnt/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the Kernel uImage to root directory in partition 1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# cp linux-allwinner/arch/arm/boot/uImage /mnt/.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
download the script.bin from: &lt;br /&gt;
&lt;br /&gt;
[https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin https://github.com/OLIMEX/OLINUXINO/blob/master/SOFTWARE/A13/script.bin]&lt;br /&gt;
&lt;br /&gt;
and copy it to the same directory as uImage&lt;br /&gt;
&lt;br /&gt;
script.bin is a text file with very important configuration parameters like port GPIO assignments, DDR memory parameters, Video resolution etc, by changing these parameters in the script.bin you can configure your Linux without need to re-compile your kernel again and again this is smart way Allwinner provide for tweaking A13 Linux Kernel&lt;br /&gt;
&lt;br /&gt;
write the Uboot&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd uboot-allwinner/&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# sync&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
and copy the Kernel modules for partition 2&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# mount /dev/sdX2 /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cd ..&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# cp -a linux-allwinner/out/lib/modules/3.0.42+/ /mnt/lib/modules/.&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&lt;br /&gt;
# umount /mnt&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you have an SD card ready to boot debian on A13-OLinuXino.&lt;br /&gt;
&lt;br /&gt;
Connect USB-SERIAL-CABLE-F to UEXT Tx.Rx and GND, or connect a VGA screen. Put the SD-card in A13-OLinuXino(-WIFI) and apply power, you should see Uboot and then Kernel messages on the console&lt;br /&gt;
&lt;br /&gt;
default username/password is : root / password&lt;br /&gt;
&lt;br /&gt;
== Software Links ==&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/Linux Linux Sunxi] to build latest Kernel yourself&lt;br /&gt;
&lt;br /&gt;
[http://linux-sunxi.org/U-boot U-boot] to build community U-boot&lt;br /&gt;
&lt;br /&gt;
[http://olimex.wordpress.com/2012/10/12/building-bootable-sd-card-with-debian-linux-image-for-a13-olinuxino/ Building bootable Debian SD card for A13-OLinuXino] Original step by step instructions how to make SD card image with above Kernel and U-boot&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=518.0 Forum post ] with yet another more up to date explanation how to build SD card&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Programming_for_A13_in_debian&amp;diff=522</id>
		<title>Programming for A13 in debian</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Programming_for_A13_in_debian&amp;diff=522"/>
		<updated>2013-01-12T15:53:25Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Programming on the A13 board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
'''THIS IS A WORK IN PROGRESS'''&lt;br /&gt;
&lt;br /&gt;
== Programming for A13 in debian==&lt;br /&gt;
&lt;br /&gt;
There are 2 main methods to create programs for your A13 board. &lt;br /&gt;
* Cross compiling - Setting up a tool chain to compile on another system, which is typically faster and easier to manage.&lt;br /&gt;
* Programming on board - installing a compiler to compile directly on the board&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The sections below contain instructions for these 2 methods&lt;br /&gt;
&lt;br /&gt;
== Cross Compiling ==&lt;br /&gt;
Cross compiling is usually performed on another linux machine, it seems the most common for doing this is ubuntu. &lt;br /&gt;
&lt;br /&gt;
If you have compiled the kernel and setup the SD card you will already have most of the tool chain setup on your machine&lt;br /&gt;
&lt;br /&gt;
=== Setting up the tool chain ===&lt;br /&gt;
&lt;br /&gt;
The following instructions are to be performed on a linux machine which is not the A13 board.&lt;br /&gt;
&lt;br /&gt;
Complete the following steps to setup the tool chain.&lt;br /&gt;
&lt;br /&gt;
These instructions have been tested on ubuntu only however they may work for other distributions.&lt;br /&gt;
&lt;br /&gt;
==== Install eclipse ====&lt;br /&gt;
&lt;br /&gt;
Eclipse is a GUI which enables easy compilation and debugging when the appropriate tools have been installed.&lt;br /&gt;
&lt;br /&gt;
This may be able to be installed using the package manager on your linux system. &lt;br /&gt;
&lt;br /&gt;
'''Manual eclipes install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
To manually install the most up to date eclipse perform the following&lt;br /&gt;
&lt;br /&gt;
Go to the eclipse download section&lt;br /&gt;
&lt;br /&gt;
[http://www.eclipse.org/downloads/ Eclipse download] Download to your linux machine the suitable eclipse version.&lt;br /&gt;
&lt;br /&gt;
Decompress the downloaded file into any directory you like by moving the downloaded file to your desired directory.&lt;br /&gt;
Open a terminal, go to the directory and decompress with the command&lt;br /&gt;
&lt;br /&gt;
tar -xzvf FILENAME.&lt;br /&gt;
&lt;br /&gt;
This will create a directory in this location called eclipse&lt;br /&gt;
Within this directory is the executable eclipse.exe&lt;br /&gt;
&lt;br /&gt;
It is recommended to create a launcher on your desktop which points to this executable file to make it easier to start.&lt;br /&gt;
&lt;br /&gt;
'''Manual Java runtime install'''&amp;lt;br /&amp;gt;&lt;br /&gt;
As eclipse is written in java the jave runtime is required as well.&lt;br /&gt;
&lt;br /&gt;
Download the java runtime.&lt;br /&gt;
&lt;br /&gt;
[http://java.com/en/download/manual.jsp Java download page] Download the java RPM file that your eclipse version requires.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions on the java download page beside the download to install&lt;br /&gt;
&lt;br /&gt;
Your eclipse installation should now start up.&lt;br /&gt;
&lt;br /&gt;
==== Install the tool chain ====&lt;br /&gt;
&lt;br /&gt;
The instructions contained in this wiki were originally sourced from this page [http://www.agilart.com/blog/debugging-on-embedded-using-opensource-tools-part-1 Debugging on embedded using opensource tools]&lt;br /&gt;
&lt;br /&gt;
To compile code for the A13 the ArmV5 tool chain is required.&lt;br /&gt;
&lt;br /&gt;
Change to super user&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# sudo su&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install compilers, libs and make&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc g++ make libncurses5-dev&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Open the repository file&amp;lt;br /&amp;gt;&lt;br /&gt;
/etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
Add the following line&amp;lt;br /&amp;gt;&lt;br /&gt;
deb http://www.emdebian.org/debian/ squeeze main&lt;br /&gt;
&lt;br /&gt;
update the repository info&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get update&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
install some packages&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install linux-libc-dev-armel-cross &amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install libc6-armel-cross &amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install libc6-dev-armel-cross &amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install binutils-arm-linux-gnueabi &amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install gcc-4.4-arm-linux-gnueabi &amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install g++-4.4-arm-linux-gnueabi &amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# apt-get install uboot-mkimage &amp;lt;/nowiki&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tool chain should now be installed&lt;br /&gt;
&lt;br /&gt;
==== Creating a hello world program using eclipse ====&lt;br /&gt;
&lt;br /&gt;
Follow this tutorial to create a hello world program&lt;br /&gt;
[http://www.agilart.com/blog/debugging-on-embedded-using-opensource-tools-part-1 Debugging on embedded using opensource tools]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Some issues found for some users:&lt;br /&gt;
&lt;br /&gt;
'''- Issue :''' After having installed eclipse and the toolchain the path and prefix for the compiler as listed in the example could not be found.&lt;br /&gt;
&lt;br /&gt;
Solution : Look for the same prefix in a different path, /usr/bin is likely to hold the files.&lt;br /&gt;
&lt;br /&gt;
'''- Issue :''' Having built the program and copied it to the A13 board it will not run resulting in &amp;quot;permission denied&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Solution: Check the permissions for the file are set to allow execution by typing #ls -l . if you dont see a lot of x's (3) in the first column its likely your cause. To change the permissions type #chmod ugo+x FileName&lt;br /&gt;
&lt;br /&gt;
'''- Issue :''' executing the file returns &amp;quot;command not found&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Solution: A library file can not be found this is either /lib/ld-linux.so.3 or /lib/ld-linux-armhf.so.3 . To find the specific one your file is looking for open the executable in a text editor on the first line or 2 you will find the file name its looking for ld-linux.so.3 .&lt;br /&gt;
&lt;br /&gt;
== Programming on the A13 board ==&lt;br /&gt;
&lt;br /&gt;
Below is a way to create a hello world program on your A13 olinuxino board&lt;br /&gt;
&lt;br /&gt;
in a suitable folder create your code file by typing&amp;lt;br \&amp;gt;&lt;br /&gt;
nano hello.c&lt;br /&gt;
&lt;br /&gt;
type the following into the program&lt;br /&gt;
-----------------------&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;#include &amp;lt;stdio.h&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
main ()&amp;lt;br \&amp;gt;&lt;br /&gt;
{&amp;lt;br \&amp;gt;&lt;br /&gt;
printf(&amp;quot;hello world\n&amp;quot;);&amp;lt;br \&amp;gt;&lt;br /&gt;
}&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-----------------------&lt;br /&gt;
&lt;br /&gt;
save by pressing ctrl o&amp;lt;br \&amp;gt;&lt;br /&gt;
exit by pressing ctrl x&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
compile the program in the command line by typing&amp;lt;br \&amp;gt;&lt;br /&gt;
gcc -o hello hello.c&amp;lt;br \&amp;gt;&lt;br /&gt;
or&amp;lt;br \&amp;gt;&lt;br /&gt;
gcc-4.6 -o hello hello.c&lt;br /&gt;
&lt;br /&gt;
make the file executable by typing &amp;lt;br \&amp;gt;&lt;br /&gt;
chmod z+x hello&lt;br /&gt;
&lt;br /&gt;
Execute the binary file&amp;lt;br \&amp;gt;&lt;br /&gt;
./hello&lt;br /&gt;
&lt;br /&gt;
this should print out hello world&lt;br /&gt;
&lt;br /&gt;
if it has this means you have created a program on your A13 olinuxino board&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
	<entry>
		<id>https://www.olimex.com/wiki/index.php?title=Prebuilt_SD_card_images_running_debian&amp;diff=516</id>
		<title>Prebuilt SD card images running debian</title>
		<link rel="alternate" type="text/html" href="https://www.olimex.com/wiki/index.php?title=Prebuilt_SD_card_images_running_debian&amp;diff=516"/>
		<updated>2013-01-09T06:11:11Z</updated>

		<summary type="html">&lt;p&gt;Scott: /* Debian with GUI (X) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
The A13 board can boot from the SD card. There are some ready made SD card images that are suitable. Some of these images can be found in this wiki section.&lt;br /&gt;
&lt;br /&gt;
Once a suitable SD card is imaged with these files, place it into the board then power the board on, it should boot.&lt;br /&gt;
&lt;br /&gt;
All images will have been generated for a specific SD card size. To use these images you must use a SD card that is the specified size or larger. &lt;br /&gt;
&lt;br /&gt;
When the image is downloaded the SD card will only have partitions set up for the originally specified size for the image. If a larger SD card was used you can access the extra memory by using resize2fs.&lt;br /&gt;
&lt;br /&gt;
Note: Some SD cards will list a size on them however the exact number of usable bytes can vary either through bad sectors or different manufacturers. The consequence of this is that an image from a particular size SD card may not fit on another of the same size. If this is the case an error will come up when imaging the card &amp;quot;No space left on device&amp;quot; or a windows error depending on the tool being used. If this issue comes up use a larger SD card size.&lt;br /&gt;
&lt;br /&gt;
== Download Method==&lt;br /&gt;
These images can be downloaded using the methods below&lt;br /&gt;
&lt;br /&gt;
'''Windows:'''&lt;br /&gt;
* Download [http://sourceforge.net/projects/win32diskimager/ Win32 Disk Imager]&lt;br /&gt;
* Insert card&lt;br /&gt;
* Start program&lt;br /&gt;
* Select file&lt;br /&gt;
* Click &amp;quot;write&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Linux:'''&lt;br /&gt;
*transfer to card&lt;br /&gt;
For example an image with the file name of &amp;quot;debian_2g.img&amp;quot; would be downloaded to the SD card connected to a linux machine using one of the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;# dd bs=4M oflag=sync if=debian_2g.img of=/dev/sdX&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
or&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;# cp debian_2g.img /dev/sdX&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where X is the uSD card.&lt;br /&gt;
&lt;br /&gt;
==Images==&lt;br /&gt;
&lt;br /&gt;
===Debian image===&lt;br /&gt;
&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlU1NBQ015V2Naa2s A13 Debian Linux Image]&lt;br /&gt;
&lt;br /&gt;
Configuration&lt;br /&gt;
* 2g SD card image&lt;br /&gt;
* without X&lt;br /&gt;
* includes Mplayer CLI, GCC&lt;br /&gt;
* The default user/password are '''root'''/'''password''' &lt;br /&gt;
&lt;br /&gt;
Extract it and write the image (A13_Micro_Debian_first_preliminary_release.img) on SD card&lt;br /&gt;
&lt;br /&gt;
Note: as this comes in a tar.bz2 file this is best imaged using linux&lt;br /&gt;
&lt;br /&gt;
===Debian with GUI (X)===&lt;br /&gt;
Created by jwischka&lt;br /&gt;
&lt;br /&gt;
[https://dl.dropbox.com/u/26179254/olinuxino_xfce.zip A13 Debian Image with X V2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://files.wisch.org/olinuxino_xfce-20130108.zip A13 Debian Image with X V3]&lt;br /&gt;
&lt;br /&gt;
Configuration &amp;lt;br /&amp;gt;&lt;br /&gt;
V2&lt;br /&gt;
* 4g SD card image&lt;br /&gt;
* wpa-supplicant (change /etc/network/interfaces to enter your ssid/key)&lt;br /&gt;
* xfce4&lt;br /&gt;
* tightvncserver (starts on boot)&lt;br /&gt;
* various dev tools (python, gcc, etc)&lt;br /&gt;
* sudo&lt;br /&gt;
* 500mb swap file&lt;br /&gt;
* custom (non-debug) kernel&lt;br /&gt;
* default user name and password: olinuxino and olinuxino&lt;br /&gt;
&lt;br /&gt;
V3&lt;br /&gt;
* Updated kernel to 3.0.57.&lt;br /&gt;
* Changed FS to ext4, but left journaling intact. Journaling is fairly important when you may lose power at any point in time.&lt;br /&gt;
* Updated all packages to latest version.&lt;br /&gt;
&lt;br /&gt;
once logged in to start the user interface type &amp;quot;startx&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=537.0 Forum thread link for this image]&lt;br /&gt;
&lt;br /&gt;
===Linaro Image===&lt;br /&gt;
[https://docs.google.com/open?id=0B-bAEPML8fwlRm5ZSmZtUXQyMTg Linaro ALIP image]&lt;br /&gt;
&lt;br /&gt;
Configuration&lt;br /&gt;
* 4gb SD card image&lt;br /&gt;
* Linaro alip ( lubuntu 12.04 widh lxde desktop environment, minimal )&lt;br /&gt;
* kernel 3.4.19&lt;br /&gt;
* to setup networking you can edit /etc/network/interfaces&lt;br /&gt;
* Password is linaro&lt;br /&gt;
&lt;br /&gt;
[https://www.olimex.com/forum/index.php?topic=581.0 Forum thread link for this image]&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
		
	</entry>
</feed>