User guide
19 GR-LEON4-ITX Development Board
Quick Start Guide
to the SPI boot PROM on the GR-LEON4-ITX board. The first step in communicating with 
the SPI memory device is to allow the SPI Flash layer to detect the device:
grlib> spim flash detect 
 Got manufacturer ID 0x20 and Device ID 0x2017 
 No device match for READ ID instruction, trying RES instruction.. 
 Found matching device: ST/Numonyx M25P64 
grlib> 
Since the SPIMCTRL core maps the memory device into AMBA address space we can read 
the memory device using GRMON's mem command:
grlib> mem 0 
    0 ffffffff ffffffff ffffffff  ffffffff  ................ 
   10 ffffffff ffffffff ffffffff  ffffffff  ................ 
   20  ffffffff  ffffffff  ffffffff ffffffff   ................ 
   30 ffffffff ffffffff ffffffff  ffffffff  ................ 
grlib> 
In the read out above the device is empty. We can now try to load a file to the device. First 
we give a shell command that lists the contents of the small S-REC file we will use for this 
example (do not issue the shell cat command on large or non-text files)
grlib> shell cat ~/tests/test_seq4-small 
S0030000FC 
S315000000000000000004040404080808080C0C0C0C4A 
S315000000101010101014141414181818181C1C1C1C3A 
S315000000202020202024242424282828282C2C2C2C2A 
S315000000303030303034343434383838383C3C3C3C1A 
S315000000404040404044444444484848484C4C4C4C0A 
S315000000505050505054545454585858585C5C5C5CFA 
S315000000606060606064646464686868686C6C6C6CEA 
S315000000707070707074747474787878787C7C7C7CDA 
… and so on. We can now download this file to the memory device:
grlib> spim flash load ~/tests/test_seq4-small 
section:  at 0x0, size 256 bytes 
entry point: 0x0 
After downloading the file we can see that the contents has been written to the flash device:
grlib> mem 0 
    0 00000000 04040404 08080808  0c0c0c0c  ................ 
   10 10101010 14141414 18181818  1c1c1c1c  ................ 
   20  20202020  24242424  28282828 2c2c2c2c    $$$$((((,,,, 
   30 30303030 34343434 38383838  3c3c3c3c  000044448888<<<< 
grlib> 
GRMON also has support for dumping the contents of the memory device into a S-REC file, 
see the GRMON User's Manual for details.
Finally, we can erase the device, this should always be done before attempting to load data 
into the memory. Erasing is quite slow and will take a little over sixty seconds:
grlib> spim flash erase 
grlib> mem 0 4 
    0 ffffffff ffffffff ffffffff  ffffffff  ................ 
grlib> 
When the device is erased, all bits will be set to '1'.
© Aeroflex Gaisler AB March 2013, Rev. 0.3










