NOEL-ARTYA7-EX-QSG
December 2020, Version 1.2
20
www.cobhamaes.com/gaisler
Directory Options
---------------------------------------------------
rv32i/ilp32 -march=rv32i -mabi=ilp32
rv32im/ilp32 -march=rv32im -mabi=ilp32
rv32ima/ilp32 -march=rv32ima -mabi=ilp32
rv32imafd/ilp32d -march=rv32imafd -mabi=ilp32d
rv64ima/lp64 -march=rv64ima -mabi=lp64
rv64imafd/lp64d -march=rv64imafd -mabi=lp64d
---------------------------------------------------
The default multilib when (no march or mabi) is used corresponds to -march=rv64im -mabi=ilp64.
6.6. Running and debugging with GRMON
Once your application is compiled, connect to your NOEL-ARTYA7-EX with GRMON. The following log shows
how to load and run an application. Note that the console output is redirected to GRMON by the use of the
-u
command line switch, so that the application standard output is forwarded to the GRMON console.
$ grmon -ftdi -u
GRMON3 LEON debug monitor v3.2.9 professional version
Copyright (C) 2020 Cobham Gaisler - All rights reserved.
For latest updates, go to http://www.gaisler.com/
Comments or bug-reports to [email protected]
[...]
grmon3> load hello.elf
00000000 .text 23.6kB / 23.6kB [===============>] 100%
00005E70 .data 2.7kB / 2.7kB [===============>] 100%
Total size: 26.29kB (803.58kbit/s)
Entry point 0x00000000
Image hello.elf loaded
grmon3> run
hello, world
CPU 0: Program exited normally.
To debug the compiled program you can insert breakpoints, step and continue execution directly from the GRMON
console. Program symbols are loaded automatically by GRMON when you load the application. An example is
provided below.
grmon3> load hello.elf
00000000 .text 23.6kB / 23.6kB [===============>] 100%
00005E70 .data 2.7kB / 2.7kB [===============>] 100%
Total size: 26.29kB (806.59kbit/s)
Entry point 0x00000000
Image hello.elf loaded
grmon3> bp main
Software breakpoint 1 at <main>
grmon3> run
CPU 0: breakpoint 1 hit
0x00001928: b0102000 addi sp, sp, -16 <main+0>
grmon3> step
0x40001928: b0102000 mov 0, %i0 <main+4>
grmon3> step
0x4000192c: 11100017 sethi %hi(0x40005C00), %o0 <main+8>
grmon3> cont
hello, world
CPU 0: Program exited normally.
Alternatively you can run GRMON with the
-gdb
command line option and then attach a GDB session to it.