kb9202 user’s guide - kwikbyte.com · command (“ps –ef”). figure 5: basic operation notice,...

28
KwikByte KB9202 User’s Guide Revision 1.03 August 18, 2006

Upload: dangkhanh

Post on 26-May-2019

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

KwikByte KB9202 User’s Guide

Revision 1.03 August 18, 2006

Page 2: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

Revision history

Date Revision Change 07/05/2005 0.9 Initial creation 08/03/2005 0.91 Minor clarifications and fixes (contributor: Mark Limbach) 08/16/2005 0.92 Added nfs mount and USB keydisk information 06/08/2006 1.01 Added preliminary information regarding “B” part suffix 06/21/2006 1.02 Corrected date and removed “Proprietary” from footer 08/18/2006 1.03 Updated crash recovery section to reference jumper table. All trademarks are the property of their respective owners. KwikByte, Inc. (referred to as “KwikByte”) reserves the right to make changes, at any time, to this document or products produced by KwikByte. KwikByte is not responsible for future availability or procurement, or obligated to produce products described or referenced, of previous revisions of documents or hardware beyond any existing agreements. KwikByte does not assume any liability arising out of the application of any product described or shown herein; nor does it convey any license under its copyrights or any rights of others. All materials provided by KwikByte are provided “as is”. The user is responsible to obtain rights and licenses as required for the particular application. The representation or examples shown in source, design, diagram, picture, or other information does not grant any freedom from claims of infringement; the information provided herein is for reference only. KwikByte expressly disclaims any warranty whatsoever pertaining to the adequacy of any such implementation, including but not limited to any implied warranties of merchantability or fitness for a particular purpose. KwikByte does not represent that devices shown or products described herein are free from patent infringement or from any other third party right. KwikByte assumes no obligation to correct any errors contained herein or to advise any user of this text of any correction if such be made. KwikByte will not assume any liability for the accuracy or correctness of any engineering or software support or assistance provided to a user. KwikByte products are not intended for use in life support appliances, devices, or systems.

www.kwikbyte.com 2/28

Page 3: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

TABLE OF CONTENTS

Revision history .................................................................................................................. 2 Introduction......................................................................................................................... 5 Quick start........................................................................................................................... 6 Jumpers and header information......................................................................................... 9 Detailed peripheral information........................................................................................ 14

SDRAM ........................................................................................................................ 14 Parallel FLASH............................................................................................................. 14 NAND FLASH ............................................................................................................. 14 USB full speed host port ............................................................................................... 14 LCD interface................................................................................................................ 14 Temperature sensor....................................................................................................... 15 Power supply................................................................................................................. 15

Boot sequence ................................................................................................................... 15 Download.......................................................................................................................... 16

Serial download ............................................................................................................ 16 Ethernet download (TFTP) ........................................................................................... 17

Bootloader......................................................................................................................... 17 Bootloader commands .................................................................................................. 17

c (Copy) .................................................................................................................... 18 d (Display autoboot commands) ............................................................................... 18 e (Execute at address) ............................................................................................... 18 ip (Set local IP address) ............................................................................................ 18 m (Set local MAC address)....................................................................................... 18 s (Set auto-boot command) ....................................................................................... 19 server_ip (Set server IP address)............................................................................... 19 t (Set Linux parameter list) ....................................................................................... 19 tftp (Perform TFTP download) ................................................................................. 19 w (Write auto-boot command table) ......................................................................... 19 x (Perform X-modem download).............................................................................. 20

ramMonitor ....................................................................................................................... 20 ramMonitor commands................................................................................................. 20

? | h | help .................................................................................................................. 20 bus ............................................................................................................................. 20 c (Copy) .................................................................................................................... 21 compare..................................................................................................................... 21 e (Execute at address) ............................................................................................... 21 eeread ........................................................................................................................ 21 eewrite....................................................................................................................... 21 f (FLASH operations) ............................................................................................... 21 ip (Set local IP address) ............................................................................................ 22 irda ............................................................................................................................ 22 lcd.............................................................................................................................. 22 led.............................................................................................................................. 22 m (Set local MAC address)....................................................................................... 22

www.kwikbyte.com 3/28

Page 4: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

