Renesas Electronics Corporation (TSE: 6723), the world's number one supplier of microcontrollers, is a premier supplier of advanced semiconductor solutions including microcontrollers, SoC solutions and a broad range of analog and power devices.

You are viewing an older revision! See the latest version

How to debug with e2 studio


Builder: Mbed CLI or Mbed Studio(version1.2.0)
Toolchain: GNU ARM Embedded Toolchain(version 9) or ARM C Compiler (version 6.14)
Debugger: Renesas e2 studio

Setup Procedure

Install e2 studio

Please download e2studio 7.8.0 or 2020-07, and install.

Install OpenOCD

Please download exe file of OpenOCD v0.10.0-201601101000-dev, and install.

Associate GR-MANGO config with OpenOCD

Please download renesas_gr.cfg and copy it to scripts\board directory included in the OpenOCD installed location.
According to the version of the windows operating system and the version of OpenOCD, it should be located as follows:

Windows OS(32bit), OpenOCD(32bit):
・C:\Program Files\GNU ARM Eclipse\OpenOCD\0.10.0-201601101000-dev\scripts\board
Windows OS(64bit), OpenOCD(32bit):
・C:\Program Files (x86)\GNU ARM Eclipse\OpenOCD\0.10.0-201601101000-dev\scripts\board
Windows OS(64bit), OpenOCD(64bit):
・ C:\Program Files\GNU ARM Eclipse\OpenOCD\0.10.0-201601101000-dev\scripts\board

Install OpenOCD add-in to e2studio

  1. Launch e2studio.
  2. Select[Help]menu→[Install new software...]
  3. Input to [Work with] box, and click [Add] button.

  4. A window will pop up and the is placed in the [Location] box automatically. Click add button.

  5. Check [GNU ARM C/C++ OpenOCD Debugging] and push [Next >] button.

  6. Install and restart e2studio.

Configure OpenOCD on e2studio

  1. Select [Window] -> [Preferences].
  2. Select [MCU] - [Global OpenOCD Path].

  3. Check if the directory and executable are filled with OpenOCD installation folder and openocd.ex respectively. If not, please input OpenOCD installation folder and openocd.exe there and click [OK]. Note that the default OpenOCD installation folder should be as follows:
    • Windows OS(32bit), OpenOCD(32bit):
      ・C:\Program Files\GNU ARM Eclipse\OpenOCD\0.10.0-201601101000-dev\bin
    • Windows OS(64bit), OpenOCD(32bit):
      ・C:\Program Files (x86)\GNU ARM Eclipse\OpenOCD\0.10.0-201601101000-dev\bin
    • Windows OS(64bit), OpenOCD(64bit):
      ・ C:\Program Files\GNU ARM Eclipse\OpenOCD\0.10.0-201601101000-dev\bin

The way to debug


If there is no ".gdbinit " file in the project folder. (where the .project file exists.)
Please copy the ".gdbinit" file to your project folder and keep the name of the file called ".gdbinit"


define hook-step
mon cortex_a maskisr on

define hook-stepi
mon cortex_a maskisr on

define hook-next
mon cortex_a maskisr on

define hook-nexti
mon cortex_a maskisr on

define hook-finish
mon cortex_a maskisr on

define hook-stop
mon cortex_a maskisr off

define hook-kill
mon reset init

set mem inaccessible-by-default off
  1. Connect USB cable. Mbed drive will start up.
  2. Copy ".bin" file to Mbed drive.
  3. Reconnect USB cable.
  4. Select project to debug in e2 studio.
  5. Select [Run] menu ->[Debug Configuration].
  6. Select [GDB OpenOCD Debugging] , then right click it and choose "New Configuration".

  7. Select your project in [GDB OpenOCD Debugging]
  8. In the [Main] tab, please write the applicable project name in"Project" and the applicable elf file path in "C/C++ Application". Select "Use Active" in the build configuration.

  9. In the [Debugger] tab, write <-f board/renesas_gr.cfg> in "Config options".
    "arm-none-eabi-gdb" is described in GDB Client Setup "Executable".

  10. In the [Startup] tab, uncheck "Initial Reset" and "Enable ARM semihosting".
    Uncheck "Load executable" in the Load Symbols and Executable part.

  11. The [Source] tab and [Common] tab are left as default.
  12. Click the "Apply" then click the "Debug".
  13. If you want to reset the debug. Select the "Debugger Console" view and enter the following command.
monitor reset halt

All wikipages