4.1. Productivity Tips

4.1.1. Managing Support Files

In most cases, support files are automatically installed to the development environment by Renesas extensions whenever they needed (for instance before starting the debug session if they are not installed yet). Developers also can install, update or uninstall the support files manually by following the instructions below:

4.1.1.1. Using Support Files Manager

  1. Press Ctrl+Shift+P or select [View] → [Command Palette…​] to open Command Palette.

  2. Run the command "Renesas: Open Renesas Support Files Manager".

    IDE 63175 2
  3. Select Devices Families to use → click Install

    IDE 63175 3

4.1.1.2. Changing Support Files Path

By default, support files are install to the paths described below:

Window host:

%AppData%\Code\User\globalStorage\renesaselectronicscorporation.renesas-debug

Linux host:

~/.config/Code/User/globalStorage/renesaselectronicscorporation.renesas-debug

Developers can change the installation location of the support files by following the instructions below:

  1. Open the VSCode Settings user interface

  2. Navigate to Extensions → Renesas menu from the left.

  3. UI will show the "Renesas: Supports Folder Path" to the user.

  4. Type the custom folder path that they want to prefer to use.

    IDE 63175 4

4.1.2. Monitoring MI Commands

In the Debug Console view you can interact directly with GDB. To display the value of an expression, type that expression which can reference variables that are in scope. For example type '2 + 3' or the name of a variable. Arbitrary commands can be sent to GDB by prefixing the input with a '>', for example type '>show version' or '>help'.

IDE 63175 1

4.1.3. Debuggers, Device Families and Emulator/Simulator Types in launch.json

The minimum configuration of the launch configuration is shown below:

launch.json format
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "<type>",
            "request": "launch",
            "name": "<display name of the configuration>",
            "target": {
                "deviceFamily": "<device family (RA, RCAR, RH850, RL78, RX or RZ)>",
                "device": "<device code>",
                "debuggerType": "<debugger type (type of the simulator or emulator)>"
            }
        }
    ]
}

Here is the lookup table for "type", "target.deviceFamily" and "target.debuggerType" values for the developers to use in the launch.json configuration file:

Debugger

type

target.deviceFamily

target.debuggerType

Renesas GDB Hardware Target

renesas-hardware

RA

E2, E2LITE, SEGGERJLINKARM

RH850

E1, E2

RL78

E1, E2, E2LITE, EZ, IECUBE

RX

E1, E2, E2LITE, E20, EZ, SEGGERJLINKRX

RZ

SEGGERJLINKARM

Renesas GDB Simulator Target

renesas-simulator

RL78

SIMULATOR

RX

SIMULATOR

Renesas RCAR Linux Target

renesas-rcar-linux

RCAR

RCAR_PROXY

Renesas RCAR Target

renesas-rcar

RCAR

E2ARM, E2RH850, IE850ARH850, LAUTERBACHT32

RH850

E1, E2, IE850ARH850

4.1.4. How to enable and disable cores

When debugging with multicore, all cores are enabled by default. The user can configure the 'disabledCores' property in the launch.json configuration file’s target to disable the desired cores.

For instance, in the case of the R-Car S4 ARM CA55 device, there are 8 cores ranging from CA55CPU0 to CA55CPU7. To disable cores CA55CPU4 to CA55CPU7, the following configuration should be applied:

launch.json example
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "renesas-rcar",
      "request": "launch",
      "name": "RCAR",
      "program": "${cwd}/Debug/MR_BAREMETAL_CA55.axf",
      "target": {
        "deviceFamily": "RCAR",
        "device": "R8A779F0_CA55",
        "debuggerType": "E2ARM",
        "disabledCores": ["CA55CPU4","CA55CPU5","CA55CPU6","CA55CPU7"]
      }
    }
  ]
}

4.1.5. How to add additional gdb command line arguments

Renesas Debug extension is initializing and passing all required command line arguments to gdb process while starting the debug session. Furthermore, if it’s needed, Renesas Debug Adapters provide injecting additional command line arguments for gdb, which will be passed to the gdb while starting the debug session. Passing the additional gdb command line arguments operation is a straight-forward process, it can be done by defining "gdbArguments" field to the debug configuration in launch.json file.

