GRMON3-UM
June 2019, Version 3.1.0
36 www.cobham.com/gaisler
Device ID : 09169e01734a9981
User ID : ffffffffffffffff
1 x 8 Mbytes = 8 Mbytes total @ 0x00000000
CFI information
Flash family : 1
Flash size : 64 Mbit
Erase regions : 1
Erase blocks : 64
Write buffer : 32 bytes
Lock-down : Not supported
Region 0 : 64 blocks of 128 kbytes
grmon3> flash status
Block lock status: U = Unlocked; L = Locked; D = Locked-down
Block 0 @ 0x00000000 : L
Block 1 @ 0x00020000 : L
Block 2 @ 0x00040000 : L
Block 3 @ 0x00060000 : L
...
Block 60 @ 0x00780000 : L
Block 61 @ 0x007a0000 : L
Block 62 @ 0x007c0000 : L
Block 63 @ 0x007e0000 : L
A typical command sequence to erase and re-program a flash memory could be:
grmon3> flash unlock all
Unlock complete
grmon3> flash erase all
Erase in progress
Block @ 0x007e0000 : code = 0x80 OK
Erase complete
grmon3> flash load rom_image.prom
...
grmon3> flash lock all
Lock complete
3.11.2. SPI memory device
GRMON supports programming of SPI memory devices that are attached to a SPICTRL or SPIMCTRL core. The
flash programming commands are available through the cores' debug drivers. A SPI flash connected to the SPIC-
TRL controller is programmed using 'spi flash', for SPIMCTRL connected devices the 'spim flash' command
is used instead. See the command reference for respective command for the complete syntax, below are some
typical use cases exemplified.
When interacting with a memory device via SPICTRL the driver assumes that the clock scaler settings have been
initialized to attain a frequency that is suitable for the memory device. When interacting with a memory device via
SPIMCTRL all commands are issued with the normal scaler setting unless the alternate scaler has been enabled.
A command sequence to save the original first 32 bytes of data before erasing and programming the SPI memory
device connected via SPICTRL could be:
spi set div16
spi flash select 1
spi flash dump 0 32 32bytes.srec
spi flash erase
spi flash load romfs.elf
The first command initializes the SPICTRL clock scaler. The second command selects a SPI memory device
configuration and the third command dumps the first 32 bytes of the memory device to the file 32bytes.srec.
The fourth command erases all blocks of the SPI flash. The last command loads the ELF-file romfs.elf into
the device, the addresses are determined by the ELF-file section address.
Below is a command sequence to dump the data of a SPI memory device connected via SPIMCTRL. The first com-
mand tries to auto-detect the type of memory device. If auto-detection is successful GRMON will report the device
selected. The second command dumps the first 128 bytes of the memory device to the file 128bytes.srec.
spim flash detect
spim flash dump 0 128 128bytes.srec