proc ........................................................................................................................... 23 read............................................................................................................................ 23 server_ip (Set server IP address)............................................................................... 23 temp........................................................................................................................... 23 tftp (Perform TFTP download) ................................................................................. 23 uhp............................................................................................................................. 23 write .......................................................................................................................... 23 x (Perform X-modem download).............................................................................. 24

Installing the reference toolchain and kernel on the host system ..................................... 24 How to upgrade kernel/filesystem/bootloader .................................................................. 24 Crash recovery .................................................................................................................. 25 Building the filesystem ..................................................................................................... 25 Mounting NFS directory as the root filesystem................................................................ 27 Mounting a USB mass storage device (keydisk) .............................................................. 27

www.kwikbyte.com 4/28

Page 5: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

Introduction The KB9202 is intended for use in evaluating the ARM9 core and peripherals and developing prototypes using a proven reference design platform. The standard kit includes the development board, serial cable, and distribution CD. The serial cable allows simple program download and debug support from a standard serial terminal – which is independent of the host operating system. The distribution CD includes sample source programs, board schematics, and scripts to build a cross-compiler toolchain and reference Linux kernel. The KB9202 features:

• 180 MHz, 200 MIPS ARM9 highly-integrated core (AT91RM9200) • Independent 16KB instruction and 16KB data caches • 32 MB SDRAM • 16 MB parallel FLASH • Two, empty SPI serial FLASH sites (8 cason, 8-SOIC) for custom use • SD/MMC card support • 10/100 Ethernet • USB 2.0 full speed host port* • USB 2.0 full speed device port • IrDA transceiver • Parallel LCD interface supporting Optrex PN F-51320GNB-LW-AB or F-

51320GNY-LY-AA (display not included) • RS-232 serial, dual transceiver, single DB9 connector • 16KB boot EEPROM - with bootloader • 16KB internal SRAM • 128KB internal ROM • 3 user LEDs • On-board digital temperature sensor • External memory interface • Many signals available at 0.100” x 0.100” headers (e.g. I2S, timers,

counters, synchronous serial, asynchronous serial, programmable clocks, digital I/O, interrupt lines, SPI, TWI)

• Core clock up to 180MHz • Serial boot loader for simple development • On-chip Real-time clock (RTC) and DMA • Switching power supply provides 2.5A and accepts wide AC/DC voltage

range from standard 2.1mm jack • JTAG compatible debug port • 100mm x 160mm Eurocard format

The KB9202B part also includes the following:

• 32 MB SDRAM (64 MB total) • 32 MB NAND flash • RS-485 transceiver on USART 3

www.kwikbyte.com 5/28

Page 6: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

Quick start Connect the KB9202 to your host computer using the included serial cable. Open a terminal session (using Windows® Hyperterminal or Linux minicomm) with the following port parameters: Baud = 115200 Data bits = 8 Parity = none Stop bits = 1 Flow control = none Connect the power supply (not included) to the KB9202. The terminal window shows the process of booting the Linux kernel (see Figure 1).

Figure 1: Sample bootscreen from terminal

Press the reset switch (S1). Then, press a key to abort the auto boot sequence (before the auto boot sequence begins). Set the MAC address for the board using your custom value. The MAC is a unique address assigned to each device operating on the network. The values shown are used as an example only. You must obtain a MAC for your KB9202 board.

www.kwikbyte.com 6/28

Page 7: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

Figure 2: Setting the MAC address

Set the address using the bootloader “s” command followed by the “w” command to write the value back to non-volatile storage. Next, set the IP address according to your network. This will typically be one of two values:

1) DHCP 2) Fixed IP address

The IP is set on the Linux command parameter tag line by appending the parameter “ip=dhcp” or “ip=192.168.1.50” (example fixed address). Again, set the address and write the value to non-volatile storage.

www.kwikbyte.com 7/28

Page 8: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

Figure 3: Setting the IP address using kernel auto-configuration option

Press the reset switch and allow the auto boot sequence to complete.

www.kwikbyte.com 8/28

Page 9: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

Figure 4: Completion of boot sequence

Press the Enter key to activate the console. Test the operation using a simple Linux command (“ps –ef”).

Figure 5: Basic operation

Notice, the same command sequence can be executed in a Linux environment using minicomm or other terminal program. If using minicomm, it is recommended that you disable modem commands and adjust/save the default configuration according to your system.

Jumpers and header information See Table 1 for a description of the jumpers on the KB9202.

Jumper KB9202B Jumper Description JP1/JP2 JP4/JP6 Shorting pins 1-2 enable debug serial signals on

the DB9 connector. Shorting pins 2-3 enable serial channel 0 (Rx0/Tx0) on the DB9 connector.

JP3 JP2 Shorting pins 1-2 sets BMS for parallel FLASH

www.kwikbyte.com 9/28

Page 10: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

operation. This mode is not supported. JP4 JP3 Shorting pins 1-2 alters the EEPROM address,

effectively disabling the EEPROM from the boot sequence.

JP5 JP10 This jumper is used for convenient access to the serial channel 1 (Rx1/Tx1) signals and power/ground signals.

JP6 JP1 Shorting pins 1-2 has no effect. Shorting pins 2-3 enables the +5V supply to the USB host port.

JP7 JP8 This jumper is used to steer the SPI CS0 signal between the two SPI FLASH sites. These sites are not populated, by default.

JP8 JP9 Shorting pins 1-2 disable the IrDA transceiver. JP9 JP5 This jumper provides convenient access to the

debug serial signals. JP7 RS-485 differential signals wired to transceiver.

Table 1: Jumper definition

The following tables describe the signals available at the header sites:

PIN SIGNAL FUNCTION NOTE 1 GND 2 JTAGSEL pull-down 3 +3.3V 4 TDI pull-up 5 TMS pull-up 6 TDO pull-up 7 TRSTn pull-up 8 TCLK pull-up 9 GND 10 RSTn

Table 2: Header SV1 description

PIN SIGNAL FUNCTION NOTE

1 D27 databus/PC27 2 PC10 NCS4/CFCS 3 D26 databus/PC27 4 PC11 NCS5/CFCE1 5 D25 databus/PC25 6 PC12 NCS6/CFCE2 7 D24 databus/PC24 8 PC13 NCS7

Table 3: Header SV2 description

www.kwikbyte.com 10/28

Page 11: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

PIN SIGNAL FUNCTION NOTE

1 PA24 SCK2/PCK1 2 PA23 TXD2/IRQ3 3 PA22 RXD2/TIOB2 4 PA21 RTS0/TIOA2 5 PA20 CTS0/TIOB1 6 PA19 SCK0/TIOA1

Table 4: Header SV4 description

PIN SIGNAL FUNCTION NOTE

1 PA26 TWCK/IRQ1 TWI EEPROM/temp sensor 2 PA25 TWD/IRQ2 TWI EEPROM/temp sensor 3 GND 4 +3.3V 5 PB11 RF1/TIOB5 6 PB10 RK1/TIOA5 7 PB9 RD1/TIOB4 8 PB8 TD1/TIOA4 9 PB7 TK1/TIOB3 10 PB6 TF1/TIOA3

Table 5: Header SV5 description

PIN SIGNAL FUNCTION NOTE

1 PA18 RXD0/TIOB0 2 PA17 TXD0/TIOA0 3 PA6 NPCS3/RXD3 4 PA5 NPCS2/TXD3 5 PA4 NPCS1/PCK1 6 PA3 NPCS0/IRQ5 7 PA2 SPCK/IRQ4 8 PA1 MOSI/PCK0 9 PA0 MISO/PCK3 10 +3.3V 11 GND 12 GND

Table 6: Header SV6 description

PIN SIGNAL FUNCTION NOTE

1 BD0 BD = buffered data 2 BD1 3 BD2 4 BD3

www.kwikbyte.com 11/28

Page 12: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

PIN SIGNAL FUNCTION NOTE 5 BD4 6 BD5 7 BD6 8 BD7 9 GND 10 GND 11 BD8 12 BD9 13 BD10 14 BD11 15 BD12 16 BD13 17 BD14 18 BD15 19 +3.3V 20 +3.3V

Table 7: Header SV7 description

PIN SIGNAL FUNCTION NOTE

1 BA0 BA = buffered address 2 BA1 3 BA2 4 BA3 5 BA4 6 BA5 7 BA6 8 BA7 9 GND 10 GND 11 BA8 12 BA9 13 BA10 14 BA11 15 BA12 16 BA13 17 BA14 18 BA15

Table 8: Header SV8 description

PIN SIGNAL FUNCTION NOTE

1 BA16 BA = buffered address 2 BA17

www.kwikbyte.com 12/28

Page 13: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

PIN SIGNAL FUNCTION NOTE 3 BA18 4 BA19 5 BA20 6 BA21 7 BA22 8 BA23 9 GND 10 GND 11 BCS0n 12 BCS2n 13 BCS3n 14 BOEn 15 BWEn 16 BBS1n 17 BBS3n 18 BRSTn

Table 9: Header SV9 description

KB9202 Header Name KB9202B Header Name

SV1 SV8 (standard 20-pin JTAG) SV2 SV1 SV4 SV5 SV5 SV6 SV6 SV3 SV7 SV2 SV8 SV4 SV9 SV7

Table 10: KB9202B Header Naming Convention

The following signals are also used on-board: IrDA transceiver PB20/PB21 (TXD1/RXD1) USB device port Rpu enable switch PB22 (SCK1) USB device port +Vbus detection PB24 (CTS1) First-half of dual serial port PA30/PA30 (DRXD-CTS2/DTXD-RTS2) Second-half of dual serial port PA17/PA18 (TXD0-TIOA0/RXD0-TIOB2) User LEDs D18/D19/D20 (PC18/PC19/PC20) LCD Reset D22 (PC22) LCD Backlight D23 (PC23)

www.kwikbyte.com 13/28

Page 14: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

RS-485 transceiver (KB9202B) PA5/PA6 (TXD3/RXD3) RS-485 Tx/Rx enable PB0/PB1

Detailed peripheral information The following sections provide important information for selected peripherals.

SDRAM The 32 MB SDRAM is allocated at address 0x20000000. The device(s) are configured during the auto-boot operation (64 MB SDRAM on KB9202B).

Parallel FLASH The 16 MB parallel FLASH is allocated at address 0x10000000. The device(s) can be erased and programmed using the ramMonitor utility (see ramMonitor).

NAND FLASH The 32 MB NAND FLASH (KB9202B) is accessed via the processor’s NAND flash controller and is supported in the Linux kernel.

USB full speed host port This device is controlled by the internal registers of the AT91RM9200. The power available (+5VDC) for USB host port does not provide over-current detection/prevention as specified in the USB spec. The supply is internally protected against over-current conditions and can optionally be disabled via jumper (see Jumpers and header information).

LCD interface The LCD control and data registers are allocated at addresses 0x30000000 and 0x30010000, respectively. The backlight can be enabled/disabled in software on pin PC23. The LCD is available externally using Optrex part number F-51320GNB-LW-AB or F-51320GNY-LY-AA. This part is available from KwikByte or through external distributors such as Digikey, etc.

www.kwikbyte.com 14/28

Page 15: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

Temperature sensor The on-board temperature sensor is accessed on the TWI (two-wire interface) at device address 0x49. The device provides a ±2º C accuracy.

Power supply The on-board switching power supply provides +3.3VDC at a minimum of 2.5A for installed devices and expansion devices. The circuit includes a rectifier to eliminate the concern on the polarity of external plug. Many standard (2.1mm x 5.5mm female jack) AC or DC supplies can be used to power the board.

Parameter AC DC Voltage, min 9 VAC 11 VDC Voltage, max 18 VAC 22 VDC Current, min 300 mA 300 mA

Table 11: Power requirements

Notice, the values provided are not related; i.e., the DC requirements are not based on the AC values. These values are calculated for on-board devices only and do not include power-supply budget for user-added devices. It is also possible to power the device from battery or a lower-voltage source by skipping the rectifier. The switching supply requires 5 V minimum, but will operate at reduced efficiency at this lower voltage. Suitable power supplies are readily available. For example, power supplies have been tested from an original Nintendo® game system, laptop, other lab boards, and home phone set. If a suitable supply is not readily available, one can be purchased from various sources. The test system uses 12VAC, 60Hz, 1000mA supplies from Jameco (PN: 10081(CC) selling for $5.20 at the time of this writing).