The following code is show an example how "gdbArguments" field could be defined in launch configuration:

launch.json example
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "renesas-simulator",
      "request": "launch",
      "name": "Sample Renesas Configuration",
      "gdbArguments": ["-rx-force-isa=v3"],
      "target": {
        "deviceFamily": "RX",
        "device": "R5F566TK",
        "debuggerType": "SIMULATOR"
      }
    }
  ]
}

4.1.6. Alternative ways for opening a project in VSCode

There are 2 different alternatives to open a project in VS Code:

  1. Using the [File: Open Folder…​] command in the [Command Palette]

    • Select [View] → [Command Palette…​] menu item.

    • Select [File: Open Folder…​] command (can filter the command list using command name).

      IDE 54291 15
    • In [Open Folder] dialog, browse to project folder and click [Select Folder] button.

      IDE 54291 13
  2. Using command-line

    Folder can be opened using the below command-line option.

    code <folder path>

    E.g. (provide the cmd is opened in the folder that contains CCRX_testprj folder)

    code CCRX_testprj/

    Multiple folder paths can be provided on the command line to open multiple folders at once.

    code CCRX_testprj/ CCRL_testprj/ RA_testprj/

    Project will be opened and display in [Explorer] view.

    image2022 12 19 11 10 37

4.1.7. Setting Python Directory Manually

In debug session, RA, R-Car, RL78, RX and RZ device families require Python 3.10 and an RH850 requires a 32-bit version of Python 2.7. The path of the Python is automatically selected if the path is already included in environment variable PATH.

Note
For Windows, Renesas Debug extension automatically extracts a local copy of the required version of Python into the support files folder if Python is not installed or included in the PATH.

For advanced operations where the Python path doesn’t wanted to be defined in the environment variable PATH, the launch parameter pythonHome could be used for setting the Python directory to be used during the debugging session.

Example for pythonHome usage
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "renesas-simulator",
      "request": "launch",
      "name": "Renesas GDB Simulator Debugging",
      "pythonHome": "C:\\Path\\To\\Python",
      "target": {
        "deviceFamily": "RX",
        "device": "R5F51115",
        "debuggerType": "SIMULATOR"
      }
    }
  ]
}

4.1.8. Tips for using the CMake Tools bar in VSCode

CMake Tools add a variety of controls into the status bar of VSCode, Developers can do the following operations:

  • Manage the build type by clicking the "Build Type" button:

    cmake tools bar build type
  • Select the Active CMake Kit by clicking the "Active Kit" button:

    cmake tools bar kit selection
  • Build the project by clicking the "Build" button:

    cmake tools bar build
  • Start debugging the project by clicking the "Debug" button:

    cmake tools bar start debug

4.2. Advanced Guidelines

4.2.1. Setup environment and debug multicore CA55 with CR52 using renesas-amalgamator

4.2.1.1. Overview

Support debug multicore with CA55 and CR52 for R-Car S4 device on VS code.

This item describes how to connect the S4 board to the PC host, install an extension, import the project, configure file launch.json, run and debug.

4.2.1.2. Connecting S4 board to PC host

We need to connect between board and PC to debug multicore ARM on VSCode as shown in the picture below:

Presentation3

Select the mode for S4 Spider Configuration tool -Renesas as shown below:

Screenshot 114

