#Compiling AT91bootstrap 4.0.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. 
This article illustrates how to compile at91bootstrap for the RoadRunner module
</abstract>

##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 the sources from Microchip GitHub repository

	wget https://github.com/linux4sam/at91bootstrap/archive/refs/tags/v4.0.4.zip
	unzip v4.0.4.zip
	cd at91bootstrap-4.0.4

## Download and apply the Acme patches

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

Roadrunner

	make roadrunner_defconfig

Acqua

	make acqua_defconfig


## Source compiling

To compile at91bootstrap type:

	make CROSS_COMPILE=arm-linux-gnueabihf-

it will generate a binary file in __build/binaries__ directory called __boot.bin_.

## Copy boot.bin on a bootable MicroSD

Insert a microSD on your Linux PC and type:

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

Be sure that PA30 (MMC1 CD) is wired on GND.

## File used

* [roadrunner_defconfig](./roadrunner_defconfig)
* [acqua_defconfig](./acqua_defconfig)
* [acme.patch](./acme.patch)

## Links

* [At91Bootstrap home page](https://github.com/linux4sam/at91bootstrap)
* [At91Bootstrap Github repository](https://github.com/linux4sam/at91bootstrap)

@include='bio_tanzilli'
