Difference between revisions of "Loading Images with U-Boot"

From wiki.emacinc.com
Jump to: navigation, search
(added categories)
(added configuration section)
Line 3: Line 3:
 
== Requirements ==
 
== Requirements ==
 
A TFTP server must be accessible on the local network. The specific details of TFTP server setup and configuration are beyond the scope of this document. EMAC recommends the <code>tftpd</code> package for use on Debian or Ubuntu Linux systems. For Windows, the [http://tftpd32.jounin.net/ Tftpd32] server works well.
 
A TFTP server must be accessible on the local network. The specific details of TFTP server setup and configuration are beyond the scope of this document. EMAC recommends the <code>tftpd</code> package for use on Debian or Ubuntu Linux systems. For Windows, the [http://tftpd32.jounin.net/ Tftpd32] server works well.
 +
 +
== Configuration ==
 +
In order to load a file using TFTP, U-Boot must be configured to access the local network. Static networking configuration is recommended, although DHCP can be used on some systems. Typically, the IP address of the board and the IP address of the TFTP server are the only settings that need to be defined. The network mask and broadcast address will be determined automatically from these settings, and no default gateway setting is required if the server is on the same subnetwork as the board. Before continuing, determine a valid static network address for your local network; contact your IT department for more information on what address to use if required. The example below shows how to set the IP address of the board to 192.168.2.2 and the TFTP server IP address to 192.168.2.1:
 +
U-Boot> setenv ipaddr 192.168.2.2
 +
U-Boot> setenv serverip 192.168.2.1
 +
U-Boot> saveenv
 +
Saving Environment to dataflash...
 +
U-Boot> reset
 +
 +
Once the network settings have been configured, attempt to ping the TFTP server to test the network connection as illustrated below:
 +
U-Boot> ping 192.168.2.1
 +
macb0: link up, 100Mbps full-duplex (lpa: 0x45e1)
 +
Using macb0 device
 +
host 192.168.2.1 is alive
 +
  
  

Revision as of 17:44, 6 May 2013

While U-Boot is used to load and execute the OS after initial programming, it can also be used to program the OS images to the local flash. This page describes the process of using U-Boot to load Linux kernel and filesystem images from a TFTP server and save them to the local flash for use during the boot process. Review the U-Boot Overview page for an introduction to U-Boot before continuing.

Requirements

A TFTP server must be accessible on the local network. The specific details of TFTP server setup and configuration are beyond the scope of this document. EMAC recommends the tftpd package for use on Debian or Ubuntu Linux systems. For Windows, the Tftpd32 server works well.

Configuration

In order to load a file using TFTP, U-Boot must be configured to access the local network. Static networking configuration is recommended, although DHCP can be used on some systems. Typically, the IP address of the board and the IP address of the TFTP server are the only settings that need to be defined. The network mask and broadcast address will be determined automatically from these settings, and no default gateway setting is required if the server is on the same subnetwork as the board. Before continuing, determine a valid static network address for your local network; contact your IT department for more information on what address to use if required. The example below shows how to set the IP address of the board to 192.168.2.2 and the TFTP server IP address to 192.168.2.1:

U-Boot> setenv ipaddr 192.168.2.2
U-Boot> setenv serverip 192.168.2.1
U-Boot> saveenv
Saving Environment to dataflash...
U-Boot> reset

Once the network settings have been configured, attempt to ping the TFTP server to test the network connection as illustrated below:

U-Boot> ping 192.168.2.1
macb0: link up, 100Mbps full-duplex (lpa: 0x45e1)
Using macb0 device
host 192.168.2.1 is alive