4.2.1.3. Setup debugger options

  1. Install the Renesas Debug extension to VSCode (please refer to Section 1: Installation).

  2. Import the built CA55 and CR52 projects into VS Code.

  3. In order to debug a project using VS Code and the Renesas Debug extension, a configuration file called launch.json needs to be created.

    1. Select [Run and Debug] view.

      Screenshot 182
    2. Select [Create a launch.json file] link.

      Screenshot 183
    3. Select [Renesas Amalgamator].

      Screenshot 184
    4. A launch.json file will be created inside .vscode folder with some default settings.

    5. In the launch.json file, fill in the following fields.

      launch.json
      {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
          {
            "type": "renesas-amalgamator",
            "request": "launch",
            "name": "<display name of the configuration>",
            "children": [
              {
                "name": "<display name of core>",
                "debugAdapterRuntime": "node",
                "multipleCore": true,
                "interfaceName": "CortexR52",
                "interfaceType": "GDB",
                "arguments": {
                  "type": "renesas-rcar",
                  "request": "launch",
                  "hardwareBreakpoint": true,
                  "program": "<absolute path to project's executable file (.x, .elf,...)>",
                  "target": {
                    "deviceFamily": "RCAR",
                    "device": "<CPU of the device>",
                    "debuggerType": "<type of the debugger>"
                  }
                }
              },
              {
                "name": "<display name of core>",
                "debugAdapterRuntime": "node",
                "multipleCore": true,
                "request": "attach",
                "arguments": {
                  "type": "renesas-rcar",
                  "request": "attach",
                  "hardwareBreakpoint": true,
                  "program": "<absolute path to project's executable file (.x, .elf,...)>",
                  "target": {
                    "deviceFamily": "RCAR",
                    "device": "<CPU of the device>",
                    "debuggerType": "<type of the debugger>",
                  }
                }
              }
            ]
          }
        ]
      }

      Example configuration file launch.json:

    Example: launch.json
    {
      // Use IntelliSense to learn about possible attributes.
      // Hover to view descriptions of existing attributes.
      // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
      "version": "0.2.0",
      "configurations": [
        {
          "type": "renesas-amalgamator",
          "request": "launch",
          "name": "Debug Multiple",
          "children": [
            {
              //ARM Core CA55
              "name": "CA55",
              "debugAdapterRuntime": "node",
              "multipleCore": true,
              "interfaceName": "CortexR52",
              "interfaceType": "GDB",
              "arguments": {
                "type": "renesas-rcar",
                "request": "launch",
                "hardwareBreakpoint": true,
                "program": "${cwd}/CACore_Project/build/release/ca55_loader.elf",
                "target": {
                  "deviceFamily": "RCAR",
                  "device": "R8A779F0",
                  "debuggerType": "E2ARM",
                  "serverParameters": ["-uInteface=", "JTAG", "-w", "0", "-uConnectMode=", "RESET", "-uWorkRamAddress=", "0x0", "-uSyncMode=", "async", "--gdbVersion=", "7.2"]
                },
              }
            },
            {
              //ARM Core CR52
              "name": "CR52",
              "debugAdapterRuntime": "node",
              "multipleCore": true,
              "request": "attach",
              "arguments": {
                "type": "renesas-rcar",
                "request": "attach",
                "hardwareBreakpoint": true,
                "program": "${cwd}/CRCore_Project/build/release/cr52_loader.elf",
                "target": {
                  "deviceFamily": "RCAR",
                  "device": "R8A779F0_CR52",
                  "debuggerType": "E2ARM"
                },
              }
            }
          ]
        }
      ]
    }

4.2.1.4. Start debugging

After setting up debugger options, a debug session can be started by selecting the created configuration and click [Start Debugging] button in [Run and Debug] view, or press [F5].

Screenshot 185

Waiting for the program to launch and debug successfully.

image2022 12 6 10 54 17

Displaying variables, watch expression, call stack…​ are supported in VS Code:

  1. Select [View] → [Open View…​]

image2022 12 6 10 55 33
  1. Select the Views to be displayed on the window.

image2022 12 6 10 56 17

4.2.2. Setup environment and debug project ARM & G4MH using renesas-amalgamator

4.2.2.1. Overview

Support multiple different (ARM/G4MH) cores for R-Car S4 device on VS code.

This item describes how to debug (Project ARM+G4MH).

4.2.2.2. Connecting S4 board to PC host

We need to connect between board and PC to debug ARM and G4MH on VSCode as shown in the picture below:

Presentation2

Select the mode for S4 Spider Configuration tool -Renesas as shown below:

Spider Configuration

