Size:
3.03 Mb
Download

Monitor: Monitor Recovery and Updates

Recovering the Monitor

1Make sure that a monitor ROM device is installed in the PLCC socket on the KAT4000.

2Ensure there is a jumper on JP7, across pins 1 and 2.

3Issue the following command, where serial_number is the board’s serial number, at the monitor prompt:

KAT4000 (1.0) => moninit serial_number

moninit will also reset environment variables to the default state.

4To boot from soldered flash, power down the board and remove the jumper from JP7, pins 1 and 2.

The monitor always resides in the top 512 KB block of NOR flash as shown in Table 14-3.

Table 14-3: Monitor Address per Flash Device

Address Range (hex):

Device:

E1F8,0000-E1FF,FFFF

Monitor Location in Flash Bank1 (16 MB)

 

 

E0F8,0000-E0FF,FFFF

Monitor Location in Flash Bank0 (16 MB)

 

 

E1F6,0000-E1F6,1000

Redundant Environment Variables

 

 

E0F6,0000-E0F6,1000

Environment Variables

 

 

Resetting Environment Variables

To restore the monitor’s standard environment variables, execute the following commands and insert the appropriate data in the italicized fields:

KAT4000 (1.0) => moninit serial_number noburn

Note: Press the ‘s’ key on the keyboard during reset to force the default environment variables to be loaded. See “Environment Variables” for more information.

Optionally, save your settings:

KAT4000 (1.0) => saveenv

Updating the Monitor via TFTP

