14. Quick Start for Renesas RISC-V MCU
14.1. Supported Environments
Operating System |
Windows: Windows 10 / Windows 11 Linux: Ubuntu 22.04 |
VS Code version |
1.102.0 (minimum) |
VS Code can be downloaded and installed from this page https://code.visualstudio.com/.
14.2. Installation
Please choose your operating system for operating system dependent installation steps.
For the Renesas RISC-V MCU Family, Renesas Platform provides a straightforward installation wizard to install the CMake, Ninja, Python and the Support Files for RISC-V MCU Family. To set up your environment:
Open VS Code.
Navigate to the “Renesas” tab in VS Code. Then, click “Renesas Quick Install” in the “Environment” view.
Click the “Install” button for the “Renesas RISC-V MCU” device family. The Renesas Platform will now check the dependencies required by the Renesas RISC-V MCU Device Family. The Renesas Platform extension will check the local environment and CMake, Ninja, Python and the Support Files for RISC-V MCU Family, then create an installation plan for them if necessary.
When your selection is ready, click the “Start Installations” button. The download and installation process will start automatically.
Installing the latest RISC-V MCU Smart Configurator (RISC-V MCU SC):
Download and install the latest version of RISC-V MCU Smart Configurator:
After installing the Renesas RISC-V MCU Smart Configurator, you should register the Renesas Smart Configurator installation in VS Code. In order to register the Renesas RISC-V MCU Smart Configurator, perform the following steps:
Click to “Manage Smart Configurators” and check the Renesas RISC-V MCU Smart Configurators. Use the “Register SC” button to register the Smart Configurator manually by selecting the path of the Smart Configurator.
Once it is registered, the Smart Configurator will be visible in the Renesas RISC-V MCU Smart Configurators list.
Installing “LLVM for Renesas RISC-V MCU” toolchain for RISC-V MCU Project Build:
For RISC-V MCU projects, it is recommended to use “LLVM for Renesas RISC-V MCU” toolchain.
Download and install the latest toolchain:
https://llvm-gcc-renesas.com/riscv/riscv-download-toolchains
Note
LLVM for Renesas RISC-V MCU toolchain should be installed to a path that does not contain spaces or special characters.
Add “LLVM for Renesas RISC-V MCU” toolchain to Renesas Platform
Registering LLVM for Renesas RISC-V MCU toolchain in Renesas Platform
Open VS Code
Navigate to the “Renesas” tab in VS Code and click “Manage Build Tools”.
Click the “Register Toolchain” button in the Build Toolchains table header.
In the folder selection dialog, navigate to the root folder of the LLVM for Renesas RISC-V MCU toolchain (not the
binfolder).Select the folder and complete the toolchain registration.
For the Renesas RISC-V MCU Family, Renesas Platform provides a straightforward installation wizard to install the CMake, Ninja, Python and the Support Files for RISC-V MCU Family. To set up your environment:
Open VS Code.
Navigate to the “Renesas” tab in VS Code. Then, click “Renesas Quick Install” in the “Environment” view.
Click the “Install” button for the “Renesas RISC-V MCU” device family. The Renesas Platform will now check the dependencies required by the Renesas RISC-V MCU Device Family. The Renesas Platform extension will check the local environment and CMake, Ninja, Python and the Support Files for RISC-V MCU Family, then create an installation plan for them if necessary.
When your selection is ready, click the “Start Installations” button. The download and installation process will start automatically.
Most of the installations will be performed automatically, some installations may require manual interaction.
During the “Python 3.10” installation, the terminal wizard will appear for manual interaction. The terminal will show the execution plan and ask for confirmation before continuing. During the installation, it requires administrative rights to execute the installation, thus a password could be needed during the installation. Please make sure that the current user has “sudo” permissions and enter the password.
Installing the latest RISC-V MCU Smart Configurator (RISC-V MCU SC):
Download and install the latest version of RISC-V MCU Smart Configurator:
After installing the Renesas RISC-V MCU Smart Configurator, you should register the Renesas Smart Configurator installation in VS Code. In order to register the Renesas RISC-V MCU Smart Configurator, perform the following steps:
Click to “Manage Smart Configurators” and check the Renesas RISC-V MCU Smart Configurators. Use the “Register SC” button to register the Smart Configurator manually by selecting the path of the Smart Configurator.
Once it is registered, the Smart Configurator will be visible in the Renesas RISC-V MCU Smart Configurators list.
Installing “LLVM for Renesas RISC-V MCU” toolchain for RISC-V MCU Project Build:
For RISC-V MCU projects, it is recommended to use “LLVM for Renesas RISC-V MCU” toolchain.
Download and install the latest toolchain:
https://llvm-gcc-renesas.com/riscv/riscv-download-toolchains
Add the bin folder of the toolchain as “RENESAS_RISCV_LLVM_TOOLCHAIN_PATH” to the environment variables.
Guide for Configuring RENESAS_RISCV_LLVM_TOOLCHAIN_PATH environment variable
For adding RENESAS_RISCV_LLVM_TOOLCHAIN_PATH variable to environment variables, open .bashrc file in the home folder of the current user, then add the following line:
export RENESAS_RISCV_LLVM_TOOLCHAIN_PATH="<bin folder of the LLVM for Renesas RISC-V MCU Toolchain>"
For instance:
export RENESAS_RISCV_LLVM_TOOLCHAIN_PATH="/home/renesas/toolchains/llvm_19.1.7.202501_riscv-elf/bin"
14.3. Creating a Project
For RISC-V MCU family projects, Smart Configurator can be accessed via the “Create Project” view in the “Renesas” tab. Please use the following instructions to create and build a project for RISC-V MCU device family.
Navigate to “Renesas” and click [Create Renesas RISC-V MCU project] from the commands.
Then, VSCode will show installed [RISC-V MCU Smart Configurator] list, select a [Smart Configurator] from the list.
Select a [Folder] to create the project.
Enter [File name], configure your board and device type, select [LLVM for RISC-V Toolchain], and then click [Next].
Choose a [project template] then click [Finish] to complete the project creation steps.
Click [Generate Code] and close [RISC-V MCU Smart Configurator] after generation of the project files completes.
14.4. Building the Project
For building a project, which has been created with RISC-V MCU Smart Configurator, please follow the steps below:
In the VS Code Command Palette, run the “CMake: Delete Cache and Reconfigure” command.
In the first time of running, a kit selection is shown. Select “[Unspecified]”.
Then, run the “CMake: Build” command.
TIP: For more information about RISC-V MCU Smart Configurator, click here to visit the RISC-V MCU Smart Configurator page.
14.5. Debugging the Project
A debug session can be started by selecting the created configuration and clicking the [Start Debugging] button in the [Run and Debug] tab, or pressing [F5] from the keyboard.
When VS Code starts the debug session, common debug control flow functions like resume, suspend, step into, step over, step out, restart, terminate debug session can be performed via the debug flow control buttons. Also, the [Debug Console] view will contain useful messages during the debug session.
During the debug session, details about the local variables, device registers, call stack, watched variables, states of the peripherals can be accessed at the primary sidebar of VS Code in the [Run and Debug] tab.
14.6. GDB Server launch parameters for RISC-V devices
Reference for common parameters: All common server parameters, including default settings and options applicable to Renesas device families, are documented in the GDB Server Parameters section. The specific parameters of the RISC-V devices are described below.
14.6.1. Connection Settings
14.6.1.1. J-Link
Option |
Details |
|---|---|
|
Description: Specify the connection type when using J-Link.
Default Value: USB (auto-selected)
Emulator: SEGGERJLINKRISCV
Available Values: USB, IP
Example:
"serverParameters": { "-uSelect=": "USB" }, "serverParameters": { "-uSelect=": "IP" } |
|
Description: Select the USB-connected SEGGERJLINKRISCV to connect to.
Default Value: Auto
Emulator: SEGGERJLINKRISCV
Available Values: Any connected SEGGERJLINKRISCV serial number.
Example:
"serverParameters": { "-uSelect=": "USB=000051000569" } |
|
Description: Specify the file path to the SEGGERJLINKRISCV settings file. The SEGGERJLINKRISCV debugger will store its default settings to this file.
Default Value:
.jlink file stored in the project folder, named after the active configuration.Emulator: SEGGERJLINKRISCV
Available Values: Any valid path to a
.jlink file.Example:
"serverParameters": { "-uJLinkSetting=": "D:/dev_test/workspace/ra6t1/ra6t1 Debug_Flat.jlink" } |
|
Description: Specify the file path to a SEGGERJLINKRISCV script file to run.
Default Value: None
Emulator: SEGGERJLINKRISCV
Available Values: Any valid path to a script file.
Example:
"serverParameters": { "-uJLinkScript=": "D:/dev_test/workspace/riscv/riscv.JLinkScript" } |
|
Description: Specify the log file for SEGGERJLINKRISCV to output logging information. If the log file already exists, its contents will be overwritten. If the option is empty, no logging information is outputted.
Default Value:
JLinkLog.log stored in the project folder.Emulator: SEGGERJLINKRISCV
Available Values: Any valid path to a log file. The path must not contain blank space characters.
Example:
"serverParameters": { "-uJLinkLog=": "D:/dev_test/e2studio/workspace/project/JLinkLog.log" } |
|
Description: Enable Low Power Handling mode. Usually the SEGGERJLINKRISCV DLL handles communication losses as errors. Enabling this mode places the DLL in a less restrictive mode.
Default Value: 0
Emulator: SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uLowPower=": 0 } |
Host Name/IP Address |
Description: Specify the Host Name/IP Address and optional port number for a SEGGERJLINKRISCV remote IP connection.
Default Value: None
Emulator: SEGGERJLINKRISCV
Available Values: Any valid Host Name/IP Address, optionally followed by a port number (e.g.,
127.0.0.1:61234).Example:
"serverParameters": { "-uSelect=": "IP=127.0.0.1:61234" } |
14.6.1.2. Clock
Option |
Details |
|---|---|
|
Description: Select the Main Clock Source.
Default Values: 0
Emulator: E2, E2LITE
Available Values: 0: Internal, 1: External
Example:
"serverParameters": { "-uClockSrc=": 0 } |
|
Description: Specify External frequency in MHz.
Default Values: None
Emulator: E2, E2LITE
Available Values: Between 0.001 to 99.999
Example:
"serverParameters": { "-uInputClock=": 16.00 } |
|
Description: Specify whether or not to allow manipulation of the main clock source by debugger when internal flash memory is rewritten.
Default Values: 1
Emulator: E2, E2LITE
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uAllowClockSourceInternal=": 1 } |
14.6.1.3. Connection with Target Board
Option |
Details |
|---|---|
|
Description: Specify the emulator serial number to be connected.
Default Values: Auto (Emulator will be selected automatically.)
Emulator: E2, E2LITE
Available Values: Emulator information with format: <emulator type>:<serial number>
Example:
"serverParameters": { "-sn=": "e2:_9es002310c" } |
|
Description: Specifies the connection type to be used by the emulator when communicating with the CPU on target system.
Default Values: cJTAG
Emulator: E2, E2LITE
Available Values: 0: Fixed as cJTAG
Example:
"serverParameters": { "-uInteface=": "cJTAG" } |
|
Description: Specifies the speed.
Default Values: auto
Emulator: E2, E2LITE
Available Values: Auto, Enter a value (integer value).
Example:
"serverParameters": { "-uIfSpeed=": "auto" } or "serverParameters": { "-uIfSpeed=": 1000 } |
14.6.1.4. Interface
Option |
Details |
|---|---|
|
Description: Select the target interface type.
Default Value: cJTAG
Emulator: SEGGERJLINKRISCV
Available Values: cJTAG, JTAG
Example:
"serverParameters": { "-uInteface=": "cJTAG" } |
|
Description: Set the JTAG interface speed.
Default Value: Auto
Emulator: SEGGERJLINKRISCV
Available Values: Auto, Adaptive, Enter a value (integer value)
Example:
"serverParameters": { "-uIfSpeed=": "auto" } or "serverParameters": { "-uIfSpeed=": "adaptive" } or "serverParameters": { "-uIfSpeed=": 4000 } |
14.6.1.5. Power
Option |
Details |
|---|---|
|
Description: Specify whether to power the target from the emulator (MAX 200mA) and the power source.
Default Value: 0
Emulator: E2, E2LITE
Available Values: 0, 1, 2
Example:
"serverParameters": { "-w": 1 }Note: Value
2 is only supported for the E2 emulator. |
|
Description: Specify the supply voltage (V) provided to the target board. The value is adjusted to one decimal place (e.g., 3.56 → 3.6).
Default Value: 33 (3.3 V)
Emulator: E2, E2LITE
Available Values: 16–55 (corresponding to 1.6 V–5.5 V)
Example:
"serverParameters": { "-z": 16 } for 1.6 V,"serverParameters": { "-z": 33 } for 3.3 V,"serverParameters": { "-z": 50 } for 5.0 VNote: E2LITE emulator only supports 3.3 V. Only the E2 emulator allows specifying an arbitrary voltage from 1.6 V to 5.5 V.
|
14.6.1.6. Connection
Option |
Details |
|---|---|
|
Description: Specify whether registers should be initialized on connection.
Default Value: 0
Emulator: SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uInitRegisters=": 0 } |
|
Description: Specify whether the CPU should be reset at the start of connection.
Default Value: 1
Emulator: SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uResetBeginConnection=": 0 } |
|
Description: Specify whether the CPU should be reset at the end of connection.
Default Value: 0
Emulator: SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uNoReset=": 1 } |
|
Description: Specify whether an additional reset should be applied before the module is downloaded.
Default Value: 0
Emulator: SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uResetBefDownload=": 1 } |
|
Description: Specify whether an additional reset should be applied after the module is downloaded.
Default Value: 1
Emulator: SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uResetPreRun=": 1 } |
|
Description: Specify the ID code to unlock the device (if one has been set previously to protect connection).
Default Values: FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Emulator: E2, E2LITE, SEGGERJLINKRISCV
Available Values: 32 hex digits
Example:
"serverParameters": { "-uIdCodeBytes=": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" } |
|
Description: Specify if the program uses low power consumption mode or not.
Default Values: 1
Emulator: E2, E2LITE
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uLowPower=": 1 } |
14.6.2. Debug Tool Settings
14.6.2.1. General Debug
Option |
Details |
|---|---|
|
Description: Select whether to reset the program after downloaded.
Default Values: 1
Emulator: E2, E2LITE, SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uresetOnReload=": 1 } |
14.6.2.2. Break
Option |
Details |
|---|---|
|
Description: Specify whether to use software breakpoints to flash memory or not.
Default Values: 0
Emulator: E2, E2LITE, SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uFlashBp=": 0 } |
|
Description: Specify if Instruction Set simulation should be used when setting breakpoints in Flash.
Default Values: 0
Emulator: SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uSimulation=": 0 } |
14.6.2.3. Flash
Option |
Details |
|---|---|
|
Description: Specify the first address of the working RAM area for debugger firmware.
Default Values: None
Emulator: E2, E2LITE
Available Values: Internal RAM area
Example:
"serverParameters": { "-uWorkRamAddress=": "0x0" } |
|
Description: Specify whether or not to erase the flash ROM (program ROM) before a download.
Default Values: 0
Emulator: E2, E2LITE
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-ueraseRomOnDownload=": 0 } |
|
Description: Specify whether or not to erase the data flash ROM before a download.
Default Values: 0
Emulator: E2, E2LITE
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-ueraseDataRomOnDownload=": 0 } |
|
Description: Specify the start address of the Working RAM area.
Default Values: None
Emulator: SEGGERJLINKRISCV
Available Values: Internal RAM area
Example:
"serverParameters": { "-ucfiFlashWorkStart=": "0x0" } |
|
Description: Specify the end address of the Working RAM area.
Default Values: None
Emulator: SEGGERJLINKRISCV
Available Values: Internal RAM area
Example:
"serverParameters": { "-ucfiFlashWorkEnd=": "0x0" } |
14.6.2.4. System
Option |
Details |
|---|---|
|
Description: Specify whether or not the program being debugged rewrites the internal program ROM.
Default Values: 0
Emulator: E2, E2LITE, SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uProgReWriteIRom=": 0 } |
|
Description: Specify whether or not to debug a program that involves rewriting the internal data flash.
Default Values: 0
Emulator: E2, E2LITE
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uProgReWriteDFlash=": 0 } |
|
Description: If this setting is enabled the debugger will cache the contents of flash to increase read speed
Default Values: 0
Emulator: SEGGERJLINKRISCV
Available Values: 0: Yes, 1: No
Example:
"serverParameters": { "-uAllowCachingFlash=": 0 } |
14.6.2.5. Time Measurement
Option |
Details |
|---|---|
|
Description: Specify whether or not display the measurement result of run-break on the status bar. Emulator will measure the time with 100us unit.
Default Values: 1
Emulator: E2, E2LITE, SEGGERJLINKRISCV
Available Values: 0: No, 1: Yes
Example:
"serverParameters": { "-uTimeMeasurementEnable=": 1 } |