4.2.2.3. Setup debugger options

  1. Install the Renesas Debug extension to VSCode (please refer to Section 1: Installation).

  2. Import the built G4MH and CR52 projects into VS Code.

  3. In order to debug a project using VS Code and the Renesas Debug extension, a configuration file called launch.json needs to be created.

    1. Select [Run and Debug] view.

      Screenshot 182 (1)
    2. Select [Create a launch.json file] link.

      Screenshot 183 (1)
    3. Select [Renesas Amalgamator].

      Screenshot 184 (1)
    4. A launch.json file will be created inside .vscode folder with some default settings.

    5. In the launch.json file, fill in the following fields

      launch.json
      {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
          {
            "type": "renesas-amalgamator",
            "request": "launch",
            "name": "<display name of the configuration>",
            "children": [
              {
                //RH850 Core G4MH
                "name": "<display name of core>",
                "debugAdapterRuntime": "node",
                "arguments": {
                  "type": "renesas-rcar",
                  "request": "launch",
                  "program": "<absolute path to project's executable file (.x, .elf,...)>",
                  "target": {
                    "deviceFamily": "RCAR",
                    "device": "<CPU of the device>",
                    "debuggerType": "<type of the debugger>"
                  }
                }
              },
              {
                //Core Arm (CA/CR)
                "name": "<display name of core>",
                "debugAdapterRuntime": "node",
                "arguments": {
                  "type": "renesas-rcar",
                  "request": "launch",
                  "program": "<absolute path to project's executable file (.x, .elf,...)>",
                  "target": {
                    "deviceFamily": "RCAR",
                    "device": "<CPU of the device>",
                    "debuggerType": "<type of the debugger>"
                  }
                }
              }
            ]
          }
        ]
      }

      Example configuration file launch.json:

    Example launch.json
    {
      // Use IntelliSense to learn about possible attributes.
      // Hover to view descriptions of existing attributes.
      // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
      "version": "0.2.0",
      "configurations": [
        {
          "type": "renesas-amalgamator",
          "request": "launch",
          "name": "Debug Multiple",
          "children": [
            {
              //RH850 Core G4MH
              "name": "G4MH",
              "debugAdapterRuntime": "node",
              "arguments": {
                "type": "renesas-rcar",
                "request": "launch",
                "program": "${cwd}/G4MH/HardwareDebug/G4MH_Debug.x",
                "target": {
                  "deviceFamily": "RCAR",
                  "device": "R8A779F0",
                  "debuggerType": "E2RH850",
                  "serverParameters": ["-ulpdType=","15","-uJTagClockFreq=","Default","-setOptJtagLpd=","-uocdID=","0000000000000000000000000000000000000000000000000000000000000000","-ucustomerID=","0000000000000000000000000000000000000000000000000000000000000000","-uneedAuthentication=","0","-uWorkRamAddress=","0x0","-uTraceEnable=","PE0|PE1","-uTraceClock=","PE0|400|PE1|400","-uUseSyncTrace=","1","-uSyncTraceStandard=","0","-uTraceCore=","PE0","--gdbVersion=","7.2"]
                },
              }
            },
            {
              //Core Arm (CA/CR)
              "name": "ARM",
              "debugAdapterRuntime": "node",
              "arguments": {
                "type": "renesas-rcar",
                "request": "launch",
                "program": "${cwd}/BAREMETAL_CR52/Debug/MR_BAREMETAL_CR52.axf",
                "target": {
                    "deviceFamily": "RCAR",
                    "debuggerType": "E2RARM",
                    "device": "R8A779F0_CR52",
                    "serverParameters": ["-uInteface=", "JTAG", "-w", "0", "-uWorkRamAddress=", "0x0", "--gdbVersion=", "7.2"]
                },
              }
            }
          ]
        }
      ]
    }

4.2.2.4. Start debugging

In the select box RUN AND DEBUG (ctrl+shift+D) select "Debug Multiple" option then click [Start Debugging] (F5) button.

Screenshot 34

Waiting for program to launch and debug successfully.

Screenshot 35

4.2.3. Setup environment and debug multi-core ARM device R-Car S4 (CA55: CPU0 to CPU7)

4.2.3.1. Overview

Support debug multicore with CA55 (CPU0 → CPU7) for R-Car S4 device on VS code.

This item describes how to connect the S4 board to the PC host, install an extension, import the project, configure file launch.json, run and debug.

4.2.3.2. Connecting S4 board to PC host

We need to connect between board and PC to debug multicore ARM on VSCode as shown in the picture below:

Presentation3

Select the mode for S4 Spider Configuration tool -Renesas as shown below:

