Armadeus 3
FIRST DRAFT !!!
This page will help you to use the upcoming Armadeus software release 3. This page also provides information about changes compared to the previous versions of Armadeus.
Contents
- 1 Introduction
- 2 How-to obtain the Armadeus 3
- 3 How-to configure and build Armadeus 3
- 4 How-to upgrade the apf9328 target
- 5 How-to develop with Armadeus
- 5.1 How-to add a software
- 5.2 How-to remove a software
- 5.3 How-to modify a software
- 5.4 How-to create a buildroot package
- 5.5 How-to modify root filesystem
- 5.6 How-to modify Linux kernel
- 5.7 How-to configure a Linux kernel
- 5.8 How-to configure U-Boot
- 5.9 How-to modify U-Boot
- 5.10 How-to configure busybox
Introduction
Armadeus 3 adds many new features, including the following:
- Some architectural changes to support different hardware targets (APF27 is coming soon)
- New versions of U-Boot (1.3.4), Linux kernel (2.6.27), GCC (4.2.1), Busybox (1.12.1) and also a recent version of Buildroot
- New naming convention of files
- New Flash partition mapping on the target
- TBC
How-to obtain the Armadeus 3
For the time being, the third generation of Armadeus is only available on the Subversion repository: https://armadeus.svn.sourceforge.net/svnroot/armadeus/trunk
You can checkout the new version of armadeus or update your working version of armadeus. We suggest you to use a new version of Armadeus because of the new naming convention of files.
- Checkout the new version:
$ svn co https://armadeus.svn.sourceforge.net/svnroot/armadeus/trunk armadeus3
this commmand will download the latest version of Armadeus.
Remarks: Do not use spaces in the directory name !
- Update your working version of armadeus:
$ svn update
- How-to obtain the legacy Armadeus 2 (If you're not ready to upgrade your target):
$ svn co https://armadeus.svn.sourceforge.net/svnroot/armadeus/trunk@914 armadeus2
How-to configure and build Armadeus 3
- After changing to the directory armadeus3, you have to configure Armadeus software for the APF9328 target. (Yes the new APF27 board support is coming soon. ;-) )
$ cd armadeus3/ $ make apf9328_defconfig
This configuration option is the first difference with the previous releases of Armadeus.
This configuration has to be done only once after a checkout or after an update from an older version Armadeus. This command launch the regular Buildroot configuration menu:
- Configure Armadeus
In Target options ---> Armadeus Device Support menu, you can check and change the quantity of RAM available on your Armadeus board (apf9328). (Default values 16MB are just fine with all APF9328 boards).
In Target filesystem options --> for each type of filesystems to build you have the option to copy the binary file to secondary location like your tftp server folder (for exemple /tftpboot).
In Target filesystem options --> You will find U-Boot options at the end of this menu including the option to copy U-Boot to a secondary location like /tftpboot
In Kernel --> Destination for linux kernel binaries --> You will find fine options to copy linux to a secondary location like /tftpboot
- Exit the configuration tool and save your configuration
- Launch build and take a cup of coffee for the next hour
$ make
The toolchain is built automatically. During this procedure, several files are downloaded from Internet. Please wait for a while.... it takes at least one hour for the first run!
- Enjoy the result
The generated binary files can be found in the new subdirectory buildroot/binaries/apf9328/:
- apf9328-u-boot.brec (BRecord image that can be used with the bootstrap, if U-Boot is not installed or not working, see BootLoader page)
- apf9328-u-boot.bin (U-Boot image file to be used with U-Boot itself, see updating U-Boot)
- apf9328-linux.bin (Linux image to use with U-Boot, see InstallLinux)
- apf9328-rootfs.arm.jffs2 (FileSystem/RootFS image to use with U-Boot, see RootFS flashing)
- apf9328-rootfs.arm.tar (for an NFS/MMC RootFS, see RootNFS? & Booting from a MMC/SD)
Please note the new naming convention of binary files and directories
The toolchain and project files share a new nameing convention too:
- buildroot/build_armv4t (contains all non configurable user-space tools)
- buildroot/project_build_armv4t/apf9328 (contains all configurable user-space tools: target filesystem, linux, busybox and u-boot...)
- buildroot/toolchain_build_armv4t (cross compilation toolchain)
More information is available in the buildroot documentation
- Prepare binary images for download
The simplest method to prepare binary files for a download to target is to copy them in the tftpboot public directory (for example /tftpbootr). You can do it manually:
$ cp -f buildroot/binaries/apf9328/* /tftpboot
Or you can configure buildroot to copy the image files automatically as described hereabove in Configure Armadeus.
From here we will suppose all the image files are available at the root of your tftp server
How-to upgrade the apf9328 target
To prepare the upgrade of the target you have to copy binary files from buildroot/binaries/apf9328/ to your /tftpboot folder or make this process automatic using the command: make menuconfig. The communication with target is fully compatible with previous versions of Armadeus, as explained in communicate with the target
update U-Boot (on the target)
Using the command printenv check the target IP variables:
BIOS> printenv bootcmd=run jffsboot bootdelay=20 ... gatewayip=192.168.0.1 netmask=255.255.255.0 ipaddr=192.168.0.10 serverip=192.168.0.2
ipaddr is the target IP address and serverip is the one of the Host PC running the tftp server. The page Target_Software_Installation will help you to set these variables.
If everything is fine you should be ready to download the new release of u-boot:
- Load the new U-Boot code in RAM
You can use the following commands to download U-boot:
With Ethernet and a TFTP server:
BIOS> tftpboot 08000000 apf9328-u-boot.bin
dm9000 i/o: 0x15c00000, id: 0x90000a46 DM9000: running in 16 bit mode MAC: 00:1e:ac:00:00:02 operating at 100M full duplex mode TFTP from server 192.168.0.2; our IP address is 192.168.0.10 Filename 'apf9328-u-boot.bin'. Load address: 0x8000000 Loading: ################################## done Bytes transferred = 173036 (2a3ec hex)
Or with Ethernet and a NFS server:
BIOS> nfs 08000000 ${serverip}:/nfs_path_to_buildroot/binaries/apf9328/apf9328-u-boot.bin
Or with the kermit and a serial line
BIOS> loadb 08000000 <CTRL><ALT GR>\ c send path_to_buildroot/binaries/apf9328/apf9328-u_boot.bin c
- Test the downloaded version of u-boot
BIOS> go 08000000 ## Starting application at 0x08000000 ... U-Boot 1.3.4 (Dec 2 2008 - 18:44:41) apf9328 patch 3.3 I2C: ready DRAM: 16 MB Flash: 8 MB In: serial Out: serial Err: serial Hit any key to stop autoboot: 0 BIOS>
- Transfer code from RAM to Flash memory
There is a simple U-Boot command/script to do that:
BIOS> run flash_uboot .. done Un-Protected 2 sectors .. done Erased 2 sectors Copy to Flash... done .. done Protected 2 sectors Flashing uboot succeed BIOS>
Advanced informations can be found at the BootLoader wiki page.
- Reset the environment variables and reset the board
Note: This is important to support the new flash memory mapping. !! You will loose all the variables you had defined before !!
BIOS> run flash_reset_env . done Un-Protected 1 sectors . done Erased 1 sectors Erasing of flash environment variables done! BIOS>
And finaly reset the board by hardware or software.
BIOS> reset U-Boot 1.3.4 (Dec 2 2008 - 18:44:41) apf9328 patch 3.3 I2C: ready DRAM: 16 MB Flash: 8 MB ...
update linux and rootfs (on the target)
- Check and set the IP variables:
BIOS> printenv bootcmd=run jffsboot bootdelay=20 ... gatewayip=192.168.0.1 netmask=255.255.255.0 ipaddr=192.168.0.10 serverip=192.168.0.2
ipaddr is the target IP address and serverip is the one of the Host PC running the tftp server. The page Target_Software_Installation will help you to set these variables.
You can use the dhcp command to automatically configure these variables from your DHCP server. You probably will have to adjust the serverip variable manually.
BIOS> dhcp dm9000 i/o: 0x15c00000, id: 0x90000a46 MAC: 00:0e:32:00:00:02 operating at 100M full duplex mode BOOTP broadcast 1 DHCP client bound to address 192.168.0.10 BIOS> setenv serverip 192.168.0.2 BIOS> saveenv
Do not forget to save your changes in FLASH, to have them available at next power up:
BIOS> saveenv
- Update Linux (still on the target)
Using the new release of U-Boot, it is quite simple to update Linux kernel and rootfs using the news scripts included in the release:
BIOS> run update_kernel
dm9000 i/o: 0x15c00000, id: 0x90000a46 DM9000: running in 16 bit mode MAC: 00:1e:ac:00:00:02 operating at 100M full duplex mode TFTP from server 192.168.0.2; our IP address is 192.168.0.10 Filename 'apf9328-linux.bin'. Load address: 0x8000000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ############################################## done Bytes transferred = 1564776 (17e068 hex) ................ done Erased 16 sectors Copy to Flash... done Flashing kernel succeed
- Update rootfs (still on the target)
BIOS> run update_rootfs
dm9000 i/o: 0x15c00000, id: 0x90000a46 DM9000: running in 16 bit mode MAC: 00:1e:ac:00:00:02 operating at 100M full duplex mode TFTP from server 192.168.0.2; our IP address is 192.168.0.10 Filename 'apf9328-rootfs.arm.jffs2'. Load address: 0x8000000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ###################################################### done Bytes transferred = 3932160 (3c0000 hex) ........................................... done Erased 43 sectors Copy to Flash... done Flashing rootfs succeed BIOS>
update your fpga firmware (on the target)
How-to develop with Armadeus
Your new Armadeus 3 is running fine on the target. Now you probably would like to customize the target for your project.
How-to add a software
Use the command make menuconfig':
$ make menuconfig
Select your package in the menu "package", save the configuration and compile a new rootfs
$ make
On the target, download and flash the new rootfs:
BIOS> run update_rootfs ...
BIOS> boot
How-to remove a software
Supposing you would like to remove an unwanted package from the target.
- The first step is to use the command make menuconfig to unselect this package but this commnand will not remove the package from the rootfs. You have to use the clean command of buildroot. In the lines hereafter replace the word <package> with the real name of your package.
$ make menuconfig ... deselect your <package> $ make <package>-clean $ make
Your new rootfs is now ready to use - Enjoy
- Some packages do not support any uninstall behavior. In that case, you can still rebuild the rootfs manualy.
$ make menuconfig ... deselect your <package> $ rm -rf buildroot/project_build_armv4t/apf9328/root $ rm -rf buildroot/project_build_armv4t/apf9328/.root $ make
WARNING: Using this method you will lose any modification you could have done directly in the directory buildroot/project_build_armv4t/apf9328/root.
Please read the chapter How-to modify root filesystem hereafter.
Your new rootfs is ready to use - Enjoy
- There is still another method to remove a package safely using the global clean command. That command requests to compile almost everything and therefore will take time.
$ make menuconfig ... deselect your <package> $ make clean $ make
WARNING: Using this method you will lose any modification you could have done directly in the directory buildroot/project_build_armv4t/apf9328/root.
Please read the chapter How-to modifify root filesystem hereafter.
Your new rootfs is ready to use - Enjoy
How-to modify a software
You would like to modify a package and test your modification on the target. The command make <package>-clean will force to rebuild the package you modified:
$ make <package>-clean $ make
Your new rootfs is ready to use - Enjoy
How-to create a buildroot package
The creation of a new buildroot package is more in depth described in the specific wiki page Buildroot_Packages and in the buildroot documentation
How-to modify root filesystem
There are different methods to modify the rootfs of the apf9328:
- modify files directly on the target (ideal solution for first trials)
- modify files in buildroot/project_build_armv4t/apf9328/root/ (to validate your modification with armadeus)
- modify files in buildroot/target/device/aramdeus/rootfs/target_skeleton (your modifcation will support a make clean )
- create a patch file in armadeus/patches (your modification will support a svn update)
How-to modify Linux kernel
To rebuild the kernel or any kernel driver you can use the command make linux26-clean; make. please note the new package name use by buildroot for Linux: linux26
$ make linux26-clean $ make
your new Linux kernel and rootfs containing drivers are ready to use - Enjoy
There is another method to rebuild the kernel faster than the previous one:
$ make linux26 $ make
With this method only the modified files are compiled.
How-to configure a Linux kernel
There is a command to modify the linux kernel configuration:
$make linux26-menuconfig
Modify your kernel configuration, save your change and rebuild Armadeus in few seconds:
$make
How-to configure U-Boot
you can change the U-Boot configuration using the buildroot command make menuconfig. U-Boot options are in the sub-menu target filesystem options. In order to rebuild U-Boot with new options it is necessary to remove U-Boot first:
$make menuconfig ... $make u-boot-dirclean $make
WARNING: the command make u-boot-dirclean delete the U-Boot directory and any modification you did in this directory.
How-to modify U-Boot
To rebuild U-Boot you can use the command make u-boot-clean; make.
$ make u-boot-clean $ make
your new U-Boot is ready to use - Enjoy
If you modify the config file apf9328.h located in buildroot/project_build_armv4t/apf9328/u-boot-1.3.4/include/configs/apf9328.h, then we suggest you to rebuild the whole u-boot package:
$ make u-boot-distclean $ make
How-to configure busybox
It also possible to modify the Busybox configuration to add or remove some features:
$make busybox-menuconfig
to be continued...