#Compiling AT91bootstrap 3.10.4

<abstract>
AT91bootstrap is the 2nd level bootloader used by the Microchip ARM MPUs to initializate the internal 
hardware (clocks, peripherals, DDR DRAM, etc) at startup and load the Linux Kernel image from the 
first microSD partition. 
</abstract>

This article is suggested for these boards:

* Aria SOM
* Arietta SOM

For the other boards please use the following articles:

* Roadrunner @article='at91bootstrap_4_0_4' 
* Acqua @article='at91bootstrap_4_0_4' 
* FOX Board G20 @article='acmeboot' 

##Toolchain installation

First of all you need to install the toolchain (cross compiler, linker, etc) on your Linux 
Ubuntu PC following this article (tested on Ubuntu 18.04.4 LTS):

* @article='arm9_toolchain'

##Download AT91bootstrap from Microchip GitHub repository:

	wget https://github.com/linux4sam/at91bootstrap/archive/refs/tags/v3.10.4.zip
	unzip v3.10.4.zip
	cd at91bootstrap-3.10.4

Add the AcmeSystems patches:

	wget https://www.acmesystems.it/www/at91bootstrap_3_10_4/acme.patch
	patch -p1 < acme.patch

## Set the board configuration

Aria

	make acme-aria_defconfig

Arietta 

	make acme-arietta_defconfig
	

## Change the default configuration

If you want to take a look to the at91bootstrap configuration run:

	make menuconfig
	
This function could be useful to change for example the Kernel line passed by at91bootstrap
to the kernel.

## Compiling

launch the compilation by typing:

	make CROSS_COMPILE=arm-linux-gnueabihf-

it will generate a binary fine in __./binaries__ directory with a different name for any board type.

A symbolic link is generated automatically during the at91bootstrap compilation
so you can refer to it with the name <b>boot.bin</b>.

## Copy boot.bin on a bootable MicroSD

If your board boot everything from the MicroSD copy boot.bin on the first microSD partition by typing:

	cp binaries/boot.bin /media/$USER/boot

## File used

* [acme-arietta_defconfig](./acme-arietta_defconfig)


<div class="row equal">

	<div class="col-md-3 col-sm-6">
		@include='card_roadrunner'
	</div>
	<div class="col-md-3 col-sm-6">
		@include='card_acqua'
	</div>

	<div class="col-md-3 col-sm-6">
		@include='card_aria'
	</div>

	<div class="col-md-3 col-sm-6">
		@include='card_arietta'
	</div>

</div>