Screenshot 114

4.2.3.3. Setup debugger options

  1. Install the Renesas Debug extension to VSCode. (Refer to section 2.1 Setup VS Code)

  2. Import the built CA55 projects into VS Code.

  3. In order to debug a project using VS Code and the Renesas Debug extension, a configuration file called launch.json needs to be created.

    1. Select [Run and Debug] view.

    2. Select [Create a launch.json file] link.

    3. Select [Renesas Amalgamator].

    4. A launch.json file will be created inside .vscode folder with some default settings.

    5. In the launch.json file, fill in the following fields.

      launch.json
      {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
          {
            "type": "renesas-rcar",
            "request": "launch",
            "name": "<display name of the configuration>",
            "program": "<absolute path to project's executable file (.x, .elf,...)>",
            "target": {
              "debuggerType": "<type of the debugger>",
              "device": "<CPU of the device>",
              "deviceFamily": "RCAR",
            }
          }
        ]
      }

      Example configuration file launch.json:

    Example: launch.json
    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
          {
            "type": "renesas-rcar",
            "request": "launch",
            "name": "RCAR Multicore CA55",
            "program": "${cwd}/Debug/MR_BAREMETAL_CA55.axf",
            "target": {
              "deviceFamily": "RCAR",
              "device": "R8A779F0_CA55",
              "debuggerType": "E2ARM",
              "serverParameters": ["-uInteface=", "JTAG", "-w", "0", "-uConnectMode=", "RESET", "-uWorkRamAddress=", "0x0", "-uSyncMode=", "async", "--gdbVersion=", "7.2"]
            },
          },
        ]
    }

4.2.3.4. Start debugging

After setting up debugger options, a debug session can be started by selecting the created configuration and click [Start Debugging] button in [Run and Debug] view, or press [F5].

IDE 61715 7

Waiting for the program to launch and debug successfully.

IDE 61715 6

4.2.4. Setup environment and debug multi-core G4MH device R-Car S4 or device RH850

4.2.4.1. Overview

Support debug multicore with multi-core G4MH for R-Car S4 device (PE0, PE1) or device RH850 (PE0,PE1,PE2,PE3) on VS code.

This item describes how to connect the S4 board or RH850 board to the PC host, install an extension, import the project, configure file launch.json, run and debug.

4.2.4.2. Connecting S4 board to PC host

We need to connect between board and PC to debug multicore ARM on VSCode.

Select the mode for S4 Spider Configuration tool -Renesas if debug with R-Car S4 device.

4.2.4.3. Setup debugger options

  1. Install the Renesas Debug extension to VSCode. (Refer to section 2.1 Setup VS Code)

  2. Import the built CA55 projects into VS Code.

  3. In order to debug a project using VS Code and the Renesas Debug extension, a configuration file called launch.json needs to be created.

    1. Select [Run and Debug] view.

    2. Select [Create a launch.json file] link.

    3. Select [Renesas Amalgamator].

    4. A launch.json file will be created inside .vscode folder with some default settings.

    5. In the launch.json file, fill in the following fields.

      launch.json
      {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
          {
            "type": "<type>",
            "request": "launch",
            "name": "<display name of the configuration>",
            "program": "<absolute path to project's executable file (.x, .elf,...)>",
            "target": {
              "deviceFamily": "<the device family name Eg.RCAR>",
              "device": "<CPU of the device>",
              "debuggerType": "<debugger type (type of the simulator or emulator)>"
            }
          }
        ]
      }

      Example configuration file launch.json:

      Example: launch.json multi-core G4MH for R-Car S4 device (PE0, PE1)
      {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "configurations": [
          {
            "name": "G4MH",
            "type": "renesas-rcar",
            "request": "launch",
            "hardwareBreakpoint": true,
            "program": "${cwd}/HardwareDebug/G4MH_Debug.x",
            "target": {
              "deviceFamily": "RCAR",
              "device": "R8A779F0",
              "debuggerType": "E2RH850",
              "serverParameters": ["-ulpdType=","15","-uJTagClockFreq=","Default","-setOptJtagLpd=","-uocdID=","0000000000000000000000000000000000000000000000000000000000000000","-ucustomerID=","0000000000000000000000000000000000000000000000000000000000000000","-uneedAuthentication=","0","-uWorkRamAddress=","0x0","-uTraceEnable=","PE0|PE1","-uTraceClock=","PE0|400|PE1|400","-uUseSyncTrace=","1","-uSyncTraceStandard=","0","-uTraceCore=","PE0","--gdbVersion=","7.2"]
            }
          }
        ]
      }
    Example: launch.json multi-core G4MH for device RH850 (PE0,PE1,PE2,PE3)
    {
      // Use IntelliSense to learn about possible attributes.
      // Hover to view descriptions of existing attributes.
      // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
      "configurations": [
        {
          "name": "RH850",
          "type": "renesas-rcar",
          "request": "launch",
          "hardwareBreakpoint": true,
          "program": "${cwd}/HardwareDebug/Project_RH850.x",
          "target": {
            "deviceFamily": "RH850",
            "device": "R7F702Z19A",
            "debuggerType": "E2RH850",
            "serverParameters": ["-ulpdType=", "15", "-uJTagClockFreq=", "Default", "-setOptJtagLpd=", "0", "-w", "1", "-usupplyVoltage=", "0", "-uocdID=", "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", "-usvrParameter=", "|||||||", "-uMultiDeviceSync=", "0", "-usupplyVoltageASP=", "0", "-usetDebugContext=", "0", "-uTraceClock=", "PE0|400|PE1|400|PE2|400|PE3|400", "-uUseSyncTrace=", "0", "-uTraceCore=", "PE0", "--gdbVersion=", "7.2"]
          }
        }
      ]
    }

