# Target setup for RZA1H

This document describes the setup required to build and run CGI Studio applications with RZA1H device package on Renesas RZA1H hardware.  
  
It is explained how to run the RZA1H target demo application part of the release package, how to setup the build environment and how to build own applications for RZA1H target (Renesas RZA1H).

# RZA1H BSP

# Prerequisites

#### Hardware: Renesas RZA1H

CGI Studio has been tested on Renesas RZA1H custom board.

#### CMake

In order to build Candera, the Meta build system CMake needs to be installed with at least version mentioned <span style="color: rgb(230, 126, 35);">[here](https://doc316en.candera.eu/books/build-system-setup/page/prerequisites)</span>.

CMake is able to create the cross compilation make files that can be used with various compilers.

#### Ninja

To allow cross compilation with makefiles, MinGW 4.2.1 (Ninja 1.9.0) was used for this release.

#### GCC Toolchain

The build tool chain is not part of the delivery. gcc-arm-none-eabi-9-2020-q2-update-win32.exe and the according Renesas BSP and RGL driver have to be obtained from customer and installed according to their installation guide.

CGI Studio was tested with gcc-arm-none-eabi-9-2020-q2-update-win32.exe

Debugging was done over J-LINK 10.1 in Renesas e² studio.

#### Renesas RGA Library

The graphics driver is not part of this release. CGI Studio was integrated and tested with the libraries received from customer

# Running the CGI CourierSampleAppLight Demo Application on RZA1H

#### Download the Application

To download and debug the application you need Renesas e<sup>2</sup> Studio, a sample project and a J-Link probe.

Include "cgi\_studio\_courier\_apps\\src\\CourierSampleAppLight\\AppPlatform\\Target\_FreeRTOS\_ARM\\SampleAppConnector.h" in the main.c og the sample application. Declare extern function SwapRequiredBuffers "extern void SwapRequiredBuffers();"  
Initialize the App with SampleAppInit();  
In a loop call SampleAppRun(); and SwapRequiredBuffers();

Start SEGGER J-Flash lite and download the asset file to the address defined in linker\_settings.ld as \_\_graphics\_data\_start.

Compile the project and use Renesas e<sup>2</sup> Studio to download and debug the binary to the target.

# Building Own Application for the RZA1H

#### Generate Makefiles with CMake

For general information about CGI Studio Build System and CMake properties available to configure Candera applications refer to <span style="color: rgb(230, 126, 35);">[CGI Studio Build System](https://doc316en.candera.eu/books/build-system-setup)</span>.

To configure and generate makefiles for compiling the CGI CourierSampleAppLight, follow below steps:

<div class="contents" id="bkmrk-point-cmake-to-sourc"><div class="contents"><div class="textblock">1. Point CMake to source directory 
    - Folder containing top-level "CMakeLists.txt", e.g. ```
         /cmake/Apps/Courier/CourierSampleAppLight
        
        ```
2. Point CMake to build directory 
    - May not exist, create folder with CMake if necessary
    - Root directory for generated makefiles / solutions
    - Root directory for build artifacts
3. Configure 
    - Specify MinGW Makefiles (Ninja) as generator for the project
    - Specify tool-chain file for cross-compiling
4. Select the toolchain-file from the delivery (adapt for your toolchain installation and application specific needs) ```
     /cgi_studio_devices/src/RZA1H/ToolchainFiles/GCC-toolchain-RZA1H_Native2D.txt
    
    ```
5. Adapt the CMake settings if necessary, e.g.: 
    - CMAKE\_BUILD\_TYPE-&gt; Debug or Release
    - Press Configure
6. Press Generate

</div></div></div>#### Building Application

After generating your cmake files, in Command Prompt simply navigate to the specified build directory and type "mingw32-make" ("ninja") to start the build.

The output executable file can be found in your build directory.

Open this file with the Green Hills MULTI IDE debugger and load it to RAM as described in the previous chapter.

# Various Device Specific Content

# RZA1HBitmapConverter

#### Description

This document provides a complete list of bitmap formats supported by the RZA1H Target.

These formats define how pixel color and alpha data are stored in memory. The RZA1H extended bitmap formats support **alpha-only**, **RGB**, **ARGB**, and **JPEG** **compressed images** formats to address different memory, performance, and visual quality requirements.

These bitmap converters are supported only on the target. Windows simulation uses the default bitmap converter.

##### Alpha Only Formats

Alpha formats (A1/A4/A8) are primarily used for masking and blending operations.

<table border="1" id="bkmrk-serial-no.%C2%A0-format-d" style="border-collapse: collapse; width: 76.6667%; height: 119.188px;"><colgroup><col style="width: 13.2196%;"></col><col style="width: 41.2052%;"></col><col style="width: 45.5776%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">**Serial No.** </td><td class="align-center" style="height: 29.7969px;">**Format**</td><td class="align-center" style="height: 29.7969px;">**Description** </td></tr><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">1

</td><td style="height: 29.7969px;"><div><div>RZA1HExtendedBitmapFormatA1</div></div></td><td style="height: 29.7969px;">1-bit alpha mask.</td></tr><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">2</td><td style="height: 29.7969px;"><div><div>RZA1HExtendedBitmapFormatA4</div></div></td><td style="height: 29.7969px;">4-bit alpha channel.</td></tr><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">3</td><td style="height: 29.7969px;"><div><div>RZA1HExtendedBitmapFormatA8</div></div></td><td style="height: 29.7969px;">8-bit alpha channel.</td></tr></tbody></table>

##### RGB/ARGB Formats

RGB/ARGB formats balance memory usage and visual quality depending on color depth and transparency needs.

<table border="1" id="bkmrk-serial-no.%C2%A0-format-d-1" style="border-collapse: collapse; width: 76.9048%; height: 208.578px;"><colgroup><col style="width: 13.3333%;"></col><col style="width: 46.5049%;"></col><col style="width: 40.1618%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">**Serial No.** </td><td class="align-center" style="height: 29.7969px;">**Format**</td><td class="align-center" style="height: 29.7969px;">**Description** </td></tr><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">1

</td><td style="height: 29.7969px;"><div><div>RZA1HExtendedBitmapFormatRGB565</div></div></td><td style="height: 29.7969px;">16-bit RGB (5-6-5), no alpha.</td></tr><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">2</td><td style="height: 29.7969px;"><div><div>RZA1HExtendedBitmapFormatARGB8888</div></div></td><td style="height: 29.7969px;">32-bit ARGB, 8 bits per channel.</td></tr><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">3</td><td style="height: 29.7969px;"><div><div><div><div>RZA1HExtendedBitmapFormatARGB1555</div></div></div></div></td><td style="height: 29.7969px;">16-bit ARGB with 1-bit alpha.</td></tr><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">4</td><td style="height: 29.7969px;"><div><div><div><div><div><div>RZA1HExtendedBitmapFormatARGB4444</div></div></div></div></div></div></td><td style="height: 29.7969px;">16-bit ARGB, 4 bits per channel.</td></tr><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">5</td><td style="height: 29.7969px;"><div><div><div><div><div><div>RZA1HExtendedBitmapFormatXRGB8888</div></div></div></div></div></div></td><td style="height: 29.7969px;">32-bit RGB, unused alpha byte.</td></tr><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">6</td><td style="height: 29.7969px;"><div><div><div><div><div><div>RZA1HExtendedBitmapFormatR8G8B8A8</div></div></div></div></div></div></td><td style="height: 29.7969px;">32-bit RGBA, 8 bits per channel.</td></tr></tbody></table>

##### JPEG Compressed Image Format

JPEG format enables efficient storage of large images with reduced memory requirements.

<table border="1" id="bkmrk-serial-no.%C2%A0-format-d-2" style="border-collapse: collapse; width: 77.8571%; height: 59.5938px;"><colgroup><col style="width: 13.1703%;"></col><col style="width: 46.0799%;"></col><col style="width: 40.7522%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">**Serial No.** </td><td class="align-center" style="height: 29.7969px;">**Format**</td><td class="align-center" style="height: 29.7969px;">**Description**</td></tr><tr style="height: 29.7969px;"><td class="align-center" style="height: 29.7969px;">1</td><td class="align-left" style="height: 29.7969px;"><div><div>RZA1HExtendedBitmapFormatJpg</div></div></td><td class="align-left" style="height: 29.7969px;">JPEG compressed image format.</td></tr></tbody></table>