NOEL-ARTYA7-EX-QSG
December 2020, Version 1.2
12
www.cobhamaes.com/gaisler
Loading section .data, size 0x768 lma 0x40025488
Loading section .htif, size 0x1000 lma 0x40025c00
Loading section .sdata, size 0xa8 lma 0x40027000
Start address 0x40000000, load size 158864
Transfer rate: 62 KB/sec, 7943 bytes/write.
RTEMS images expect register
a1
to contain a pointer to a device tree description. This can be set up with the
dtb
command provided by GRMON. Use the
mon
prefix to execute a command in GRMON and load the device
tree using
dtb
:
(gdb) mon dtb noel-xilinx-artya7.dtb
DTB will be loaded to the stack
Use the
break
command to insert a breakpoint at the
Init
function:
(gdb) break Init
Breakpoint 1 at 0x40000170: file test.c, line 13.
The program can now be executed using the
run
command. GDB should break the execution once the program
reaches the
Init
function.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/user/riscv/demo/hello/hello.exe
Breakpoint 1, Init (ignored=1073914168) at test.c:13
13 puts("");
At this stage one can, for example, step through the program with
step
or
next
, print the values of variables
with
p
, or continue execution with the
cont
command.
(gdb) cont
Continuing.
hello, world
The following message is printed if the RTEMS program exits normally.
*** FATAL ***
fatal source: 5 (RTEMS_FATAL_SOURCE_EXIT)
fatal code: 0 (0x00000000)
RTEMS version: 5.0.0.94bddc9c5daf258a8d0981e63bf4180b7b249677
RTEMS tools: 9.3.0 20200312 (RTEMS 5, RSB 5 (3bd11fd4898b), Newlib 7947581)
executing thread ID: 0x08a010001
executing thread name: UI1
Program received signal SIGTRAP, Trace/breakpoint trap.
_CPU_Fatal_halt (source=source@entry=5, error=error@entry=0)
at /home/user/riscv/leon-rtems/build/../c/src/lib/libbsp/riscv/riscv/
../../../../../../bsps/riscv/riscv/start/bsp_fatal_halt.c:43
43 asm ("ebreak");
(gdb)