Notes

You want to do something new with IoT, RFID ?. Drop me a message :).

Friday, October 25, 2013

Building Linux kernel image for ARM with Eclipse [Part 3]

D.  Build U-boot Boot loader Image

We will download the modified u-boot source code from Atmel. This version is more fit with AT91SAM family than the official u-boot version. In general, U-boot takes up for loading kernel image to RAM and setting up operation environment for kernel as well. 


Select branch master as picture below. This will update to u-boot latest version.






After completed downloading u-boot source code, we will import it to Eclipse. Change Perspective to Git Repositories as above figure and follows the figures below to complete import project.






Same way with kernel compilation, we need to set 3 environment variables as figures below.

ARCH=arm
CROSS_COMPILE=arm-none-linux-gnueabi-
PATH=${PATH}:${HOME}/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin


Next, we need create the make targets as figures below.
- distclean
- at91sam9260ek_nandflash
- at91sam9260ek_dataflash_cs0
- at91sam9260ek_dataflash_cs1



Finally, to build u-boot, subsequence runs the make targets: distclean -> at91sam9260ek_nandflash
Or distclean -> at91sam9260ek_dataflash_cs0,… Depending on your target board. In this project, we will build with at91sam9260ek_dataflash_cs0


Result is a file u-boot.bin created in root directory of source code.


E.  Build Bootstrap Image

Bootstrap initializes essential components of hardware as RAM, CPU clock… and load bootloader from media storage as Flash, EEPROM… to RAM.
Get bootstrap at git://github.com/linux4sam/at91bootstrap.git
Follow same steps with u-boot boot loader to download and configure bootstrap project for AT91 family.

Creates make targets as the figure below and consecutive runs these make targets in order:

Mrproper -> at91sam9260eknf_uboot_defconfig/ at91sam9260ekdf_uboot_defconfig -> all. Depending on your board configuration. 


Result is it will generate 3 file in binaries directory as figure below.


So far, we already downloaded, imported and configured source code for 3 projects consecutively. That are Linux kernel, u-boot boot loader and bootstrap as in the full picture below.



From now onward, we don’t need to remember a long list of configuration commands but only need to focus into coding. All commands now are done by using only mouse clicks. Happy!!!.

Let's enjoy "Love Story" before moving to next part :)).


No comments: