How to Use the Download Tool

Overview

The download application is used to program either the NOR flash or the SPI EEPROM connected to Cirrus Logic's ARM9 processor. For the board with an EP93xx, it can program the NOR flash connected to nCS6 as well as the SPI EEPROM connected to the SPI port. It supports all sizes of Intel B3, C3, J3 and P30 flashes and AM29LV320D flash in either 16-bit or 32-bit-wide configuration. The 32-bit-wide configuration is simply two 16-bit flashes connected in parallel on the 32-bit-wide bus.For SPI EEPROM, it supports the Atmel 25F1024 EEPROM ,SST SST25VF020,and SST SST25VF040B.

Note:Atmel 25F1024 EEPROM,each sector has 32k bytes.

Arguments



The arguments for the download program are as follows:

 

  -b baud    Use the specified baud rate. Valid values are 9600, 19200,

             38400, 57600, and 115200.

             Default is "115200".

 

  -h         Prints this usage message.

 

  -n [MACAd] Program the specified 6-byte-long Ethernet MAC address into 

             EEPROM. The format of MAC address is XxXxXxXxXxXx, 

             where Xx is a hex number of a byte. If MACAd is not specified,

             it prints the MAC address stored in EEPROM. This implies the 

             argument "-s 2".

 

  -o offset  The offset into the memory of FLASH or EEPROM where the 

             filename image should be programmed.  It takes numbers, 

             Num*K (2^10), and Num*M (2^20). This value must correspond

             to a block address boundary. If not, it will print an error

             message and exit. Default is "0".

             

  -p port    Use the specified serial port. Append the specified port string

             to the serial port prefix, /dev/tty for Linux and COM for Windows.   

             For Linux, default is "S0" which implies /dev/ttyS0.  

             Valid values are S0, S1,....USB0,USB1...etc.

             For Windows, default is "1" which implies COM1. 

             Valid values are 1, 2, 3, 4, 5, 6,...etc.

 

  -s device  Program the specified image into a storage device, either EEPROM 

             or NOR FLASH.  Valid values are 1 (NOR flash) and 2 (EEPROM).

             Default is "1".

 

  -v         Prints the version of the program.

 

  filename   The name of the file to be programmed into NOR flash or EEPROM.  

             This argument is optional if "-n" is specified.

 

	

Usage

To program the file "foobar.bin" into the NOR FLASH at offset 0, using serial port 1, and data speed of 115200, simply type the following,



    download foobar.bin

	

To program the file "foobar.bin" into the SPI EEPROM at offset 0, using serial port 1, and data speed of 115200, type the following,

 


    download -s 2 foobar.bin

	

To program the file "foobar.bin" into the NOR FLASH at offset 16k (0x4000), using serial 5, and the data speed is 57600, type the following,

 


    For Linux,

    download -b 57600 -o 16k -p S4  foobar.bin

    download -b 57600 -o 0x4000 -p S4  foobar.bin

 

    For Windows, 

    download -b 57600 -o 16k -p 5  foobar.bin

    download -b 57600 -o 0x4000 -p 5  foobar.bin

	

To program the MAC address,12:34:56:AB:CD:EF, into the SPI EEPROM, type the following,

 


    download -n 123456ABCDEF

	

To program the file "foobar.bin" at offset 0 and the MAC address, 12:34:56:AB:CD:EF at offset 0x1000 into the SPI EEPROM, type the following,

 


    download -n 123456ABCDEF foobar.bin  

	

To program the file "foobar.bin" at offset 0x400(1k) and the MAC address, 12:34:56:AB:CD:EF at offset 0x1000 into the SPI EEPROM, type the following,

 


    download -n 123456ABCDEF -o 1k foobar.bin

	

Read the MAC Address stored in EEPROM, type the following,



    download -n 

	