To update the monitor via TFTP, ensure that an appropriate VLAN is set up in the Ethernet switch (see the KAT4000 Quick Start Guide,#10008585-xx)and execute the following commands, inserting the appropriatedata in the italicized fields:

If necessary, edit your network settings:

KAT4000 (1.0) => setenv ipaddr 192.168.1.100

KAT4000 (1.0) => setenv gatewayip 192.168.1.1

KAT4000 (1.0) => setenv netmask 255.255.255.0

KAT4000 (1.0) => setenv serverip 10.64.16.168

KAT4000 (1.0) => setenv ethport all

10007175-02

KAT4000 User’s Manual

14-7

 

 

 

Monitor: Monitor Command Reference

Optionally, save your settings:

KAT4000 (1.0) => saveenv

TFTP the new monitor (binary) image to memory location 0x100000:

KAT4000 (1.0) => tftpboot 100000 path_to_file_on_tftp_server

Update the monitor:

KAT4000 (1.0) => moninit serial_number 100000

If moninit( ) fails, burn the new monitor to a ROM and follow the recovery steps in the “Recovering the Monitor” section.

MONITOR COMMAND REFERENCE

This section describes the syntax and typographic conventions for the KAT4000 monitor commands. Subsequent sections in this chapter describe individual commands, which fall into the following categories: boot, memory, Flash, environment variables, test, and other commands.

Command Syntax

The monitor uses the following basic command syntax:

<Command> <argument 1> <argument 2> <argument 3>

The command line accepts three different argument formats: string, numeric, and symbolic. All command arguments must be separated by spaces with the exception of argument flags, which are described below.

Monitor commands that expect numeric arguments assume a hexadecimal base.

All monitor commands are case sensitive.

Some commands accept flag arguments. A flag argument is a single character that begins with a period (.). There is no white space between an argument flag and a

command. For example, md.b 80000 is a valid monitor command, while md .b 80000 is not.

Some commands may be abbreviated by typing only the first few characters that uniquely identify the command. For example, you can type h instead of help. However, commands cannot be abbreviated when accessing online help. You must type help and the full command name.

14-8

KAT4000 User’s Manual

10007175-02

 

 

 

Monitor: Boot Commands

Command Help

Access all available monitor commands by pressing the ? key or entering help. Access the monitor online help for individual commands by typing help <command>. The full command name must be entered to access the online help.

Typographic Conventions

In the following command descriptions, text in Courier shows the command format. Square brackets [ ] enclose optional arguments, and angled brackets < > enclose required arguments.Italic type indicates a variable or field that requires input.

BOOT COMMANDS

The boot commands provide facilities for booting application programs and operating systems from various devices.

bootd

Execute the command stored in the “bootcmd” environment variable.

Definition: bootd

bootelf

The bootelf command boots from an ELF image in memory, where address is the load address of the ELF image.

Definition: bootelf [ address ]

bootm

The bootm command boots an application image stored in memory, passing any entered arguments to the called application. When booting a Linux kernel, arg can be the address of an initrd image. Ifaddr is not specified, the environment variable loadaddr is used as the default.

Definition: bootm [addr [arg …]]

bootp

The bootp command boots an image via a network connection using the BootP/TFTP protocol. If loadaddress orbootfilename is not specified, the environment variables loadaddr and bootfile are used as the default.

Definition: bootp [loadAddress] [bootfilename]

10007175-02

KAT4000 User’s Manual

14-9

 

 

 

Monitor: Boot Commands

To use network download commands (e.g., bootp, bootvx, rarpboot, tftpboot), the environment variables listed in Table 14-4 must be configured. To set a static IP, these environment variables must be specified through the command line interface.

Table 14-4: Static IP Ethernet Configuration

Environment Variable:

Description:

ipaddr

Local IP address for the board.

 

 

serverip

TFTP/NFS server address.

 

 

netmask

Net mask.

 

 

gatewayip

Gateway IP address.

 

 

netdev

eth0 - default

ethaddr1

MAC address

1. Ensure that each MAC address on the network is unique.

bootv

The bootv command checks the checksum on the primary image (in Flash) and boots it, if valid. If it is not valid, it checks the checksum on the secondary image (in Flash) and boots it, if valid. If neither checksum is valid, the command returns back to the monitor prompt.

Definition: Verify bootup.

bootv

Write image to Flash and update NVRAM.

bootv <primary|secondary> write <source> <dest> <size>

Update NVRAM based on image already in Flash.

bootv <primary|secondary> update <source> <size>

Check validity of images in Flash.

bootv <primary|secondary> check

bootvx

The bootvx command boots VxWorks® from an ELF image, whereaddress is the load address of the VxWorks ELF image. To use this command, the environment variables listed inTable 14-4 must be configured.

Definition: bootvx [ address ]

dhcp

The dhcp command invokes a Dynamic Host Configuration Protocol (DHCP) client to obtain IP and boot parameters by sending out a DHCP request and waiting for a response from a server.

14-10

KAT4000 User’s Manual

10007175-02

 

 

 

Monitor: Boot Commands

Definition: dhcp [loadaddress] [bootfilename]

To use the dhcp command, your DHCP server must be configured with the variables designated in Table 14-5.

Table 14-5: DHCP Ethernet Configuration

Environment Variable:

Description:

Value2:

ipaddr

Local IP address for the board. Configured

e.g., 192.168.1.1

 

by DHCP.

 

 

 

 

serverip

TFTP/NFS server address. This value must

e.g., 192.168.1.2

 

be configured after the DHCP IP address is

 

 

acquired.3

 

netmask

Net mask. Obtained by DHCP.

 

 

 

gatewayip

Gateway IP address. Obtained by DHCP.

 

 

 

netdev

Ethernet device. Obtained by DHCP.

eth0

ethaddr4

MAC address

00:80:F9:xx:xx:xx

autoload5

Boot image from TFTP server after DHCP

no

 

acquisition.

 

 

 

 

2.Values for ethaddr, netdev and autoload are set by the user.

3.The value obtained by the DHCP server may not be applicable to your development application.

4.Ensure that each MAC address on the network is unique.

5.If autoload is not set or configured to “yes,” ensure that the DHCP provides proper information for autoboot. If proper autoboot information is not provided, an error may occur.

rarpboot

The rarpboot command boots an image via a network connection using the RARP/TFTP protocol. If loadaddress orbootfilename is not specified, the environment variables loadaddr and bootfile are used as the default. To use this command, the environment variables listed inTable 14-4 must be configured.

Definition: rarpboot [loadaddress] [bootfilename]

tftpboot

The tftpboot command loads an image via a network connection using the TFTP protocol. The environment variable’s ipaddr andserverip are used as additional parameters to this command. Ifloadaddress orbootfilename is not specified, the environment variables loadaddr and bootfile are used as the default. To use this command, the environment variables listed inTable 14-4 must be configured.

The port used is defined by the ethport environment variable. Ifall is selected forethport, the TFTP process will cycle through each port until a connection is found or all ports have failed.

10007175-02

KAT4000 User’s Manual

14-11

 

 

 

Monitor: File Load Commands

Definition: tftpboot [loadaddress] [bootfilename]

FILE LOAD COMMANDS

The file load commands load files over the serial port.

loadb

The loadb command loads a binary file over the serial port. The command takes two optional parameters:

offset: The address offset parameter allows the file to be stored in a location different than what is indicated within the binary file by adding the valueoff to the file’s absolute address.

baudrate: The baudrate parameter allows the file to be loaded atbaud instead of the monitor’s console baudrate.

The file is not automatically executed, the loadb command only loads the file into memory.

Definition: loadb [off] [baud]

loads

The loads command loads an S-Recordfile over the serial port. The command takes two optional parameters:

offset: The address offset parameter allows the file to be stored in a location different than what is indicated within theS-Recordfile by adding the valueoff to the file’s absolute address.

baudrate: The baudrate parameter allows the file to be loaded atbaud instead of the monitor’s console baudrate.

The file is not automatically executed, the loads command only loads the file into memory.

Definition: loads [off] [baud]

MEMORY COMMANDS

The memory commands allow you to manipulate specific regions of memory. For some memory commands, the data size is determined by the following flags:

Definition: The flag .b is for data in8-bitbytes.

Definition: The flag .w is for data in16-bitwords.

Definition: The flag .l is for data in32-bitlong words.

These flags are optional arguments and describe the objects on which the command operates. If you do not specify a flag, memory commands default to 32-bitlong words. Numeric arguments are in hexadecimal.

14-12

KAT4000 User’s Manual

10007175-02

 

 

 

Monitor: Memory Commands

cmp

The cmp command compares count objects betweenaddr1 andaddr2. Any differences are displayed on the console display.

Definition: cmp [.b, .w, .l] addr1 addr2 count

cp

The cp command copies count objects located at thesource address to thetarget address.

Note: If the target address is located in the range of the Flash device, it will program the Flash with count objects from the source address. The cp command does not erase the Flash region prior to copying the data. The Flash region must be manually erased using the erase command prior to using the cp command.

Definition: cp [.b, .w, .l] source target count

Example: In this example, the cp command is used to copy 0x1000,32-bitvalues from address 0x100000 to address 0x80000.

=> cp 100000 80000 1000

find

The find command searches from base_addr totop_addr looking forpattern. For the find command to work properly, the size ofpattern must match the size of the object flag. The-a option searches for the absence of the specified pattern.

Definition: find [.b, .w, .l] [-a] base_addr top_addr pattern

Example: In this example, the find command is used to search for the32-bitpattern 0x12345678 in the address range starting at 0x40000, and ending at 0x80000.

=> find.1 40000 80000 12345678

Searching from 0x00040000 to 0x00080000

Match found: data = 0x12345678 Adrs = 0x00050a6c =>

md

The command md displays the contents of memory starting at address. The number of objects displayed can be defined by an optional third argument,# of objects. The memory’s numerical value and its ASCII equivalent is displayed.

Definition: md [.b, .w, .l]address [# of objects]

Example: In this example, the md command is used to displaythirty-two16-bitwords starting at the physical address 0x80000.

=> md.w 80000 20

00080000: ffff ffff ffff ffff ffff ffff ffff ffff ................

00080010: ffff ffff ffff ffff ffff ffff ffff ffff ................

00080020: ffff ffff ffff ffff ffff ffff ffff ffff ................

10007175-02

KAT4000 User’s Manual

14-13

 

 

 

Monitor: Memory Commands

00080030: ffff ffff ffff ffff ffff ffff ffff ffff ................

mm

The mm command modifies memory one object at a time. Once started, the command line prompts for a new value at the starting address. After a new value is entered, pressing ENTER auto-incrementsthe address to the next location. Pressing ENTER without entering a new value leaves the original value for that address unchanged. To exit the mm command, enter anon-validhexadecimal value (such as x) followed by ENTER.

Definition: mm [.b, .w, .l]address

Example: In this example, the mm command is used to write random8-bitdata starting at the physical address 0x80000.

=> mm.b 80000 00080000: ff ? 12 00080001: ff ? 23 00080002: ff ? 34 00080003: ff ? 45 00080004: ff ? 00080005: ff ? x => md.b 80000 6

00080000: 12 23 34 45 ff ff .#4E =>

nm

The nm command modifies a single object repeatedly. Once started, the command line prompts for a new value at the selected address. After a new value is entered, pressing ENTER modifies the value in memory and then the new value is displayed. The command line then prompts for a new value to be written at the same address. Pressing ENTER without entering a new value leaves the original value unchanged. To exit the nm command, enter a non-validhexadecimal value (such as x) followed by ENTER.

Definition: nm [.b, .w, .l]address

mw

The command mw writes value to memory starting ataddress. The number of objects modified can be defined by an optional fourth argument,count.

Definition: mw [.b, .w, .l]address value [count]

Example: In this example, the mw command is used to write the value 0xabba three times starting at the physical address 0x80000.

=> mw.w 80000 abba 3 => md 80000

00080000: abbaabba abbaffff ffffffff ffffffff ................

00080010: ffffffff ffffffff ffffffff ffffffff ................

14-14

KAT4000 User’s Manual

10007175-02

 

 

 

Monitor: Flash Commands

00080020: ffffffff ffffffff ffffffff ffffffff ................

00080030: ffffffff ffffffff ffffffff ffffffff ................

00080040: ffffffff ffffffff ffffffff ffffffff ................

00080050: ffffffff ffffffff ffffffff ffffffff ................

00080060: ffffffff ffffffff ffffffff ffffffff ................

00080070: ffffffff ffffffff ffffffff ffffffff ................

FLASH COMMANDS

The Flash commands affect the StrataFlash device on the KAT4000 circuit board. There is one Flash bank on the KAT4000 board. The following Flash commands access the individual Flash bank as Flash bank 1. To access the individual sectors within each Flash bank, the sector numbers start at0 and end at one less than the total number of sectors in the bank. For a Flash bank with 128 sectors, the following Flash commands access the individual sectors as0 through127.

cp

The cp command can be used to copy data into the Flash device. For the cp command syntax, refer to “Memory Commands” on page 14-12.

erase

The erase command erases the specified area of Flash memory.

Definition: Erase all of the sectors in the address range fromstart toend.

erase start end

Erase all of the sectors SF (first sector) toSL (last sector) in Flash bank #N.

erase N:SF[-SL]

Erase all of the sectors in Flash bank # N.

erase bank N

Erase all of the sectors in all of the Flash banks.

erase all

flinfo

The flinfo command prints out the Flash device’s manufacturer, part number, size, number of sectors, and starting address of each sector.

Definition: Print information for all Flash memory banks.

flinfo

Print information for the Flash memory in bank # N.

flinfo N

10007175-02

KAT4000 User’s Manual

14-15

 

 

 

Monitor: EEPROM/I2C Commands

protect

The protect command enables or disables the Flash sector protection for the specified Flash sector. Protection is implemented using software only. The protection mechanism inside the physical Flash part is not being used.

Definition: Protect all of the Flash sectors in the address range fromstart toend.

protect on start end

Protect all of the sectors SF (first sector) toSL (last sector) in Flash bank #N.

protect on N:SF[-SL]

Protect all of the sectors in Flash bank # N.

protect on bank N

Protect all of the sectors in all of the Flash banks.

protect on all

Remove protection on all of the Flash sectors in the address range from start toend.

protect off start end

Remove protection on all of the sectors SF (first sector) toSL (last sector) in Flash bank #N.

protect off N:SF[-SL]

Remove protection on all of the sectors in Flash bank # N.

protect off bank N

Remove protection on all of the sectors in all of the Flash banks.

protect off all

EEPROM/I2C COMMANDS

This section describes commands that allow you to read and write memory on the serial

EEPROMs and I2C devices.

eeprom

The eeprom command reads and writes from the EEPROM. For example:

eeprom read 53 100000 1800 100

reads 100 bytes from offset 0x1800 in serial EEPROM 0x53 (right-shifted7-bitaddress) and places it in memory at address 0x100000.

Definition: Read/writecnt bytes fromdevaddr EEPROM at offsetoff.

eeprom read devaddr addr off cnteeprom write devaddr addr off cnt

14-16

KAT4000 User’s Manual

10007175-02