E.3.11. Using the Network Flash Utility

The Network Flash Utility (NFU) uses the TFTP protocol to access files over the Ethernet network. You can use this utility to program files into flash.

To connect to a server and program a file to flash:

  1. Start the NFU utility from the debugger console:

    1. Set the Boot Monitor configuration switches to force the console to use either UART-0 or the LCD and keyboard. (See Boot Monitor configuration switches for details.)

      Note

      The debugger console cannot be used because the semihosted console I/O is blocking.

    2. Start the NFU utility.

      Note

      It typically takes several seconds for the NFU to start. Do not enter any commands until the prompt is displayed.

  2. Use the DHCP protocol to get an IP address by entering:

    manage dhcpc start
    
  3. Use the map command to map a drive letter to the TFTP server. For example to access a file on a TFTP server with the IP address 192.168.0.1, use:

    manage map n: 192.168.0.1
    
  4. After the drive letter has been mapped, use the normal Boot Monitor command on the remote file by specifying the drive letter. For example, to write a file to NOR flash, enter:

    flash write image n:/hello.axf
    

NFU commands

The NFU supports a subset of the standard Boot Monitor commands and adds a new MANAGE sub-menu.

The NFU commands are listed in Table E.3.

Table E.3. NFU commands

CommandAction
CD directory pathChange directory
CONVERT BINARY binary_file LOAD_ADDRESS address [ENTRY_POINT address]Provides information to the system that is required by the RUN command in order to execute a binary file. A new file with name binary_file is produced, but with an .exe file extension.
COPY file1 file2

Copy file1 to file2. For example, to copy the leds code from the PC to the flash enter: COPY C:\software\projects\examples\rvds2.0\leds.axf leds.axf

Note

Remote file access requires semihosting. Use a debugger connection to provide semihosting.

CREATE filenameCreate a new file in the flash by inputting text. Press Ctrl-Z to end the file.
DELETE filenameDelete file from flash.
DIRECTORY [directory]

List the files in a directory.

Files that only accessible from semihosting cannot be listed.

EXITExit the NFU. The processor is held in a tight loop until it is interrupted by a JTAG debugger.
FLASHEnter the flash file system for the NOR flash on the baseboard. See Table F.5 for NOR flash commands.
HELPLists the NFU commands.
M:Change drive (allocated to MMC or SD card).
K:Change drive (allocated to CompactFlash card).
MANAGE

Enter the network management sub-menu. See Table E.4 for MANAGE commands.

MKDIR directory pathCreate a new directory.
QUITAlias for EXIT. Exit the Boot Monitor.
RENAME old_name new_nameRename flash file named old_name to new_name.
RMDIR directory pathRemove a directory.
SDCARDEnter the SD card subsystem.
TYPE filenameDisplay the flash  file filename.

The MANAGE sub-menu listed in Table E.4 contains the network management commands.

Entering MANAGE on the command line means that all future commands (until EXIT is entered) will be commands from the MANAGE sub-menu.

A single command can be executed by entering MANAGE followed by the command. For example, MANAGE DHCPC START gets an IP address from the DHCP server. The next command entered must be from an NFU command.

Table E.4. NFU MANAGE commands

CommandAction
ARP [-a]Display Address Resolution Protocol host table.
ARP -s hostnameAdd static entry to ARP table.
ARP -d hostnameDelete static entry from ARP table.
DHCPC START ifnameUse Dynamic Host Configuration Protocol (DHCP) to start a connection with the network interface ifname.
DHCPC RELEASE ifnameUse DHCP to release the connection with the network interface ifname.
DHCPC SIZEOFReturns information on the size of the DHCP packet.
DHCPC INFORM ifname ip_addressUses the DHCP protocol send information to the server located at ip_address with the network interface ifname.
EXITExit the MANAGE sub-menu. The commands listed in Table E.3 can be entered at the NFU prompt.
HELPLists the NFU MANAGE commands.
IFCONFIG Displays the IP settings that are used for communications with the server.
IFCONFIG [ifname [ip_address]]Displays the current IP address if ip_address is not suppled. Otherwise, the current IP address for the interface ifname is set to ip_address.
IFCONFIG [ifname [option]]

Configures the IP interface ifname. The value for option can be:

netmask maskvalue

set the netmask

dstaddr address

set the destination IP address

mtu n

set the maximum transfer unit

up

activate the interface

down

shutdown the interface

MAP drive addressMaps the IP address specified in address to drive.
NETSTAT [-option]

Displays active network connections. The value for option can be:

a

display all connections

m

display all multicast connections

i

display interface information

im

display interface information for multicast

r

display routing table

s

display statistics

b

display buffer usage

PING ip_addressSend ICMP ECHO_REQUEST packets to the network host. The data in the packet is returned by the host. Reception of the return packet indicates that the TCP/IP connection is functioning.
QUITAlias for EXIT. Exit the MANAGE sub-menu.
ROUTE ADD type target [NETMASK mask] gateway

Adds a static route to the network address specified by target. The gateway address is specified by gateway.

type can be either -net or -host.

If NETMASK is used, mask is the netmask for the target network address.

ROUTE DEL targetDeletes the static route to the network address specified by target.
SHOW DNSDisplays Domain Name System (DNS) configuration details received from DHCP.

Using a script file with NFU

When NFU starts, it attempts to run the NETSTART.BAT file in the flash. If the script does not exist, a prompt is displayed on the console. For example, to map a drive and write a file to flash, create the following script file:

manage dhcpc start
manage map n: 192.168.0.1
flash write image n:/hello.axf

After the file is executed, you can enter additional NFU commands. To run the file, reset the board and use the RUN command from Boot Monitor.

Copyright © 2008-2011 ARM Limited. All rights reserved.ARM DUI 0417D