2.4 OpenOCD Debugger
This section provides basic information on how to connect a debugger to the ARM Cortex A7 CPU
on the board. The board uses an FTDI device to provide JTAG over USB which is supported via
the
software. Note that openocd v0.10.0 adds support for MMU address translation
and cache flushing which is required to debug the Linux kernel or other OS that uses the MMU to
remap memory ranges. However, if you connect to the target after it has executed code to enable
the MMU and cache, download performance will be significantly slower due to the MMU table look
ups. OpenOCD v0.10.0 has issues debugging ARM Thumb2 code, so please build the latest
version.
git clone http://repo.or.cz/openocd.git
cd openocd
./bootstrap
./configure --disable-jlink
make clean
make
sudo make install
OpenOCD provides a “gdbserver” so you can connect to Eclipse or other debuggers that supports
this protocol. The following instructions detail how to connect to the gdbserver using the gdb
command line debugger.
Ensure switch SW5-6 is OFF and switch SW3 is OFF, i.e. away from the white bar.
Below we show basic commands to get you started with GDB. Further details on using OpenOCD
with GDB can be found at
http://openocd.org/doc/html/GDB-and-OpenOCD.html
Connect to the board using the configuration file provided by Renesas. This starts a GDBServer
which you can connect to from gdb or any other debugger that supports connecting to a
GDBServer.
openocd -f renesas-rzn1s-openocd.cfg
In a separate terminal, you can now connect using gdb. Specify the U-Boot elf file on the
command line. You can use the -tui option to show source code in a simplified GUI:
arm-linux-gnueabihf-gdb -tui u-boot
...
(gdb)
target remote localhost:3333
Read symbols from the ELF file specified on the gdb command line, u-boot in this example, and
download the code to the RZ/N1 SRAM:
(gdb)
load
Loading section .text, size 0x1ffc0 lma 0x200a0000
...
Start address 0x200a0000, load size 217553
Note: The U-Boot elf file is actually different to the binary image, so download the binary
(gdb)
mon load_image u-boot.bin 0x200a0000 bin
Step into the code:
(gdb)
s
Set a breakpoint at the start of a function:
(gdb)
b board_init
Run the code until you hit a breakpoint:
(gdb)
c
Summary of Contents for RZ/N1S-DB
Page 9: ...RZ N1S DB Board U Boot ...