Boot sequence By default, the KB9202 copies the bootloader from EEPROM to internal SRAM and transfers execution to the image in SRAM. The bootoloader performs the following:

1) Configure basic hardware such as debug serial port, SDRAM, and parallel FLASH.

2) Check for a character on the debug serial port. a. If no character was entered, execute the auto-boot commands in order. b. If a character was entered, abort the auto-boot and enter the interactive

bootloader mode.

www.kwikbyte.com 15/28

Page 16: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

To prevent the auto-boot sequence, send at least once character to the bootloader during reset. The easiest way to accomplish this is to hold-down a key on the debug serial port after pressing the reset switch until the prompt shows the key. The default auto-boot commands are listed, below, with descriptions of each command: 0x00 : Bootloader for KB9202 Evaluation Board.[E] 0x01 : c 0x20210000 0x10100000 0x80000 [E] 0x02 : m 0 0 0 0 0 0[E] 0x03 : t 0x20000100 console=ttyS0,115200 root=/dev/ram rw initrd=0x20210000,6549 33[E] 0x04 : e 0x10000000 [E] 0x05 : [E]

0x00: This is a comment line with has no impact on execution. 0x01: Copy 0x80000 bytes from address 0x10100000 to address 0x20210000. This

copies the filesystem (initrd.gz) from FLASH to SDRAM. 0x02: Set the Ethernet MAC address. The value entered at the factory is an invalid value.

You must update this command with a valid MAC address for the Ethernet interface to function properly in Linux.

0x03: Set the Linux command tag/parameters at address 0x20000100. 0x04: Start the Linux kernel at FLASH address 0x10000000. 0x05: (Shown for reference only) Empty lines have no impact on execution.

Download Currently, two methods are available to download programs/images: serial port and Ethernet.

Serial download The serial port can be used to download programs/images in bootloader and ramMonitor modes. In both cases, the “x” command is used to transfer binary data via serial port to the board using X-modem protocol. This transfer mode is supported in Windows® terminal and Linux “download” programs. The Linux “download” is a custom, stand-alone program provided with the distribution CD. Because data is transferred at 115200 bps, large images require significant time to download. As an approximation, a 1 MB compressed Linux kernel downloads over serial in about 1.5 minutes. To perform a serial download perform the following steps:

1) x <destination address> 2) Exit the connection to the board 3) ./download <file> 4) Open the connection

www.kwikbyte.com 16/28

Page 17: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

The status of the previous transfer can be viewed using the “x” command without any additional parameters (ramMonitor mode only). The following output shows a failed transfer or no transfer attempted condition. >x Local buffer available of size: 4194304 bytes (4MB) at address: 0x2000B494 Last x-modem transfer: FAIL (or not initiated)

Ethernet download (TFTP) The Ethernet port can be used to download programs/images in bootloader and ramMonitor modes. In both cases, the “TFTP” command is used to transfer binary data via Ethernet port using the TFTP protocol. A TFTP server must be operational on the network to provide the request data. Configuration of the TFTP server is beyond the scope of this document. In order to complete a TFTP download, the following actions must be taken (in order):

