8. Quick Start for Renesas RH850

8.1. Supported Environments

Operating System

Windows: Windows 10 / Windows 11

VS Code version

1.96.0 (minimum)

VS Code can be downloaded and installed from this page https://code.visualstudio.com/.

8.2. Installation

To utilise the Renesas VS Code extensions 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.

  1. Download the latest version of CMake for Windows.

    https://cmake.org/download/

  2. Install CMake for Windows.

    Important

    You must add the CMake folders to the “Path” environment 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.

  1. Download the latest version of Ninja for Windows.

    https://github.com/ninja-build/ninja/releases/

  2. 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.

  1. Open the System Environment Variables configuration, and add the following variables:

    1. Add the path of CMake’s bin folder if it is not defined during the CMake installation.

      (e.g. C:\Program Files\CMake\bin).

    2. Add the path of the ninja.exe folder. (e.g. C:\Tools\ninja-build).

    Guide for managing System Environment Variables
    1. Use Windows Search to find and open “Edit the system environment variables

      _images/installation-env-variables1.png
    2. In the “Advanced” tab, click on the “Environment Variables…” button to open the “Environment Variables” dialog.

    3. Select to edit the “Path”.

      _images/installation-env-variables2.png
    4. Add CMake’s bin folder to the “Path” environment variable, then perform the following steps:

    5. Add the path of CMake’s bin folder if it is not defined during the CMake installation. (e.g. C:\Program Files\CMake\bin).

    6. Add the path of the ninja.exe folder. (e.g. C:\Tools\ninja-build).

Alternatively, Windows Prerequisites can be installed with Windows Package Manager Command Line Tool winget (*). Please run the following commands in Windows Command Prompt:

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

(*) 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. It is a straightforward process if you want to use winget package manager for CMake and Ninja Build installation. For more information about winget, please visit: https://learn.microsoft.com/en-us/windows/package-manager/winget/

Installing Python 2.7 (32-bit):

  1. Install the 32-bit version of the Python 2.7.18 (Important!: 32-bit Python is needed even in 64-bit OS environment).

    https://www.python.org/downloads/release/python-2718/

  2. Add the path of the Python 2.7.18 installation into the “Path” environment variable.

    Guide to add Python 2.7 folder into the “Path” environment variable
    1. Use Window search to find and open “Edit the system environment variables

      _images/installation-env-variables1.png
    2. In “Advanced” tab, click on “Environment Variables…” button to open “Environment Variables” dialog

    3. Select to edit “Path

      _images/installation-env-variables2.png
    4. Add the path of Python folder

      _images/installation-env-variables3-python2.png
    5. Click OK to close the dialog

Installing the latest RH850 Smart Configurator (RH850 SC):

For RH850 projects, it is recommended to download and install the latest RH850 Smart Configurator.

Installing “CC-RH” toolchains for RH850 Project Build:

For RH850 projects, it is recommended to install “CC-RH” toolchain. For installing “CC-RH”:

  1. Download and install the latest toolchain:

    https://www.renesas.com/us/en/software-tool/c-compiler-package-rh850-family

  2. Add the bin folder of the toolchain as “RENESAS_CCRH_TOOLCHAIN_PATH” to the environment variables.

    Configuring RENESAS_CCRH_TOOLCHAIN_PATH environment variable
    1. Use Window search to find and open “Edit the system environment variables

      _images/installation-env-variables1.png
    2. In “Advanced” tab, click on “Environment Variables…” button to open “Environment Variables” dialog

    3. Click to “New…”.

      _images/installation-env-sys-variables-nv.png
    4. Enter the “RENESAS_CCRH_TOOLCHAIN_PATH” to the Variable name field, and click to “Browse Directory…” to select the bin folder of the toolchain. Then click “OK”.

      _images/installation-env-variables-ccrh.png

Installing Emulator Drivers

You may need to download and install additional USB drivers for establishing a proper connection with the emulators and devices. 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:

8.3. Creating a Project

Smart Configurator can be accessed from the VS Code command palette to create a project for the RH850 device family.

  1. Open [Command Palette] and select [Renesas: Create RH850 Project with Smart Configurator] from the commands.

    _images/rh850sc_rh850_cp_create_project.png
  2. VSCode will show installed [RH850 Smart Configurator] list, select a [Smart Configurator] from the list.

    _images/rh850sc_rh850_cp_create_select_rh850sc.png

    Note

    If an RH850 Smart Configurator is not detected automatically, the message “No RH850 Smart Configurator installation found!” will be displayed in VSCode:

    _images/rh850sc_rh850_cp_no_rxsc_found.png

    Please click “Browse RH850 SC”, then select the location of the RH850 Smart Configurator binary (“SmartConfigurator.exe” for Windows). When a select file dialog window appears, the extension will automatically store the location of the RH850 Smart Configurator for the next use.

  3. Select a [Folder] to create the project.

    _images/rh850sc_rh850_cp_create_select_folder.png
  4. Enter [File name], configure your board and device type, select [Renesas CCRH850 Toolchain], and then click [Next].

    _images/rh850sc_rh850_create_project1.png
  5. Configure [RTOS] then click [Finish] to complete the project creation steps.

    _images/rh850sc_rh850_create_project2.png
  6. Click [Generate Code] and close [RH850 Smart Configurator] after generation of the project files completes.

    _images/rh850sc_rh850_create_project3.png

8.4. Building the Project

For building a project, which has been created with RH850 Smart Configurator, please follow the steps below:

  1. In the VS Code Command Palette, run the “CMake: Delete Cache and Reconfigure” command.

    _images/delete_cache_and_reconfigure.png
  2. In the first time of running, a kit selection is shown. Select “[Unspecified]”.

    _images/select_unspecified_kit.png
  3. In VS Code, click [Terminal] ⇒ [Run Build Task] from the menu. Alternatively, press ctrl+shift+B to quickly open the Build task.

    _images/sc_run_build_task.png
  4. Select [Build Project] from the commands.

    _images/rasc_build_project4.png

TIP: For more information about RH850 Smart Configurator, click here to visit the RH850 Smart Configurator page.

8.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.

_images/vscode-debug-launch-generic-1.png

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.

_images/vscode-debug-launch-generic-2.png

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.

_images/vscode-debug-launch-generic-3.png