Skip to content

How to debug using the Arduino IDE(Linux)

MikiyaKobayashi edited this page Aug 7, 2025 · 2 revisions

Introduction

  • This page describes how to perform debugging in the Arduino IDE.
  • The following explanation assumes that the sketch you want to debug has already been created and compiled.
    • If this preparation has not been completed, please refer to the Quick Start Guide first.
    • Debugging is performed using Serial communication, so sketches that use Serial communication may not function correctly for debugging.
      • If debugging does not work properly, please either disable the code that performs Serial communication by commenting it out, or change the port used for Serial communication.
        • Serial (RxD0, TxD0) is used for debugging.

Preparation

Operating Environment

  • The operating environment at the time this guide was created is as follows:
    • Arduino IDE: v2.3.6
    • RL78/G23-64p FPB Arduino Library: v2.5.0

Creating debug_custom.json

  • In the Arduino IDE editor, select “...” → “New Tab”.
Make_DebugCustomJson1_en
  • Enter “debug_custom.json” and press OK.
Make_DebugCustomJson2_en

Writing Debug Code in debug_custom.json

  • Enter the following code:
[
  {
    "configId": "renesas:rl78g23_fpb_p64:g23-fpb-64p",
       "debuggerArgs": [
         "-ex",
         "set non-stop on",
         "-ex",
         "shell bash ./startserver_COMPORT.sh R7F100GLG /dev/ttyUSBXX"
       ]
  }
]

Modifying debug_custom.json Code

  • The above debug_custom.json code is a template, so you need to modify it according to your environment.
    • Change ttyUSBXX to the port number of the connected board.

Setting Compiler Options

  • Select “Sketch” → “Optimize for Debugging”.
    • This setting allows for more detailed debugging.
    • However, compared to the default settings, ROM/RAM size will increase.
Select_CompilerOption_en

Upload

  • Select “Upload”.
Writing_en

Start Debugging

  • Select “Start Debugging”.
Debugging_en_edit

Introduction to Debugging Features

  • Debugging Commands:

    • Start Debugging: Start debugging.
    • Reset Device: Reset the device.
    • Continue: Execute the program.
    • Step Over: Execute the current line and stops at the next line.
    • Step Into: Enter the method of the current line and stops.
    • Step Out: Execute until the end of the current function and proceeds to the caller.
    • Restart: Restart the device.
    • Stop: Stop Debugging.
  • Debug Information:

    • Call Stack: Displays the current source location and call stack information.
    • Variables: Displays variables.
      • Local: Displays local variables within the function.
      • Global: Not supported.
      • Static: Not supported.
      • Registers: Not supported.
    • Watch Expressions: Displays variable information by adding variable names.
      • Variables can be added from “Add Expression”.
    • Breakpoints: Displays information about set breakpoints.
      • You can set/remove breakpoints by left-clicking on the left side of the sketch line number.
    • CORTEX PERIPHERALS: Displays peripheral register information.
    • CORTEX REGISTERS: Not supported.
Clone this wiki locally