Armadeus 3

From ArmadeusWiki
Revision as of 04:08, 11 December 2012 by Jorasse (Talk | contribs) (How-to obtain the Armadeus 3)

Jump to: navigation, search

This page will help you use the Armadeus 3.x software release. It also provides you with information about changes compared to the previous 2.x versions of Armadeus.


Introduction

Armadeus 3 adds many new features, including the following:

  • Some architectural changes to support different hardware targets: APF9328 and APF27
  • 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

Important Information regarding documentation

Note Note: With the introduction of the Armadeus 3 SDK, the Wiki documentation has moved to support the new software. Nevertheless you can download the following HTML dump to have the Armadeus 2.x compatible documentation: Armadeus 2.x wiki. Wiki will also moved in the next weeks so to have an always Armadeus 3.x compatible HTML dump it's here


To summarize the documentation changes, here are the rules to adapt the documentation according to your target and version of Armadeus.

  • First Armadeus configuration once you have downloaded the Armadeus package found somewhere in First Setup pages:
Armadeus 3 first command to use according to your <board> (apf9328 or apf27): make <board>_defconfig
Armadeus 2 first command for apf9328: make
  • Binary files location according to your <board> (apf9328 or apf27):
Armadeus 3 is buildroot/binaries/<board>/
Armadeus 2 was buildroot/armadeus/
  • Armadeus 3 binary files naming convention according to your <board> (apf9328 or apf27):
<board>-u-boot.brec
<board>-u-boot.bin
<board>-linux.bin
<board>-rootfs.arm.jffs2
<board>-rootfs.arm.tar
  • Armadeus 2 binary files naming convention for apf9328 only:
u-boot.brec
u-boot.bin
linux-kernel-2.6.xx.x-arm.bin
rootfs.arm.jffs2
rootfs.arm.tar
  • Non configurable users-space tools including compiler for your board (apf9328 or apf27):
Armadeus 3 tools for the apf9328 are located at buildroot/build_armv4t/
Armadeus 3 tools for the apf27 are located at buildroot/build_armv5te/
Armadeus 2 tools are located at buildroot/build_arm/
  • Configurable user-space tools (Linux, rootfs, U-Boot, Busybox...) for your board (apf9328 or apf27):
Armadeus 3 tools for the apf9328 are located at buildroot/project_build_armv4t/apf9328/
Armadeus 3 tools for the apf27 are located at buildroot/project_build_armv5te/apf27/
Armadeus 2 tools are located at buildroot/project_build_arm/armadeus/
  • cross compilation toolchain for your board (apf9328 or apf27):
Armadeus 3 source toolchain for the apf9328 is located at buildroot/toolchain_build_armv4t/
Armadeus 3 source toolchain for the apf27 is located at buildroot/toolchain_build_armv5te/
Armadeus 2 toolchain is located at buildroot/toolchain_build_arm/

Keeping these rules in mind, you are ready to use any wiki page as a guideline whatever you are working with: Armadeus 2.x or 3.

How-to obtain the Armadeus 3

The third generation of Armadeus is either available on the GIT repository: git://git.code.sf.net/p/armadeus/code or by download: https://sourceforge.net/project/showfiles.php?group_id=122057

You can checkout the new version of armadeus or update your working version of armadeus. We strongly suggest you to checkout the new version of Armadeus because the new naming convention of files will produce a second directory structure of toolchain, projects, build and image files that could be a source of confusion.

  • Checkout the new version:
  git clone git://git.code.sf.net/p/armadeus/code armadeus

this commmand will download the latest version of Armadeus.

Remarks: Do not use spaces in the directory name !


  • Update your working version of armadeus

WARNING: Do not use a simple "git checkout" because some legacy buildroot patches will break your compilation!

 cd armadeus
 rm -rf buildroot/package
 rm -rf buildroot/target
 rm -rf buildroot/toolchain
 git checkout -f
 make apf9328_defconfig or make apf27_defconfig

WARNING: the latest command (make <board>_defconfig ) is very important to start with an up to date configuration!

