XMLTagsEditHistoryDiscussion

TFTP allows you to download the kernel from a server, and boot it in the ECB_AT91.

  1. Introduction
  2. Configure the server
  3. Building a kernel
  4. Configuring the boot loader

Introduction

At boot time, the boot loader (U-boot) needs to load a kernel. You can load a kernel from the Dataflash or from the network using TFTP. The last scenario is the one we describe in this document.

Configure the server

Install a TFTP server. In Debian or Ubuntu use aptitude install tftpd tftp. We install the server and the client. We need the client to check that the server is configured correctly.

The following line will be added to /etc/inetd.conf by the Debian Package, you might get a similar one after installing a similar package in your distribution (in case the server runs via inetd).

tftp            dgram   udp     wait    nobody  /usr/sbin/tcpd  /usr/sbin/in.tftpd /srv/tftp

And it will use UDP port 69.

$ cat /etc/services | grep tftp
tftp            69/udp

Now you can put your binary kernel in the root TFTP directory (/srv/tftp/ for Debian and Ubuntu).

mkdir /srv/tftp/
chown myuser. /srv/tftp/
# Note that owning this directory might have security issues. Please contact your system administrator in you have any doubts about the last step.

Now we have to build a kernel, and put it in /srv/tftp/ in the server.

Building a kernel

Here you will find the instructions that say how to update the kernel of the ecb_at91. Note: We only need to build the kernel so you can skip XMODEM upload section.

Once we have a kernel binary, we copy it to its final destination in the server:

cp ecb_at91.img /srv/tftp/

To check that the server is configured correctly use a TFTP client (you can test from the server) to make sure that tftpd is configured correctly. You might want to check from other computer as well to detect network issues. This is a sample testing session:

$ cd /tmp/
$ tftp localhost # from the server
tftp> get ecb_at91.img
Received 1319525 bytes in 0.2 seconds
tftp> quit

Configuring the boot loader

We assume you have a board with a working U-boot installation. If not, please build and install U-boot.

You need configure the U-boot environment using the setenv command. Beware of non-needed spaces, u-boot is pretty sensitive to them. After a correct configuration, your environment should be similar to this one (perhaps with different network addresses):

ecb_at91 >printenv
baudrate=115200
ethaddr=00:00:00:00:00:5b
loadaddr=0x20200000
bootdelay=1
bootfile="ecb_at91.img"
fileaddr=20200000
gatewayip=192.168.0.1
netmask=255.255.255.0
serverip=192.168.0.1
bootcmd=bootm 20200000
bootargs=mem=32M rootfstype=reiserfs root=/dev/mmcblk0p1 console=ttyS0,115200n8
ipaddr=192.168.0.2
stdin=serial
stdout=serial
stderr=serial

After you configure u-boot, you can load the kernel using the "tftp" command.

ecb_at91 >tftp
TFTP from server 192.168.0.1; our IP address is 192.168.0.2
Filename 'ecb_at91.img'.
Load address: 0x20200000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         ################
done
Bytes transferred = 1409031 (158007 hex)
ecb_at91 >

Now you can boot, with the command "boot".

Remember you can still boot using the kernel loaded in the serial flash of the ECB_AT91 using the command "bootm C0020000" (if you uploaded it via XMODEM) as explained here.

Last update: 2008-05-09 (Rev 470)

svnwiki $Rev: 12966 $