🐛RZ/G Debugging Information

From Renesas.info


Debug Tricks

  • For a list of suggestion for debugging common Linux issue, please see page RZ-G/debug_tricks


Debugger Options

This section provides a general overview of the debugging options when working with the RZ Family.

When discussing debugging on a Linux based platform, there are 2 topics to discuss:

  • Debug System options to choose from
  • What you will be debugging

First we will outline what are the common system options to choose from, then go into where you can/cannot use them.

System Choices

Below is a list of what your options are for Debug Systems, both free and commercial.

Lauterbach

  • https://www.lauterbach.com
  • PowerDebug Series
  • JTAG Interface is used
  • Options are available for advanced debugging features. You purchased what you need.
  • Support and version updates for additional costs.

Kyoto Micro

  • https://www.kmckk.co.jp/eng/
  • Partner Jet Series
  • Software requires yearly maintenance cost.
  • Used by Renesas teams in Japan (since they can get local support)

Segger

  • https://www.segger.com
  • J-Link Series
  • Only for RTOS debugging, no Linux debugging
  • For RZ/G, only the CM33 core is supported. The CA55 core is not supported.

OpenOCD

  • https://openocd.org
  • Free open source software
  • Requires a JTAG adapter. Many options to choose from.
  • The JTAG adapter you use does not need to be smart. It only needs to send/receive raw data packets. This means you can use some $20 JTAG adapters if supported by OpenOCD.


GDB: The GNU Project Debugger

  • https://www.sourceware.org/gdb/
  • This is a software solution. No JTAG.
  • You can debug user applications over Ethernet, USB, Serial or on command line on the target board.
  • The debug interface is command line. Or, you can use gdbserver to allow a connection to a graphical front end.

Eclipses

Software Sections

Depending on what software you will be debugging will determine what debug options are available.


Boot Loaders


  • Includes:
    • FlashWriter
    • Trusted Firwmare-A
    • u-boot
  • These are bare-metal type software.
  • No MMU is used (flat memory model)
  • Only 1 CPU core is used (other cores stay in reset)
  • System Options that can be used:
    • ✔️ Lauterbach
    • ✔️ Partner-Jet
    • ✔️ OpenOCD + GDB Command line interface
    • ✔️ OpenOCD + Eclipse interface


CM33 sub-core Debugging


  • Renesas e2Studio IDE
  • System Options that can be used:
    • ✔️ Segger J-Link + Renesas e2Studio
    • ✔️ OpenOCD + GDB Command line interface
    • ✔️ OpenOCD + Eclipse interface


Linux Kernel and Device Drivers


  • Even though the MMU is enabled when running Linux, the kernel area is at fixed address area in DDR memory, so the JTAG can access it correctly. It is not like application area where the MMU is constantly changing addresses in DDR memory.
  • For JTAG debugging, for any system, you need to restrict the system to only use 1 CPU core. This because the JTAG unit can only debug the 1st core.
  • System Options that can be used:
    • ✔️ Lauterbach
    • ✔️ Partner-Jet
    • ✔️ OpenOCD + GDB Command line interface
    • ✔️ OpenOCD + Eclipse interface
    • ✔️ kgdb (this is a software debugging method built into the kernel source code)


User Applications


  • When an application runs in Linux, the MMU is uses and the application is scattered through DDR memory. In order to do source code debugging, the debugger has to keep track of where all the different parts of the application are being stored in DDR memory. This make it much more difficult than bare-metal or RTOS debugging.
  • System Options that can be used:
    • ✔️ Lauterbach
    • ✔️ Partner-Jet
    • ✔️ gdbserver + Eclipse interface on host PC
    • ✔️ gdbserver + GDB Command line interface
    • ✔️ gdb 'native' (running stand along on the target board)

OpenOCD with the RZ/G2

Eclipse Development and Debugging with RZ/G2

ARM Performance Monitor Unit (PMU) on RZ/G2L

  • Provide useful information for debugging and performance profiling for ARM based platform and the driver is already included in linux kernel.
  • Page: RZ-G/Enable_PMU_support_for_RZ/G2L