At any time you can cleanup the old directories built with armadeus 2:

 rm -rf buildroot/binaries/armadeus
 rm -rf buildroot/build_arm
 rm -rf buildroot/project_build_arm
 rm -rf buildroot/toolchain_build_arm


  • 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 the directory to armadeus, you have to configure Armadeus software for the APF target.
 cd armadeus/
 make '''apf9328_defconfig''' or make '''apf27_defconfig''' 


The '<board>_defconfig' 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 configures Armadeus for the apf board then launches the regular Buildroot configuration menu:


Menuconfig3.png


  • Configure Armadeus

In System configuration ---> Armadeus Device Support menu, you can check and change the quantity of RAM available on your Armadeus board. (Default value 16MB is just fine with all APF9328 boards and 64MB for the smallest apf27).

In Filesystem images --> 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 Bootloaders --> 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 options to copy linux to a secondary location like /tftpboot


  • Exit the configuration tool and save your configuration


  • Launch the build process and enjoy 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 to compile everything!


  • Enjoy the result


The generated binary files can be found in the new subdirectory buildroot/binaries/<board>/:

apf9328-u-boot.brec (apf9328 BRecord image that can be used with the bootstrap, if U-Boot is not installed or not working, see BootLoader page)
<board>-u-boot.bin (U-Boot image file to be used with U-Boot itself, see updating U-Boot)
<board>-linux.bin (Linux image to use with U-Boot, see InstallLinux)
<board>-rootfs.arm.jffs2 (FileSystem/RootFS image to use with U-Boot, see RootFS flashing)
<board>-rootfs.arm.tar (for an NFS/MMC RootFS, see Booting from NFS & 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_armv<x>t (contains all non configurable user-space tools)
buildroot/project_build_armv<x>t/<board> (contains all configurable user-space tools: target filesystem, linux, busybox and u-boot...)
buildroot/toolchain_build_armv<x>t (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 /tftpboot). You can do it manually:

cp -f buildroot/binaries/<board>/* /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 do not forget to 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)

Please follow the standard procedure Firmware installation

How-to develop with Armadeus / customize your SDK

Your new Armadeus 3 is running fine on the target. Now you probably would like to customize the target for your project.
If you are a Buildroot user, the following instructions should sound familiar.

How-to add a software package

Use the command make menuconfig':

 $ make menuconfig

Menuconfig package.png

Select your package in the menu "package", save the configuration and compile a new rootfs

 $ make 
Note Note: For a given release, not all packages are tested/running. You can consult the list of the working packages here.


On the target, download and flash the new rootfs:

 BIOS> run update_rootfs
 ...
 BIOS> boot

How-to remove a package

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 command 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 such a case you can rebuild your environment using the global clean command. This command requests to compile almost everything and therefore will take time.
  $ make menuconfig
  ... deselect your <package>
  $ make clean
  $ make
Warning Warning: Using this method you will lose any modification you could have done directly in the directory buildroot/project_build_armvYY/apfXX/root.

Please read the chapter How-to modify root filesystem hereafter.


Your new rootfs is ready to use - Enjoy

  • A faster method exists to force to rebuild rootfs. You can delete the root directory. Unfortunately some libraries (ie c++ lib) are not reinstalled using this method.
  $ make menuconfig
  ... deselect your <package>
  $ rm -rf buildroot/project_build_armv4t/apf9328/root
  $ rm -rf buildroot/project_build_armv4t/apf9328/.root
  $ make
Warning Warning: Using this method you will lose any modification you could have done directly in the directory buildroot/project_build_armvYY/apfXX/root.

Please read the chapter How-to modify 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 described more in depth 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:

  1. modify files directly on the target (ideal solution for first trials)
  2. modify files in buildroot/project_build_armv4t/apf9328/root/ (to validate your modification with armadeus)
  3. modify files in buildroot/target/device/aramdeus/rootfs/target_skeleton (your modifcation will support a make clean )
  4. create a patch file in armadeus/patches (your modification will support a git checkout)

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 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...

Links