The information of MAC address is placed at offset 0x1000 in the EEPROM, The 32 bytes of data at that position will be overwritten, and the first 0x1000 bytes of the EEPROM will be filled with zeros if a file name (filename) is not specified. If a file name is specified when -n is used, the combination of the file size and the -o offset should not overlap with the MAC address. In case overlap occurs, the program will print an error message and exit.

The data of the MAC address has 32 bytes. The first four bytes is "EMAC"; the next six bytes are the MAC address; the next six bytes are reserved; the last 16 bytes are the string name for this board. The last field currently uses 12 bytes to store the ASCII code of the MAC address .

Once download is ready to talk to the board, it will display:

Waiting for the board to wakeup...

At this point, download is waiting for the board to initiate the serial boot sequence. This sequence varies for each board:

For the EDB9301 and EDB9302:



1) Connect the "UART1" port of the board (i.e. the bottom serial connector)

   to the PC with a NULL modem cable.

2) Move the TEST0 jumper (JP14 on the EDB9301/EDB9302) from 2-3 to 1-2.

3) Press and release the RESET button.

4) In order to boot properly, the TEST0 jumper must be moved back to 2-3

   once the download process is complete.

	
For the EDB9312 and EDB9315:


1) Connect the "UART1" port of the board (i.e. the bottom serial connector)

   to the PC with a NULL modem cable.

2) Move the TEST0 jumper (JP92 on the EDB9312/EDB9315) from 2-3 to 1-2.

3) Press and release the RESET button.

4) In order to boot properly, the TEST0 jumper must be moved back to 2-3

   once the download process is complete.

	
For the EDB9307:


1) Connect the "UART1" port of the board (i.e. the bottom serial connector)

   to the PC with a NULL modem cable.

2) Press and hold S3 (BOOT 0).

3) Press and release SW2 (RESET).

4) Release S3 (BOOT 0).

	
For the EDB9315A:


1) Connect the "UART1" port of the board to the PC with a NULL modem cable.

2) Press and hold S1 (SERIAL BOOT).

3) Press and release S3 (POR).

4) Release S1 (SERIAL BOOT).

	

At this point, download should start sending the initial boot code. As it does so, it will display its status as follows:

Downloading boot code...(67%)

After the initial boot code is downloaded, it will check the starting offset and image length to make sure they fit into the memory being programmed. For all of the following messages, programming the NOR flash is assumed. If the SPI EEPROM is being programmed, all occurrences of flash would appear as EEPROM. If the image is too large to fit into the memory that was detected on the board, it will display the following message and exit:

The image is too large for the flash.

If the starting offset does not correspond to a block boundary, it will display the following message and exit:

The offset '543' is not valid for the flash.

If the starting address and image size are valid, it will erase the portion of memory to be programmed. It could take several seconds to erase the memory so be patient. It will display its status as follows:

Erasing the flash...

Once the memory is erased, it will program the contents of the memory. It will display its status as follows:

Programming the FLASH...(17%)

After the memory has been programmed, download will display the final results of the download. The data is checksummed as it is transferred over the serial link, and read back from memory after it has been programmed to compare it to the data received from the PC. If there is an error in any of these verification steps, download will display the following message when complete:

Failed to program 'filename'.

Or it will display the following message if a problem occurred while programmed just the Ethernet MAC address:

Failed to program the Ethernet MAC address.

If everything was successful, it will display the following message:

Successfully programmed 'filename'.

Or it will display the following message if just the Ethernet MAC address was being programmed:

Successfully programmed the Ethernet MAC address.

It is possible that the PC and the target get a bit out of sync during the download process. If this happens, the download program attempts to recover the communication link gracefully. If it is unable to, it will eventually time out. If the progress seems to be stuck, wait at least two minutes before killing the download program.

For memories that support block locking, download will attempt to unlock the blocks before erasing them. For blocks that are hardware locked (either via permanent lock mechanism in the programming interface itself or a pin on the chip itself), there is nothing that download can do; in this case, the download will fail.