4.2.5. Create and build G4MH project on R-Car SDK

4.2.5.1. Create G4MH project

From the menu bar select File > New > Renesas C/C++ Project > Renesas R-Car

Screenshot 56

Select R-Car project template "Renesas CC-RH C Executable Project", then click Next button

Screenshot 60

Input the project name then click Next button.

Screenshot 61

In New Renesas CC-RH Executable Project select Create Hardware Debug Configuration "E2 (RH850)", then click Finish button

Screenshot 62

Projects will be created.

Screenshot 63
4.2.5.2. Build project G4MH

Right-click on the project and select "Build Project"

Screenshot 64

Or can click on the "Build" icon on the toolbar.

Screenshot 65

Project after built.

Screenshot 66

4.2.6. Build CVEngine project on R-Car SDK

4.2.6.1. Build CVEngine project on R-Car SDK

From the menu bar select File > Import…​

Screenshot 67

Select Dialog Import "Existing Projects into Workspace", then click Next button

Screenshot 68

Select Dialog Import "Select archive file" > Select Browse…​ > Select the project you want to build in your directory, then click Finish button.

Screenshot 70

Project after imported

Screenshot 71

4.2.6.2. Build project

Right-click on the project and select "Clean Project"

Screenshot 73

Check Toolchain Configuration: From the menu bar select File > Window > Preferences

Screenshot 75

Select Launch Configuration (the name of the project is imported), and Launch Target "V4H DevBoard" on the toolbar.

Screenshot 77

Select "Edit" icon of Launch Target "V4H DevBoard" on the toolbar, then select Target Device "Development board / SoC" and IMP Debug Level "CVe (Shader debugging)", then click Finish button.

Screenshot 79

Right-click on the project and select "Build Project"

Screenshot 76

Project after built

Screenshot 80

4.2.7. How to specify custom GDB server parameters

Renesas VS Code extensions will automatically inject default values required to be passeed to GDB server in debug session. On the other hand, it is possible to override GDB server parameters passed in debug session. For this purpose, "serverParameters" option could be used to pass the custom GDB server parameters.

First, developer need to find the device family/device specific parameters and their default values. It could accessed by starting debug session started with a default configuration like shown below in VS Code. After the start of the debug session, the server parameters shown in the flow of [DEBUG CONSOLE] panel, with line starting with [Raw options] text.

vscode gdbserver parameters

Then, the raw options list needs to be converted to "serverParameters" array. The example for this operation is shown below:

Raw options

