PKP
VS1000 P
ROGRAMMER
’
S
G
UIDE
VSMPG
8
Booting from SPI EEPROM
VS1000 supports loading boot-up code from an SPI EEPROM such as the 25LC640.
The ROM code checks the state of XCS pin during boot-up. If XCS is high, the code
attempts to read a boot record from the EEPROM using the SI, SO, SCLK and XCS pins.
In addition to the 16-bit addressing of SPI eeproms such as the 25LC640, the ROM also
supports 24-bit addressing of some larger EEPROMS (possibly up to 16 megabytes).
A program that is to be loaded using the SPI EEPROM must be linked with
c-spi.o
ob-
ject module. The
c-spi.o
module can also be used with running the code from vs3emu,
but not from the nand flash.
The
coff2spiboot
tool can be used to create a bootable EEPROM image from the linker
output file with a command such as:
coff2spiboot -x 0x50 led.bin eeprom.img
This reads the previously compiled program
led.bin
and creates a binary eeprom im-
age
eeprom.img
, which can be programmed to an SPI EEPROM with an EEPROM
programmer.
A valid boot record starts with identifier 0x564C5349 (’V’,’L’,’S’,’I’) and contains blocks of
binary data that are to be stored at specified addresses. A boot record that is loaded
via the SPI bus must have an execution command as the last block. Description of the
block format is in the datasheet, if it should be needed for some special purpose.
8.0.2
Using a VS1000 Developer Board as an eeprommer
Also a VS1000 Developer Board can be used to program the SPI EEPROM, using
the vs3emu file interface. The next pages contain an example program that reads the
eeprom.img
file and writes it to a 25LC640 EEPROM. The promming routine is compiled
normally to a binary program
prommer.bin
. It can be run with vs3emu with a command
such as:
vs3emu -chip vs1000 -s 115200 -l prommer.bin e.cmd
If the file
eeprom.img
is found on the local directory, the contents is programmed to the
EEPROM and you should see output such as
25LC640 EEPROM promming routine for VS1000A
Trying to open eeprom.img
Programming...
Sector 0000 ...
Reading first 2 words of EEPROM: 564c 5349 ("VLSI"), which is a valid VLSI boot id.
Done.
Rev. 0.20
2011-10-04
Page