1.1. Operating Environment
Operating System |
For Windows: Windows 10 / Windows 11 For Linux: Ubuntu 22.04 |
VS Code version |
1.86.0 (minimum) |
VS Code can be downloaded and installed from this page https://code.visualstudio.com/.
1.2. Installing Prerequisites for the Development Environment
Before installing the extensions, it is required to follow the instructions below to install and configure the dependencies. It is recommended to avoid using space character in the installation paths as they may interpreted as delimiters by CMake and the other build tools.
1.2.1. Prerequisites for Building
In order to build a Renesas project in VS Code, the following prerequisites setup steps need to be performed. If building Renesas projects in VS Code is not desired this setup can be skipped (the installation of Renesas Build Utilities (renesas-build-utilities) extension is not required in this case).
Windows:
To utilize the build extension on Windows, it’s necessary to install "CMake" and "Ninja Build" for project build operations. You can install "CMake" and "Ninja Build" by downloading their latest installers.
Step 1: Install the latest CMake for Windows.
-
Download the latest version of CMake for Windows.
-
Install CMake for Windows.
Important!: You must add the CMake folders to the "Path" enviroment variable. The Windows Installer of CMake has an option to modify the system’s environment variables and add the CMake folders to the "Path" variable. Please select this option during installation. If you are not using the installer or this option is not selected during installation, please use the following notes to manually add CMake’s bin folder to the Path variable.
Step 2: Install the latest Ninja Build for Windows.
-
Download the latest version of Ninja for Windows.
-
Extract the downloaded zip file (ninja-win.zip) and place the
ninja.exe
into a folder. (e.g.: C:\Tools\ninja-build\ninja.exe).
Step 3: Configure the Path environment variable.
-
Use Windows Search to find and open "Edit the system environment variables"
-
In the "Advanced" tab, click on the "Environment Variables…" button to open the "Environment Variables" dialog.
-
Select to edit the "Path".
-
Add CMake’s bin folder to the "Path" environment variable, then perform the following steps:
-
Add the path of CMake’s bin folder if it is not defined during the CMake installation. (e.g. C:\Program Files\CMake\bin).
-
Add the path of the ninja.exe folder. (e.g. C:\Tools\ninja-build).
Note
|
Alternatively, CMake and Ninja Build can be installed with Windows Package Manager Command Line Tool |
Then, install the latest toolchains for a target device family and add the path of the desired toolchain’s bin folder to the "Path" environment variable.
Device Family |
Recommended Toolchain |
RA |
|
RH850 |
|
RL78 |
|
RX |
|
RZ |
Additional recommendations for RA:
For RA projects, it is recommended to install RA Smart Configurator and one of the prefered toolchain.
Step 1: Install the latest RA Smart Configurator (RASC):
Download and install the latest version of RA Smart Configurator:
Step 2: Install one of the prefered toolchains for RA Project Build. It is recommended to use either "Arm GNU Toolchain" or "LLVM Embedded Toolchain for Arm".
For installing "Arm GNU Toolchain":
-
Download and install the latest toolchain:
-
Add the bin folder of the toolchain as "ARM_GCC_TOOLCHAIN_PATH" to the environment variables.
Note
|
Configuring ARM_GCC_TOOLCHAIN_PATH environment variable:
|
For installing "LLVM Embedded Toolchain for Arm":
-
Download and install the latest toolchain:
-
Add the bin folder of the toolchain as "ARM_LLVM_TOOLCHAIN_PATH" to the environment variables.
Note
|
Configuring ARM_LLVM_TOOLCHAIN_PATH environment variable:
|
Additional recommendations for RX:
For building CC-RX projects, add "BIN_RX", "INC_RX" and "TMP_RX" variables to the environment variables with the following values:
-
BIN_RX:
bin
folder of the CC-RX toolchain (e.g.: C:\Toolchains\CCRX\3_6_0\bin). -
INC_RX:
include
folder of the CC-RX toolchain (e.g.: C:\Toolchains\CCRX\3_6_0\include). -
TMP_RX: root folder of the CC-RX toolchain (e.g.: C:\Toolchains\CCRX\3_6_0).
Ubuntu:
Step 1: Install CMake and Ninja Build:
-
First, run
sudo apt update
command to refresh the package lists.$ sudo apt update
-
Then, install CMake and Ninja Build packages by using
sudo apt install cmake ninja-build
command.$ sudo apt install cmake ninja-build
Step 2: Check CMake version:
-
You can verify the current installed version of CMake by running
cmake --version
command as shown below:$ cmake --version
Step 3: Check Ninja Build version:
-
You can also verify the current installed version of Ninja Build by running
ninja --version
command as shown below:$ ninja --version
1.2.2. Prerequisites for Debugging
In order to start a debugging session in a Renesas project in VS Code, the following prerequisites setup steps need to be performed. If debugging Renesas projects in VS Code is not desired this setup can be skipped (the installation of the Renesas Debug extension is not required in this case).
Device Family |
Required Python Verson |
RA, R-Car, RL78, RX, RZ |
Python 3.10 (64 bit version) |
RH850 |
Python 2.7.18 (32 bit version) |
Windows:
In the 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. 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
. Developers can choose to manage and install the Python requirements manually by following this guideline, or they can skip the Python installation and leave the operation to the Renesas Debug extension.
For debugging in device families RA, R-Car, RL78, RX and RZ:
-
For debugging in device families RA, R-Car, RL78, RX and RZ, install 64-bit version of the Python 3.10.
-
Add the path of the folder the Python 3.10 into the "Path" environment variable.
-
Use Window search to find and open "Edit the system environment variables"
-
In "Advanced" tab, click on "Environment Variables…" button to open "Environment Variables" dialog
-
Select to edit "Path"
-
Add the path of Python 3.10 folder
-
Click OK to close the dialog
-
For debugging in device family RH850:
-
For debugging in device family RH850, install a 32-bit version of the Python 2.7.18 (Important!: 32-bit Python is needed even in 64-bit OS environment).
-
Add the path of the Python 2.7.18 installation into the "Path" environment variable.
-
Use Window search to find and open "Edit the system environment variables"
-
In "Advanced" tab, click on "Environment Variables…" button to open "Environment Variables" dialog
-
Select to edit "Path"
-
Add the path of Python folder
-
Click OK to close the dialog
-
Ubuntu:
-
If you are running 64-bit Ubuntu version, enable running 32-bit app in 64-bit Ubuntu by executing the following command:
$ sudo dpkg --add-architecture i386
-
Then, update the package list and install the following packages:
$ sudo apt update $ sudo apt install libusb-1.0-0-dev libc6:i386 libncurses5:i386 libstdc++6:i386
For debugging in device families RA, R-Car, RL78, RX and RZ:
-
Install Python 3.10 libraries for debugging in device families RA, R-Car, RL78, RX and RZ. Use the following command to install the required libraries:
$ sudo apt install python3.10-dev
For debugging in device family RH850:
-
Install Python 2.7 libraries for debugging in RH850 device family. Use the following command to install the required libraries:
$ sudo apt install python2.7-dev
Additional Drivers for Debugging Connection:
Both for Windows and Linux operating systems, you may need to download and install additional USB drivers for establishing a proper connection with the emulators and devices.
Using Renesas Emulators:
If you are using Renesas Emulators, please install the latest drivers before starting your debug session. Use the following link to download the drivers suitable for your operating system and device:
For other Renesas emulators, please check for any recommended drivers:
Using SEGGER J-Link connection:
Install the latest SEGGER J-Link drivers before starting your debug session. Use the following link to download the J-Link drivers suitable for your operating system:
1.3. Installing the Renesas Extensions
Renesas provides 2 extensions to help building and debugging Renesas C/C++ project in VS Code, these are Renesas Build Utilities (renesas-build-utilities) and Renesas Debug (renesas-debug) extensions. Latest versions of these extensions can be installed from extension marketplace directly. Developers can follow the steps below to install the latest versions of the extensions from extension marketplace.
-
Open "VS Code" and navigate to "Extensions" section.
-
Search for "Renesas"
-
Click to "Install" button for both extensions "Renesas Build Utilities" and Renesas Debug".