R-Car/Boards/Zephyr-Gen3/2.7

Introduction
This is the Wiki for the Zephyr support for Renesas R-Car Gen3 embedded Cortex-R7. Refer to the R-Car page for information about Renesas’ R-Car SoC family.

This wiki describes the current support of H3ULCB Cortex-R7 on Zephyr from multiple sources. You will also find a step by step tutorial on how to prepare your Ubuntu host then build and test Zephyr OS on an R-Car Gen3 board.

Important: It is important to understand that the Zephyr port has been designed to be executed exclusively on the Cortex-R7 that exists in some of the R-Car Gen3 boards.There is no plan to replace other software such as U-Boot or Linux that are running on the A57/53 cores by Zephyr.

Tutorial
This tutorial is based on the official Zephyr 2.7 guide, commands are appended here to allow you a quick copy and paste. You can also follow the installation steps (1 to 4) directly from the official guide here.

This guide only supports Ubuntu but the official one also describes steps for macOS and windows. This tutorial is based on Zephyr 2.7 version and is using the Iot.bzh’s Renesas 2.7 BSP in order to provide a much more user friendly tutorial.

You can see Zephyr 2.7’s H3ULCB supported features here.

Install dependencies
First, update your host:

Then, install the required dependencies:

Please also make sure that your,   and   tools version are matching required minimal version here.

Get Zephyr and install Python dependencies
In order to clone Zephyr, you should first install the West tool, a swiss-army knife command line tool used by the Zephyr project for the whole process from cloning sources to flashing a board.

Clone the complete Zephyr project, use Iot.bzh’s latest Renesas BSP and update all the project:

Export a Zephyr CMake package:

Then, install the Python dependencies:

Install a toolchain
To build Zephyr OS binaries, you need a cross-toolchain. The Zephyr OS project provides all the binary files you need to build your project.

Then, apply the provided udev rule allowing the flash of most Zephyr boards:

Build demos
Now you are ready to build your first Zephyr project programs, we are going to start with a bunch of basic demos:


 * Button demo is receiving button input (SW3 input button).
 * Blinky demo is making a LED blink (LED4 output LED).
 * Openamp demo is making Zephyr and Linux kernel communicate, thanks to openAMP.

Build a custom app
As an example, we will clone the zephyr-shell demo that we prepared to demonstrate all the currently supported features for R-Car Gen3 H3ULCB on Zephyr.

You can clone your app anywhere on your host, for the clarity of this tutorial, we will store apps near to the Zephyr sources:

Then, you can build it at the same location as demos previously built:

Hardware setup
Now that your binaries are ready, it’s time to prepare your hardware setup allowing you to flash the program you just built.

First, the BSP we are using is currently only supporting the Olimex ARM-USB-OCD-H JTAG probe, we then encourage you to use this probe to flash H3ULCB board.

Depending on the hardware configuration you use, you will not need the same setup:

ULCB: To connect the JTAG probe to a ULCB board, you will need a TET SICA20I2P adapter. You will then be able to connect your probe to the CN3 JTAG connector of the board. Unless your CN10 connector is welded, secondary UART is not available on this board.

ULCB+KF: When connected to a Kingfisher board, you can use JTAG and access secondary UART. You are able to access the secondary UART through KF CN4 connector (be careful, the pinout of the connector depends on your KF revision). See “Know issues” to be sure that your Kingfisher revision let you use the JTAG connector.

If you are able to access the secondary UART (depending on yor hardware setup), you can link your host to it with a USB-TTL adapter with 115200 8N1 settings.

Deploy a Zephyr binary on board
Now that your hardware setup is ready, you are able to flash any of your Zephyr binary:

Tutorial on how to use the zephyr-shell demo can be seen in the Readme here.

The Cortex R7 is then powered and is running your app.