GR712RC-QSG
November 2018, Version 1.0
19 www.cobham.com/gaisler
4.4. MKPROM2
4.4.1. Overview
To run application from the on-board PROM, it's necessary to create a bootable PROM image file. MKPROM2
is a utility program to create boot-images for programs compiled with the BCC or RTEMS cross-compiler. It
encapsulates the application in a loader suitable to be placed in a boot PROM. The application is compressed with
a modified LZSS algorithm, typically achieving a compression factor of 2.
The boot loader operates in the following steps:
• The register files of IU and FPU (if present) are initialized.
• The memory controller, UARTs and timer unit are initialized according to the specified options.
• The application is decompressed and copied into RAM.
• Finally, the application is started, setting the stack pointer to the top of RAM.
4.4.2. Usage of MKPROM2
The MKPROM2 tool can be downloaded from the Cobham Gaisler website [http://gaisler.com/index.php/down-
loads/compilers]. No installation is required, but the directory containing the executable must be included in
the system's PATH, together with a valid SPARC toolchain ( sparc-gaisler-elf, sparc-elf, sparc-
rtems or sparc-linux).
To generate a boot PROM for a GR712RC Development Board and running your program from SRAM:
mkprom2 -leon3 -freq 80 -rmw -ramsize 8192 -romsize 8192 -baud 38400 -ramws 2 -o hello.prom hello.exe
This example command will work for a board in the default configuration at delivery, with a system clock fre-
quency of 80 MHz. The -ramsize and -romsize options are expressed in KiB. The former value is 8MiB,
the size of the SRAM. The latter value is 8 MiB as well, and represents the size of the on-board flash. Finally the
-ramws option sets the number of wait states during SRAM access to 2, needed when running the system at 80
MHz, but might be a lower value at lower frequencies.
To generate a boot PROM for a GR712RC Development Board and running your program from SDRAM:
mkprom2 -leon3 -freq 80 -rmw -nosram -sdram 128 -romsize 8192 -baud 38400 -o hello.prom hello.exe
This example command will, again, work for a board in the default configuration at delivery. The -nosram option
will disable the SRAM and the -sdram option sets the size of the available SDRAM. This value is 128 MiB,
which is the value for the SODIMM provided by default with the board.
NOTE: When SRAM is disabled, the SDRAM address range is moved from 0x60000000 to 0x40000000, therefore
not requiring recompilation of executables. To run your program in SDRAM without disabling SRAM, you need
to link your program to the 0x60000000 address at compilation time. See the manual of your toolchain for more
information.
It's required that the MKPROM2 command line parameters match your system configuration. For more informa-
tion about command line options, please refer to [RD-12].
If EDAC is enabled on the board's PROM, then the -bch8 flag must be included in the command line. The
generated PROM image that needs to be flashed on the device in this case would be hello.prom.bch8.
Once the PROM file is generated, it can be loaded onto the board with GRMON. Once GRMON is attached to
the board, run the following commands to program the PROM.
flash
flash erase all
flash load hello.prom
verify hello.prom
For further information about connecting to the board with GRMON, see Chapter 3.