Upgrading U-boot



The STK1000 flash is preprogrammed with u-boot, but in some cases the user wants to upgrade or reprogram the flash with u-boot. A binary version of U-boot is therefore available on the BSP CD (u-boot.bin). This section describes how to reprogram the flash with this image with or without a JTAGICE mkII emulator.

With JTAGICE mkII emulator

Erase the flash before programming with u-boot:

avr32program erase -f0,8Mb

Program the flash using the avr32program utility:

avr32program program -vf0,8Mb u-boot.bin

Without JTAGICE mkII emulator

Use the AVR32 Flash Upgrade Utility. The utility is available from the BSP CD at /software/flash-upgrade/

This is a standalone utility to do flash upgrades on AVR32 devices. The utility itself is distributed as a single file which contains the upgrade image as well as any necessary programming code for the particular board the upgrade is meant for. It can be loaded by U-boot via SD/MMC card, TFTP or any other supported boot method, the same way as any Linux kernel image.

The easiest way to upgrade U-boot is probably to replace the file 'uImage' on your SD card with the upgrade image. This way, U-boot will boot the upgrade image by default.

Programming the flash

The utility does not initialize the USART at startup. Rather, it depends on one of them being initialized by u-boot already and tries to detect it. This way, if the user can interact with U-boot, chances are that he will be able to interact with this utility as well.

When the utility starts up, it displays some information about the detected flash chip and some other information. After this, it asks the user to confirm the operation by pressing `y'. This is done to ensure that the user is actually seeing the status information and can interact with the programmer before starting to do anything potentially destructive.

If something goes wrong while doing "destructive" flash operations, there is not much the programmer can do about it except to ask the user if he wants to retry, in case we're dealing with a transient failure. If retrying does not help, the system is left unbootable. In this case, the only way to recover is to re-program u-boot using the JTAGICE mkII emulator. Please contact avr32@atmel.com if this ever happens.

After a successful upgrade, power cycle the board and make sure U-boot doesn't load the flash upgrade utility again, e.g. by replacing uImage with a real Linux kernel image.

Building custom upgrade images

To create a flash upgrade image, simply copy the flash upgrade binary into this directory and run "make", possibly after tweaking some settings in config.mk like the name of the binary image.

cd "your working directory"
cp /bsp-cd/software/flash-upgrade/* .
cp /bsp-cd/builds/stk1000/u-boot.bin .

The resulting flash-upgrade.uimg file can be loaded by u-boot via SD/MMC card, TFTP or any other supported boot method.

This utility can be built using the avr32 (standalone) toolchain as well as the avr32-linux toolchain. It does not matter.


The bootloader for the NGW stored in the parallell flash. This section describes how to update this. The bootloader and root image refered to is located in the AVR32 Linux BSP CD.


Connect JTAGICEmkII, And then use avr32program from command line prompt like this:

avr32program erase -fcfi@0
avr32program program -F bin -vfcfi@0 uboot.bin
avr32program program -F bin -vfcfi@0 -O 0x20000 ngw_jffs2_root.img

If you have an old avr32program: replace -vfcfi@0 with -vf0,8Mb

This will result in a default MAC address, which can be changed in U-Boot later. It will not make any trouble unless several NGWs should be connected to the same ethernet hub/switch. The correct MAC address is 00-00-04-25-1C-50-00 + serialnumber*2 for ETH0 and 00-00-04-25-1C-50-00 + 1 + serialnumber*2 for ETH1