1) Set the MAC address of the KB9202 (“m # # # # # #”). 2) Set the IP address of the KB9202 (“ip # # # #”). 3) Set the IP address of the TFTP server (“server_ip # # # #”). 4) Execute the transfer (“TFTP <destination address> <image name>”).

The status of the previous transfer can be viewed using the “TFTP” command without any additional parameters. The following output shows a failed transfer or no transfer attempted condition. >tftp -- Last TFTP transfer info -- address: 0x00000000 size: 0x00000000

Bootloader The bootloader supports a limited set of commands intended to facilitate debug operations and loading/executing a Linux kernel image. Any of the commands can be set for auto-boot operation using the “s” command.

Bootloader commands Each of the following commands is case-sensitive and expected to be used in lower-case. Unless otherwise stated, all address values are interpreted as hexadecimal and the leading “0x” characters are optional.

www.kwikbyte.com 17/28

Page 18: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

c (Copy) The copy command is used to copy data from one location in memory to another location. Typically, this command is used to transfer an image from FLASH to SDRAM. Format: c <destination address> <source address> <size in bytes>

d (Display autoboot commands) The display command is used to show the current auto-boot table as configured in RAM. Any changes made to the table must be written to the non-volatile storage in order to take effect on the next boot sequence (see w (Write auto-boot command table)). Format: d

e (Execute at address) The execute command is used to begin execution of an image. The image can be loaded in RAM, SDRAM, or FLASH. Typically, the execute command is used to start the Linux kernel in FLASH. Format: e <execution address>

ip (Set local IP address) The ip command sets the IP address of the KB9202. The format is in decimal and does not include any “.” demarcation characters. Format: ip # # # #

Example: ip 192 168 1 20

m (Set local MAC address) The MAC command is used to set the Ethernet MAC value of the KB9202. The format is in hexadecimal and does not include any “.” demarcation characters. Format: m # # # # # # Example: m 2 4 6 8 a 12 You must supply a valid, unique MAC address for the Ethernet to function properly. The value shown is for example purpose only and should not be used.

www.kwikbyte.com 18/28

Page 19: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

s (Set auto-boot command) The set command modifies the auto-boot command table in RAM. Any of the other bootloader commands can be used in auto-boot sequence. Format: s <auto-boot index> <new command and parameters> Example: s 1 c 0x20210000 0x10100000 0x4000

server_ip (Set server IP address) The server_ip command sets the IP address of the TFTP server on the network. The format is in decimal and does not include any “.” demarcation characters. Format: server_ip # # # #

Example: server_ip 192 168 1 24

t (Set Linux parameter list) The “t” command is used to construct the Linux kernel’s parameter list. The information can be used to modify the operation of the kernel: e.g., setting the Linux IP address or specifying the root filesystem. Format: t <destination address> <parameter list>

tftp (Perform TFTP download) The TFTP command is used to execute a TFTP download operation. Format: tftp <destination address> <image name>

w (Write auto-boot command table) The write command is used to store the auto-boot command sequence from RAM to the non-volatile storage. The command is required to preserve any changes made to the table (“s” commands). Format: w

www.kwikbyte.com 19/28

Page 20: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

x (Perform X-modem download) The x-modem command is used to execute a serial, X-modem download operation. Format: x <destination address>

ramMonitor A utility is provided with the KB9202 for use in debug, development, and test. This utility is called “ramMonitor”. The program provides a simple command-line interface to download programs/images, update FLASH, and verify peripherals. The ramMonitor can be stored in FLASH and executed there, copied to SDRAM and executed there, or downloaded (TFTP or serial) to SDRAM. In the first case, the program copies itself to SDRAM and transfers execution there. Notice, the ramMonitor support SPI read/write operations which have been deprecated in the KB9202. As a result, the following power-up message will be shown because the SPI devices are not installed: Entry: RAM Monitor v1.3.0 Unexpected SPI FLASH status: 0xFF

ramMonitor commands Each of the following commands is case-sensitive and expected to be used in lower-case. Unless otherwise stated, all address values are interpreted as hexadecimal and the leading “0x” characters are optional. Many of the commands used in bootloader operation are also available in ramMonitor mode. The description of those commands is not repeated here.

? | h | help These commands provide a limited help menu displaying supported commands and basic usage information.

bus The bus command is used to display the processor memory bus speed. Format: bus

www.kwikbyte.com 20/28

Page 21: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

c (Copy) See bootloader section.

compare The compare operation is used to byte-wise compare two sections of memory. This command is particularly useful in verifying FLASH update operations. Format: compare <start address 1> <start address 2> <size in bytes>

e (Execute at address) See bootloader section.

eeread The eeread command is used to copy the contents of EEPROM to SDRAM. The SDRAM can then be read to determine the contents of the EEPROM. Format: eeread <EEPROM address> <destination address> <size in bytes>

eewrite The eewrite command is used to modify the contents of EEPROM using data from SDRAM. Format: eewrite <EEPROM address> <source data address> <size in bytes>

f (FLASH operations) The “f” commands are used to perform FLASH operations. ERASE Format: f e Operation: Unlocks protect bits and erases entire FLASH device. Format: f e <start address> <end address> Operation: Erases the sectors containing the addresses specified.

www.kwikbyte.com 21/28

Page 22: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

PROGRAM Format: f p <FLASH start address> <source data start address> <size in bytes> Operation: Program FLASH with the contents of memory specified.

ip (Set local IP address) See bootloader section.

irda The irda command is used to verify basic operation of the IrDA transceiver. In order to test duplex operation, another receiving end is required; most applications will report a failure from this operation. However, typical remote control devices can be used to test the receive operation of the KB9202. Format: irda

lcd The lcd command is used to cycle test patterns on the LCD display as well as control the backlight. Format: lcd Operation: Cycles through preset display patterns on the LCD. Format: lcd <on | off> Operation: Enables or disables the LCD backlight.

led The led command is used to enable/disable the user LEDs. Format: led <0 – 7> Operation: Displays the binary pattern specified on the LEDs.

m (Set local MAC address)

www.kwikbyte.com 22/28

Page 23: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

See bootloader section.

proc The proc command is used to display the processor clock frequency. Format: proc

read The read command is used to display the contents of memory. Format: read <access size> <start address> <size in bytes> Example: read 4 0x10000000 0x100

server_ip (Set server IP address) See bootloader section.

temp The temp command is used to test the on-board temperature sensor. Format: temp

tftp (Perform TFTP download) See bootloader section.

uhp The uhp command is used to verify USB host-device loopback operation. A loopback cable must be attached between the host and device ports for this operation to complete. Format: uhp

write

www.kwikbyte.com 23/28

Page 24: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

The write command is used to modify memory. Format: write <access size> <address> <value>

x (Perform X-modem download) The x-modem command is used to execute a serial, X-modem download operation. Format: x <destination address>

Installing the reference toolchain and kernel on the host system To install the reference cross-compiler toolchain, execute the following (as root):

1) Copy the tools_source folder from the CD to a local, temporary directory. a. mkdir /tools_source b. cp –R /media/cdrecorder/distribution_cd/tools_source/* /tools_source

2) Unzip the install script tar file a. cd /tools_source b. tar –xvf tools_install.tar

3) Execute the install file (this takes a long time) a. ./tools_install

4) Remove the temporary installation folder a. cd / b. rm –rf /tools_source

Once complete, the toolchain will be available at /usr/local/arm/bin and the reference, compressed Linux kernel will be available at /usr/src/arm/linux/arch/arm/boot/zImage.

How to upgrade kernel/filesystem/bootloader To replace or re-install the Linux kernel:

1) Execute the ramMonitor. 2) Erase the portion of FLASH which the kernel will occupy. Typically, this address

is in the range of 0x10000000 – 0x100FFFFF, but depends on the size of the kernel (e.g., “f e 0x10000000 0x100fffff”).

3) Download the new kernel using serial or TFTP download methods. 4) Program FLASH with the new kernel (e.g., “f p 0x10000000 <download address>

<download size>”).

www.kwikbyte.com 24/28

Page 25: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

The above sequence is applicable to the filesystem (initrd.gz) by adjusting the addresses. Be sure the auto-boot sequence copy operation is sufficiently large for the new filesystem. To replace or re-install the bootloader:

1) Execute ramMonitor. 2) Download the new bootloader using serial of TFTP download methods. 3) Program the EEPROM with the new bootloader (“eewrite 0 <download address>

<download size>”). Be sure the new bootloader’s size does not exceed the available storage capacity of the EEPROM.

Crash recovery In case a new bootloader is corrupted, the original bootloader can be restored using the following approach:

1) Short pins 1-2 of JP3/JP4 (see Jumpers and header information) using a wire or other contact.

2) Reset the board. 3) Verify ‘C’ characters are emitted from the debug serial port. 4) Download the program “stage1.bin” using X-modem over serial. 5) Download the ramMonitor.bin using X-modem over serial. 6) Remove the shorting jumper on pins 1-2 of JP3/JP4 (see Jumpers and header

information). 7) Download the original bootloader.bin. 8) Program EEPROM using the original image as specified, above.

Building the filesystem The following steps can be used to build a filesystem and utilities for the KB9202. First, build uclibc (the C libraries). Download uClibc (0.9.27) and unpack in /usr/local/arm Copy uc_cfg.txt to the uClibc directory and rename as .config Configure (make menuconfig), change nothing, and exit saving changes make CROSS=/usr/local/arm/bin/arm-linux- make install

This installs the libraries in /usr/arm-linux-uclibc. Then, build the utilities (busybox).

www.kwikbyte.com 25/28

Page 26: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

Download busybox-1.00 Copy bb_cfg.txt to the busybox directory and rename as .config From within the busybox directory, make menuconfig, change nothing, and exit saving changes make make install

Then, create and configure the initrd image (from within the busybox directory). dd if=/dev/zero of=initrd bs=1k count=4096 mke2fs -F -m 0 -i 1024 initrd mkdir ramdisk mount -t ext2 -o loop initrd ramdisk cd ramdisk mkdir dev etc tmp var proc mnt home root cd dev mknod console c 5 1 mknod ttyS0 c 4 64 mknod tty c 5 0 mknod ram0 b 1 0 mknod ram1 b 1 1 mknod mem c 1 1 mknod kmem c 1 2 mknod null c 1 3 mknod zero c 1 5 mknod fb0 c 29 0 ln -s fb0 fb ln -s ram1 ram ln -s ram0 ramdisk ln -s ../proc/kcore kcore ln -s ../proc/self/fd/0 stdin ln -s ../proc/self/fd/1 stdout ln -s ../proc/self/fd/2 stderr cd .. cp -R ../_install/* .

Make a file called rcS with the following contents: #!/bin/sh /bin/mount -n -t proc proc /proc /bin/mount -o remount,rw / /bin/mount -a /sbin/ifconfig lo 127.0.0.1 up /sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo echo " " echo " *************************** " echo " KB9202 (www.kwikbyte.com) " echo " sample initrd " echo " *************************** " echo " "

Put the file in etc/init.d (within the ramdisk directory) and change permissions to make it executable. Make a file called fstab with the following contents: /dev/root / ext2 rw,noauto 0 1 proc /proc proc defaults 0 0

www.kwikbyte.com 26/28

Page 27: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

Put the file in etc (within the ramdisk directory). Finally, unmount the sample filesystem and compress it with the following commands (from within the busybox directory). chown -R 0:0 ramdisk umount ramdisk gzip -9 initrd

Now, the initrd.gz file created can be installed and mounted on the KB9202.

Mounting NFS directory as the root filesystem During development, the cycle time required to update and flash the filesystem can be prohibitively large. To reduce this time, the filesystem can be mounted on the host via nfs. Once the nfs server and firewall are configured correctly on the host to export the local filesystem, the default KB9202 kernel image must be rebuilt/flashed with the following option enabled: [*] Root file system on NFS

Then, in the bootloader:

1) Set a valid MAC address. 2) Set the tag line (e.g., “t 0x20000100 console=ttyS0,115200 root=/dev/nfs

nfsroot=192.168.1.203:/usr/local/arm/hostroot_nsf ip=192.168.1.80”) 3) Execute the new kernel image in flash (e.g. “e 0x10000000”).

Mounting a USB mass storage device (keydisk) Other than the default options, the kernel must be built with the appropriate options enabled: [*] Support for Hist-side USB [*] USB verbose debug messages (optional) [*] USB device filesystem [*] OHCI HCD support [*] USB Mass Storage support [*] USB Mass Storage verbose debug (optional) [*] legacy /proc/scsi support [*] SCSI disk support [*] SCSI generic support [*] MSDOS fs support [*] VFAT (Windows-95) fs support (437) Default codepage for FAT (iso8859-1) Default iocharset for FAT

www.kwikbyte.com 27/28

Page 28: KB9202 User’s Guide - kwikbyte.com · command (“ps –ef”). Figure 5: Basic operation Notice, the same command sequence can be executed in a Linux environment using minicomm

Flash the new kernel image and power the board. Notice, several warning messages regarding the second USB host port are emitted. This is normal as the second host port is inaccessible on this implementation of the processor. Perform the following steps:

1) mknod /dev/sda b 8 0 2) mknod /dev/sda1 b 8 1

3) Insert the keydisk and wait the device to be recognized by the SCSI drivers. 4) mount -t usbfs none /proc/bus/usb 5) mkdir /mnt/usb 6) mount /dev/sda1 /mnt/usb

7) View the contents of the device using “ls /mnt/usb”.

www.kwikbyte.com 28/28