GR712RC-QSG
November 2018, Version 1.0
18 www.cobham.com/gaisler
-mcpu=v8 generate SPARC V8 mul/div instructions - needs hardware multiply and divide
-O2 or -O3 optimize code maximum performance and minimal code size
-qleon3std generate LEON3/4 executable without driver manager startup initialization
-qleon3mp generate LEON3/4 Multiprocessor executable (AMP)
4.3.4. Running and debugging with GRMON
Once your executable is compiled, connect to your GR712RC-BOARD with GRMON. The following log shows
how to load and run an executable. Note that the console output is redirected to GRMON by the use of the -u
command line switch, so that printf output is shown directly in the GRMON console.
[andrea@localhost samples]$ grmon -ftdi -u
GRMON2 LEON debug monitor v2.0.42 internal version
Copyright (C) 2013 Aeroflex Gaisler - All rights reserved.
For latest updates, go to http://www.gaisler.com/
Comments or bug-reports to support@gaisler.com
Parsing -ftdi
Parsing -u
[...]
grmon2> load rtems-hello
40000000 .text 136.4kB / 136.4kB [===============>] 100%
400221A0 .data 4.4kB / 4.4kB [===============>] 100%
40023350 .jcr 4B [===============>] 100%
Total size: 140.83kB (780.05kbit/s)
Entry point 0x40000000
Image /home/andrea/Desktop/samples/rtems-hello loaded
grmon2> run
Hello World
CPU 0: Program exited normally.
CPU 1: Power down mode
To debug the compiled program you can insert break points, step and continue directly from the GRMON console.
Compilation symbols are loaded automatically by GRMON once you load the executable. An example is provided
below.
grmon2> load rtems-hello
40000000 .text 136.4kB / 136.4kB [===============>] 100%
400221A0 .data 4.4kB / 4.4kB [===============>] 100%
40023350 .jcr 4B [===============>] 100%
Total size: 140.83kB (781.11kbit/s)
Entry point 0x40000000
Image /home/andrea/Desktop/samples/rtems-hello loaded
grmon2> bp Init
Software breakpoint 1 at <Init>
grmon2> run
CPU 0: breakpoint 1 hit
0x400011f8: 1110007f sethi %hi(0x4001FC00), %o0 <Init+4>
CPU 1: Power down mode
grmon2> step
0x400011f8: 1110007f sethi %hi(0x4001FC00), %o0 <Init+4>
grmon2> step
0x400011fc: 4000003b call 0x400012E8 <Init+8>
grmon2> cont
Hello World
CPU 0: Program exited normally.
CPU 1: Power down mode
grmon2> Exiting GRMON
Alternatively you can run GRMON with the -gdb command line option and then attach a gdb session to it. For
further information see Chapter 3 of [RD-7].