26. Advanced Guidelines
26.1. Setup environment and debug multicore CA55 with CR52 using E2 Emulator
26.1.1. Overview
Support debug multicore with CA55 and CR52 for R-Car S4 device using E2 Emulator 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.
26.1.2. Connecting S4 board to PC host
We need to connect between board, the E2 emulator and the PC to debug multicore ARM on VSCode as shown in the picture below:
Select the mode for S4 Spider Configuration tool -Renesas as shown below:
26.1.3. Setup debugger options
Install the Renesas Debug extension to VSCode (please refer to Section 1: Installation).
Import the built CA55 and CR52 projects into VS Code.
In order to debug a project using VS Code and the Renesas Debug extension, a configuration file called launch.json needs to be created.
Select [Run and Debug] view.
Select [Create a launch.json file] link.
Select [Renesas GDB Hardware Target].
A launch.json file will be created inside .vscode folder with some default settings.
For debugging multicore with multiple architectures on a single device, the configuration can be combined into a single launch entry.
In the launch.json file, fill in the following fields.
launch.json
1{ 2 // Use IntelliSense to learn about possible attributes. 3 // Hover to view descriptions of existing attributes. 4 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "type": "renesas-hardware", 9 "request": "launch", 10 "name": "<display name of the launch configuration>", 11 "isMasterCore": true, 12 "cortexArm": "CortexA55", 13 "hardwareBreakpoint": true, 14 "program": "<absolute path to project's executable file (.x, .elf,...)>", 15 "target": { 16 "deviceFamily": "RCAR", 17 "device": "<CPU of the device>", 18 "debuggerType": "<type of the debugger>" 19 } 20 }, 21 { 22 "type": "renesas-hardware", 23 "request": "attach", 24 "name": "<display name of the attach configuration>", 25 "isSecondaryCore": true, 26 "cortexArm": "CortexR52", 27 "hardwareBreakpoint": true, 28 "program": "<absolute path to project's executable file (.x, .elf,...)>", 29 "target": { 30 "deviceFamily": "RCAR", 31 "device": "<CPU of the device>", 32 "debuggerType": "<type of the debugger>" 33 } 34 } 35 ], 36 "compounds": [ 37 { 38 "name": "<display name of the compound configuration>", 39 "configurations": [ 40 "<display name of the launch configuration>", 41 "<display name of the attach configuration>" 42 ] 43 } 44 ] 45}
Example configuration file launch.json:
Example: launch.json
1{ 2 // Use IntelliSense to learn about possible attributes. 3 // Hover to view descriptions of existing attributes. 4 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "type": "renesas-hardware", 9 "request": "launch", 10 "name": "CA55", 11 "isMasterCore": true, 12 "cortexArm": "CortexA55", 13 "hardwareBreakpoint": true, 14 "program": "${cwd}/CACore_Project/build/release/ca55_loader.elf", 15 "target": { 16 "deviceFamily": "RCAR", 17 "device": "R8A779F0", 18 "debuggerType": "E2ARM", 19 "disabledCores": [ 20 "CA55CPU1", 21 "CA55CPU2", 22 "CA55CPU3", 23 "CA55CPU4", 24 "CA55CPU5", 25 "CA55CPU6", 26 "CA55CPU7" 27 ], 28 "serverParameters": { 29 "-uInteface=": "JTAG", 30 "-w": "0", 31 "-uFlashBp=": "0", 32 "-uNoReset=": "1" 33 } 34 } 35 }, 36 { 37 "type": "renesas-hardware", 38 "request": "attach", 39 "name": "CR52", 40 "isSecondaryCore": true, 41 "cortexArm": "CortexR52", 42 "hardwareBreakpoint": true, 43 "program": "${cwd}/CACore_Project/build/release/cr52_loader.elf", 44 "target": { 45 "deviceFamily": "RCAR", 46 "disabledCores": [ 47 "CA55CPU0", 48 "CA55CPU1", 49 "CA55CPU2", 50 "CA55CPU3", 51 "CA55CPU4", 52 "CA55CPU5", 53 "CA55CPU6", 54 "CA55CPU7" 55 ], 56 "device": "R8A779F0", 57 "debuggerType": "E2ARM", 58 "serverParameters": { 59 "-uInteface=": "JTAG", 60 "-w": "0", 61 "-uFlashBp=": "0", 62 "-uNoReset=": "1" 63 } 64 } 65 } 66 ], 67 "compounds": [ 68 { 69 "name": "Compound", 70 "configurations": [ 71 "CA55", 72 "CR52" 73 ] 74 } 75 ] 76 }
26.1.4. Start debugging
In the select box RUN AND DEBUG (ctrl+shift+D) select “Compound” option then click [Start Debugging] (F5) button.
Waiting for the program to launch and debug successfully.
Displaying variables, watch expression, call stack… are supported in VS Code:
Select [View] -> [Open View…]
Select the Views to be displayed on the window.
26.2. Setup environment and debug project ARM & G4MH using E2 Emulator
26.2.1. Overview
Support multiple different (ARM/G4MH) cores for R-Car S4 device using E2 Emulator on VS code.
This item describes how to debug (Project ARM+G4MH).
26.2.2. Connecting S4 board to PC host
We need to connect between board, the E2 emulator and the PC to debug ARM and G4MH on VSCode as shown in the picture below:
Select the mode for S4 Spider Configuration tool -Renesas as shown below:
26.2.3. Setup debugger options
Install the Renesas Debug extension to VSCode (please refer to Section 1: Installation).
Import the built G4MH and CR52 projects into VS Code.
In order to debug a project using VS Code and the Renesas Debug extension, a configuration file called launch.json needs to be created.
Select [Run and Debug] view.
Select [Create a launch.json file] link.
Select [Renesas GDB Hardware Target].
A launch.json file will be created inside .vscode folder with some default settings.
In the launch.json file, fill in the following fields
launch.json
1{ 2 // Use IntelliSense to learn about possible attributes. 3 // Hover to view descriptions of existing attributes. 4 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "type": "renesas-hardware", 9 "request": "launch", 10 "name": "<display name of the G4MH configuration>", 11 "hardwareBreakpoint": true, 12 "program": "<absolute path to project's executable file (.x, .elf,...)>", 13 "target": { 14 "deviceFamily": "RCAR", 15 "device": "<CPU of the device>", 16 "debuggerType": "<type of the debugger>" 17 } 18 }, 19 { 20 "type": "renesas-hardware", 21 "request": "launch", 22 "name": "<display name of the Arm configuration>", 23 "cortexArm": "<Specifies the interface port for ADM Cortex cores, such as CortexA55 or CortexR52>", 24 "hardwareBreakpoint": true, 25 "program": "<absolute path to project's executable file (.x, .elf,...)>", 26 "target": { 27 "deviceFamily": "RCAR", 28 "device": "<CPU of the device>", 29 "debuggerType": "<type of the debugger>" 30 } 31 } 32 ] 33}
Example configuration file launch.json:
Example: launch.json
1{ 2 // Use IntelliSense to learn about possible attributes. 3 // Hover to view descriptions of existing attributes. 4 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "type": "renesas-hardware", 9 "request": "launch", 10 "name": "G4MH", 11 "hardwareBreakpoint": true, 12 "program": "${cwd}/G4MH/HardwareDebug/G4MH.x", 13 "target": { 14 "deviceFamily": "RCAR", 15 "device": "R8A779F0", 16 "debuggerType": "E2RH850", 17 "serverParameters": { 18 "-ulpdType=": "15", 19 "-uJTagClockFreq=": "Default", 20 "-uocdID=": "0000000000000000000000000000000000000000000000000000000000000000", 21 "-ucustomerID=": "0000000000000000000000000000000000000000000000000000000000000000", 22 "-uWorkRamAddress=": "0x0", 23 "-uTraceEnable=": "PE0|PE1", 24 "-uTraceClock=": "PE0|400|PE1|400", 25 "-uUseSyncTrace=": "1", 26 "-uSyncTraceStandard=": "0", 27 "-uTraceCore=": "PE0" 28 } 29 } 30 }, 31 { 32 "type": "renesas-hardware", 33 "request": "launch", 34 "name": "ARM", 35 "cortexArm": "CortexR52", 36 "hardwareBreakpoint": true, 37 "program": "${cwd}/CR52/build/release/MR_BAREMETAL_CR52.elf", 38 "target": { 39 "deviceFamily": "RCAR", 40 "device": "R8A779F0_CR52", 41 "debuggerType": "E2ARM", 42 "serverParameters": { 43 "-uInteface=": "JTAG", 44 "-w": "0", 45 "-uFlashBp=": "0", 46 "-uWorkRamAddress=": "0x0", 47 "-uNoReset=": "1" 48 } 49 } 50 } 51 ] 52}
26.2.4. Start debugging
In the select box RUN AND DEBUG (ctrl+shift+D) select “G4MH” option then click [Start Debugging] (F5) button.
Waiting for program to launch and debug “G4MH” successfully, then select “ARM” option in the select box RUN AND DEBUG (ctrl+shift+D) and click [Start Debugging] (F5) button.
Waiting for program to launch and debug successfully.
26.3. Setup environment and debug multi-core ARM device R-Car S4 (CA55: CPU0 to CPU7) using E2 Emulator
26.3.1. Overview
Support debug multicore with CA55 (CPU0 -> CPU7) for R-Car S4 device using E2 Emulator 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.
26.3.2. Connecting S4 board to PC host
We need to connect between board, the E2 emulator and the PC to debug multicore ARM on VSCode as shown in the picture below:
Select the mode for S4 Spider Configuration tool -Renesas as shown below:
26.3.3. Setup debugger options
Install the Renesas Debug extension to VSCode. (please refer to Section 1: Installation).
Import the built CA55 projects into VS Code.
In order to debug a project using VS Code and the Renesas Debug extension, a configuration file called launch.json needs to be created.
Select [Run and Debug] view.
Select [Create a launch.json file] link.
Select [Renesas GDB Hardware Target].
A launch.json file will be created inside .vscode folder with some default settings.
In the launch.json file, fill in the following fields.
launch.json
1{ 2 // Use IntelliSense to learn about possible attributes. 3 // Hover to view descriptions of existing attributes. 4 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "type": "renesas-hardware", 9 "request": "launch", 10 "name": "<display name of the configuration>", 11 "program": "<absolute path to project's executable file (.x, .elf,...)>", 12 "target": { 13 "debuggerType": "<type of the debugger>", 14 "device": "<CPU of the device>", 15 "deviceFamily": "RCAR", 16 } 17 } 18 ] 19}
Example configuration file launch.json:
Example: launch.json
1{ 2 // Use IntelliSense to learn about possible attributes. 3 // Hover to view descriptions of existing attributes. 4 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "type": "renesas-hardware", 9 "request": "launch", 10 "name": "RCAR Multicore CA55", 11 "program": "${cwd}/Debug/MR_BAREMETAL_CA55.axf", 12 "target": { 13 "deviceFamily": "RCAR", 14 "device": "R8A779F0_CA55", 15 "debuggerType": "E2ARM", 16 "serverParameters": { 17 "-uInteface=": "JTAG", 18 "-w": "0", 19 "-uFlashBp=": "0", 20 "-uWorkRamAddress=": "0x0", 21 "-uNoReset=": "1" 22 } 23 }, 24 }, 25 ] 26}
26.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].
Waiting for the program to launch and debug successfully.
26.4. Setup environment and debug multi-core G4MH device R-Car S4 or device RH850 using E2 Emulator
26.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.
26.4.2. Connecting S4 board to PC host
We need to connect between board, the E2 emulator and the PC to debug multicore ARM on VSCode.
Select the mode for S4 Spider Configuration tool -Renesas if debug with R-Car S4 device.
26.4.3. Setup debugger options
Install the Renesas Debug extension to VSCode. (please refer to Section 1: Installation).
Import the built G4MH/RH850 projects into VS Code.
In order to debug a project using VS Code and the Renesas Debug extension, a configuration file called launch.json needs to be created.
Select [Run and Debug] view.
Select [Create a launch.json file] link.
Select [Renesas GDB Hardware Target].
A launch.json file will be created inside .vscode folder with some default settings.
In the launch.json file, fill in the following fields.
Format of launch.json:
1{ 2 // Use IntelliSense to learn about possible attributes. 3 // Hover to view descriptions of existing attributes. 4 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "type": "<type>", 9 "request": "launch", 10 "name": "<display name of the configuration>", 11 "program": "<absolute path to project's executable file (.x, .elf,...)>", 12 "target": { 13 "deviceFamily": "<the device family name Eg.RCAR>", 14 "device": "<CPU of the device>", 15 "debuggerType": "<debugger type (type of the simulator or emulator)>" 16 } 17 } 18 ] 19}
Sample configurations for launch.json file:
Sample: launch.json for 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-hardware", "request": "launch", "hardwareBreakpoint": true, "program": "${cwd}/HardwareDebug/G4MH_Debug.x", "target": { "deviceFamily": "RCAR", "device": "R8A779F0", "debuggerType": "E2RH850", "serverParameters": { "-ulpdType=": "15", "-uJTagClockFreq=": "Default", "-uocdID=": "0000000000000000000000000000000000000000000000000000000000000000", "-ucustomerID=": "0000000000000000000000000000000000000000000000000000000000000000", "-uneedAuthentication=": "0", "-uWorkRamAddress=": "0x0", "-uTraceEnable=": "PE0|PE1", "-uTraceClock=": "PE0|400|PE1|400", "-uUseSyncTrace=": "1", "-uSyncTraceStandard=": "0", "-uTraceCore=": "PE0" } } } ] }
Sample: launch.json for multi-core 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-hardware", "request": "launch", "hardwareBreakpoint": true, "program": "${cwd}/HardwareDebug/Project_RH850.x", "target": { "deviceFamily": "RCAR", "device": "R7F702Z19A", "debuggerType": "E2RH850", "serverParameters": { "-ulpdType=": "15", "-setOptJtagLpd=": "0", "-w": "1", "-usupplyVoltage=": "0", "-uocdID=": "0000000000000000000000000000000000000000000000000000000000000000" } } } ] }
26.5. Create and build G4MH project on R-Car SDK
26.5.1. Create G4MH Project
From the menu bar select [File] > [New] > [Renesas C/C++ Project] > [Renesas R-Car]
Select R-Car project template [Renesas CC-RH C Executable Project], then click [Next] button
Input the project name then click [Next] button.
In New Renesas CC-RH Executable Project select Create Hardware Debug Configuration [E2 (RH850)], then click [Finish] button
Projects will be created.
26.5.2. Build Project G4MH
Right-click on the project and select [Build Project]
Or can click on the [Build ]icon on the toolbar.
Project after built.
26.6. Build CVEngine project on R-Car SDK
26.6.1. Create Project
From the menu bar select File > Import…
Select Dialog Import “Existing Projects into Workspace”, then click Next button
Select Dialog Import “Select archive file” > Select Browse… > Select the project you want to build in your directory, then click Finish button.
Project after imported
26.6.2. Build Project
Right-click on the project and select “Clean Project”
Check Toolchain Configuration: From the menu bar select File > Window > Preferences
Select Launch Configuration (the name of the project is imported), and Launch Target “V4H DevBoard” on the toolbar.
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.
Right-click on the project and select “Build Project”
Project after built
26.7. Setup environment and debug ARM device R-Car S4 using Lauterbach TRACE32
26.7.1. Overview
Supports debugging the R-Car S4 device using Lauterbach TRACE32 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.
26.7.2. Connecting S4 board to PC host
We need to connect between the board, the Lauterbach emulator, and the PC to debug ARM on VSCode as shown in the picture below:
In the S4 Spider Configuration tool, select the Renesas mode as shown below:
26.7.3. Setup debugger options
Install the Renesas Debug extension to VSCode (please refer to Section 1: Installation).
Import the built CA55 projects into VS Code.
In order to debug a project using VS Code and the Renesas Debug extension, a configuration file called launch.json needs to be created.
Select [Run and Debug] view.
Select [Create a launch.json file] link.
Select [Renesas GDB Hardware Target].
A launch.json file will be created inside .vscode folder with some default settings.
In the launch.json file, fill in the following fields.
launch.json
1{ 2 // Use IntelliSense to learn about possible attributes. 3 // Hover to view descriptions of existing attributes. 4 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "type": "renesas-hardware", 9 "request": "launch", 10 "name": "<Display name of the Arm configuration>", 11 "cortexArm": "<Specifies the interface port for ARM Cortex cores, such as CortexA55 or CortexR52>", 12 "hardwareBreakpoint": true, 13 "program": "<Absolute path to project's executable file (.x, .elf,...)>", 14 "target": { 15 "deviceFamily": "RCAR", 16 "device": "<CPU of the device>", 17 "debuggerType": "<Type of the debugger>", 18 "serverParameters": { 19 "-uShowGUI=": "1" 20 } 21 }, 22 "debugTrace32": { 23 "folder": "<Path to the folder of the TRACE32 install location>", 24 "scriptFile": [ 25 { 26 "core": "<The name of the core to load>", 27 "script": "<Path to the PRACTICE script file for the debug script>", 28 // Set to 'true' if this core is used as the boot core. 29 "isBootCore": true 30 } 31 ] 32 } 33 } 34 ] 35}
Example configuration file launch.json:
Example: launch.json
1{ 2 // Use IntelliSense to learn about possible attributes. 3 // Hover to view descriptions of existing attributes. 4 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 "version": "0.2.0", 6 "configurations": [ 7 { 8 "type": "renesas-hardware", 9 "request": "launch", 10 "name": "LAUTERBACH_CA55", 11 "cortexArm": "CortexA55", 12 "hardwareBreakpoint": true, 13 "program": "${cwd}/main.elf", 14 "target": { 15 "deviceFamily": "RCAR", 16 "device": "R8A779F0", 17 "debuggerType": "LAUTERBACHT32", 18 "disabledCores": [ 19 "A55-2_(Cluster_1.2)", 20 "A55-3_(Cluster_1.3)", 21 "A55-4_(Cluster_2.0)", 22 "A55-5_(Cluster_2.1)", 23 "A55-6_(Cluster_2.2)", 24 "A55-7_(Cluster_2.3)", 25 "R52_(Cluster_3)" 26 ], 27 "serverParameters": { 28 "-uShowGUI=": "1" 29 } 30 }, 31 "debugTrace32": { 32 "folder": "C:/TRACE32/files", 33 "scriptFile": [ 34 { 35 "core": "A55-0_(Cluster_1.0)", 36 "script": "${cwd}/CA55_0_script.cmm", 37 "isBootCore": true 38 }, 39 { 40 "core": "A55-1_(Cluster_1.1)", 41 "script": "${cwd}/CA55_1_script.cmm", 42 "isBootCore": false 43 } 44 ] 45 } 46 } 47 ] 48}
Example configuration file CA55_0_script.cmm:
Note
Both
CA55_0_script.cmmandCA55_1_script.cmmuse identical content. Copy the example below for each core and save the files in the project root directory so that the${cwd}paths in launch.json resolve correctly.Example: CA55_0_script.cmm / CA55_1_script.cmm
1SYStem.RESet 2SYStem.CPU RCARS4 3CORE.ASSIGN 1. ; Attach to core 0 only 4SYStem.CONFIG.DEBUGPORTTYPE JTAG 5SYStem.JtagClock 20.MHz 6SYStem.Option.ResBreak off 7SYStem.Option.TRST on 8SYStem.Option.EnReset on 9SYStem.Option WaitReset 200ms 10SYStem.MemAccess DAP 11SYStem.Mode Attach 12Break.direct 13Mode.Hll
26.7.4. Start debugging
After setting up debugger options, a debug session can be started by selecting the created configuration and clicking [Start Debugging] button in [Run and Debug] view, or pressing [F5].
Waiting for the program to launch and debug successfully.
Note
TRACE32 operates participating cores in a synchronized run-control mode. Therefore, Continue/Resume and Pause/Suspend operations performed on one core may automatically affect other participating cores in the same debug session. Independent execution control of individual cores is not supported.
LAUTERBACHT32 does not support simultaneous debugging of mixed Cortex architectures in a single session. For example, debugging CortexA55 and CortexR52 cores at the same time is not supported. Each debug session must target cores of the same Cortex architecture.