-g SIMULATOR -t R5F51101 -uConnectionTimeout= 30 -uPeripheralClkRatio= 1 -uCpuClkFreq= 12 -uRegisterSetting= 0 -uModePin= 0 -uCacheDecode= 1 -n 0 -uWorkRamAddress= 0 -uEmStopInt= 1 -uEmStopInterrupt= 1 -uEmStopFPexp= 1 -l -uCore= SINGLE_CORE|enabled|1|main -uSyncMode= async -uFirstGDB= main --english --gdbVersion= 7.2

"serverParameters" array

["-uConnectionTimeout=", "30", "-uPeripheralClkRatio=", "1", "-uCpuClkFreq=", "12", "-uRegisterSetting=", "0", "-uModePin=", "0", "-uCacheDecode=", "1", "-n", "0", "-uWorkRamAddress=", "0", "-uEmStopInt=", "1", "-uEmStopInterrupt=", "1", "-uEmStopFPexp=", "1", "-l", "-uSyncMode=", "async", "-uFirstGDB=", "main", "--english", "--gdbVersion=", "7.2"]

Note: Please note that -g parameter which is defined as debuggerType, and -t parameter which is defined as device on target parameters of launch configuration; and -uCore= parameter which is injected by Renesas VS Code Extension itself removed from the list and they should not be passed in "serverParameters" array.

At last, the parameter array could be passed via "serverParameters" in "target" configuration.

launch.json example for overriding GDB server parameters
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "renesas-simulator",
      "request": "launch",
      "name": "Renesas GDB Debugging",
      "program": "${command:askProgramPath}",
      "target": {
        "deviceFamily": "RX",
        "device": "R5F51101",
        "debuggerType": "SIMULATOR",
        "serverParameters": ["-uConnectionTimeout=", "30", "-uPeripheralClkRatio=", "1", "-uCpuClkFreq=", "12", "-uRegisterSetting=", "0", "-uModePin=", "0", "-uCacheDecode=", "1", "-n", "0", "-uWorkRamAddress=", "0", "-uEmStopInt=", "1", "-uEmStopInterrupt=", "1", "-uEmStopFPexp=", "1", "-l", "-uSyncMode=", "async", "-uFirstGDB=", "main", "--english", "--gdbVersion=", "7.2"]
      }
    }
  ]
}

It is not required to pass all the parameters in the launch.json file while overriding the parameters. Developer can choose necessary parameters and override their values by passing them with their new values through "serverParameters", parameters that do not require value change does not need to be defined again.

For example, to only change -uConnectionTimeout= parameter the following configration could be used:

launch.json example for overriding GDB server parameters
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "renesas-simulator",
      "request": "launch",
      "name": "Renesas GDB Debugging",
      "program": "${command:askProgramPath}",
      "target": {
        "deviceFamily": "RX",
        "device": "R5F51101",
        "debuggerType": "SIMULATOR",
        "serverParameters": ["-uConnectionTimeout=", "120"]
      }
    }
  ]
}

Alternatively, it is also possible for to use a project created and built in e2 studio to get the GDB server parameters. For this purpose, start a debug session in e2 studio, then, the GDB server parameters will be displayed in [Console] with line starting with [Raw options] text.

IDE 54291 27

4.2.8. Installing CMake and Ninja Build using winget

It is a straightforward process if you want to use winget package manager for CMake and Ninja Build installation. Please run the following commands in Windows Command Prompt:

> winget install Kitware.CMake
> winget install Ninja-build.Ninja
Note

The winget is a command line tool enables users to discover, install, upgrade, remove and configure applications on Windows 10 and Windows 11 computers. This tool is the client interface to the Windows Package Manager service.

For more information, please visit:

4.3. Troubleshooting and Common Issues

4.3.1. Setup environment when using renesas-amalgamator

When debugging with renesas-amalgamator users need to install Node.js. You can download and install Node.js from Node v16.20.0 (LTS).

4.3.2. Debugging failed with message: Don’t know how to attach. Try "help target".

vscode debug error1

If the debug session failed with the error message [Don’t know how to attach. Try "help target".], then open the launch.json file and control the serverParameters array. There shouldn’t be any -uCore= parameter in the "serverParameters" array. Any definition of -uCore= needs to be removed from the "serverParameters" array.