The best solution for
starting your AI applications.
Provided by Renesas Electronics Corporation
This project is maintained by renesas-rz
Hosted on GitHub Pages — Theme by orderedlist
Tutorial video is available here.
This tutorial is based on RZ/V2L AI SDK version 1.00.
Learn more about the RZ/V series.
Equipment | Details |
---|---|
RZ/V2L Evaluation Board | Evaluation board itself. |
MIPI Camera Module | Google Coral Camera.Note that the CMOS sensor (OV5645) in the camera is no longer available, and should not be
used for mass production. |
MicroUSB to Serial Cable | For serial communication between PC and the board. |
In addition to the RZ/V2L Evaluation Board Kit, please prepare the following equipments.
Note that Serial to MicroUSB Cable and MIPI Camera Module (Google Coral camera) is included in RZ/V2L Evaluation Board Kit.
Equipment | Details |
---|---|
HDMI Monitor | Used to display the graphics |
AC adapter | Power supply to the board |
USB Cable Type-C | Connect AC adapter and the board |
microSD card | Must have over 4GB capacity of blank space. Operating Environment: Transcend USH-I microSD 300S 16GB |
Linux PC | Used for Setup microSD card and RZ/V2L AI SDK Setup. Operating Environment: Ubuntu 20.04 |
SD card reader | Used for setting up microSD card |
PC | Used for the serial communication console Operating Environment : Windows 10 |
USB Hub | Optional. Used only when booting on HDMI monitor. |
USB Keyboard | Optional. Used only when booting on HDMI monitor. |
USB Mouse | Optional. Used only when booting on HDMI monitor. |
Please prepare following software.
Download the RZ/V2L AI SDK from the link below.
Download Link
Check the Release Note included in the package.
This step explains how to extract the RZ/V2L AI SDK zip file.
mkdir -p ai_sdk_work
export WORK=<path to the working directory>/ai_sdk_work
cd ${WORK}
unzip <Path to the file>/r11an0752ej*.zip -d ${WORK}
ls ${WORK}/
ai_sdk_setup board_setup documents references r11an0752ej*.pdf
This step explains how to setup the RZ/V2L AI SDK environment.
Note: Make sure that you have installed Docker on your Linux PC.
cd ${WORK}/ai_sdk_setup
docker build -t rzv2l_ai_sdk_image --build-arg SDK="/opt/poky/3.1.17" --build-arg PRODUCT="V2L" .
mkdir ${WORK}/ai_sdk_setup/data
rzv2l_ai_sdk_container
is a name of docker container, which can be changed by user.
docker run -it --name rzv2l_ai_sdk_container -v $(pwd)/data:/drp-ai_tvm/data rzv2l_ai_sdk_image
The local $(pwd)/data
is mounted to /drp-ai_tvm/data
on the Docker container by the above command option.
For example, you can use this directory to copy files created on the Docker container to your local environment.
libtvm_runtime.so
, which is the necessary file for the board, to host machine.cp /drp-ai_tvm/obj/build_runtime/V2L/libtvm_runtime.so /drp-ai_tvm/data
exit
rzv2l_ai_sdk_container
again, run the following command.docker start -i rzv2l_ai_sdk_container
You have finished the RZ/V2L AI SDK environment setup.
You are ready to build the AI applications!
This step explains how to build AI application.
AI Applications are provided in the GitHub repository.
To access the application, please see AI Applications.
Note:
The link in AI Applications page guides you to the latest GitHub repository.
Please be aware that latest AI Application requires latest AI SDK.
Application directory has the following structure.
Directory | Details |
---|---|
exe |
Execution environment required when running application on the board. |
src |
Application Source Code. |
Other directory | Optional: Extra files that may be required other than above. |
Makefile |
Optional: Configuration to build the application. It may be included in the src directory. |
README.md |
Optional: Documentation of the application. |
In AI Applications, there are two types of applications.
Check the README.md
document provided in application directory and follow the instruction in the chapter called “Application: Build Stage” (or similar) to build the application.
For example, in Object Detection application, follow the instruction in here to generate the following application binary.
object_detection
Note:
Thegit clone
command shown in theREADME.md
will download the latest source code and related files.
To download the files of AI Applications v1.00, please specify the version tag by adding-b v1.00
when you running thegit clone
command as shown below.git clone -b v1.00 https://github.com/renesas-rz/rzv_ai_sdk.git
After you generated the application binary, please proceed to Step 7
Follow the instruction bellow to build the application.
docker start -i rzv2l_ai_sdk_container
Note: This command needs to be called everytime user opened the new terminal.
source /opt/poky/3.1.17/environment-setup-aarch64-poky-linux
cd /drp-ai_tvm/data
git clone https://github.com/Ignitarium-Renesas/RZV2L_AiLibrary
Note: The command above will download the latest source code and related files.
To download the files of AI Applications v1.00, please specify the version tag by adding-b v1.00
when you running thegit clone
command as shown below.git clone -b v1.00 https://github.com/Ignitarium-Renesas/RZV2L_AiLibrary
Note: The file configuration depends on each application. Please check the file configuration in the repository carefully.
cd RZV2L_AiLibrary/01_Head_count/Head_count_cam
make
command.
make
RZV2L_AiLibrary/01_Head_count/
Head_count_cam/exe
.
After you generated the application binary, please proceed to Step 7
This section explains how to setup the RZ/V2L Evaluation Board.
This step is only required for the first time.
*.exe
file extracted to install the serial port driver.Flash_Writer_SCIF_RZV2L_SMARC_
PMIC_DDR4_2GB_1PCS.mot
bl2_bp-smarc-rzv2l_pmic.srec
fip-smarc-rzv2l_pmic.srec
microSD card contains the Linux kernel and root filesystem to boot-up the board.
You can use Linux PC to format the microSD card and expand the kernel and the root filesystem using SD card reader.
Following three files are necessary, which are placed on each partitions on microSD card.
They are in the ${WORK}/board_setup
directory.
File | Description | microSD card partition |
---|---|---|
Image-smarc-rzv2l.bin | Linux kernel image (The boot program) |
Partition 1 |
Image-r9a07g054l2-smarc.dtb | Linux device tree file (The configuration file for booting) |
Partition 1 |
core-image-weston-smarc-rzv2l.tar.bz2 | Linux Root filesystem | Partition 2 |
Follow the instruction below to prepare the microSD card.
Note: Here, we use "/dev/sdb
" as microSD card device name.
Partition Number | Size | Format |
---|---|---|
1 | 500MB (minimum 128MB) | FAT32 |
2 | All remaining | Ext4 |
df
command.Note: Device name of microSD card,
/dev/sdb
, may differ depending on your environment.
df -h
Filesystem Size Used Avail Use % Mounted on
… … … … … …
/dev/sdb1 … … … … …
/dev/sdb2 … … … … …
Note: Change
/dev/sdb
, to your microSD card device name.
sudo mkdir -p /mnt/sd
sudo mount /dev/sdb1 /mnt/sd
sudo cp $WORK/board_setup/Image-smarc-rzv2l.bin /mnt/sd
sudo cp $WORK/board_setup/Image-r9a07g054l2-smarc.dtb /mnt/sd
sync
sudo umount /mnt/sd
Note: Change
/dev/sdb
, to your microSD card device name.
sudo mount /dev/sdb2 /mnt/sd
sudo tar xfj $WORK/board_setup/core-image-weston-smarc-rzv2l.tar.bz2 -C /mnt/sd
sudo cp $WORK/ai_sdk_setup/data/libtvm_runtime.so /mnt/sd/usr/lib64
sync
sudo umount /mnt/sd
sudo eject /dev/sdb
This section explains how to copy the application binary created in Step 6 to the board.
Users are expected to have finished the instructions in Setup the SD card in Step 7.
Insert the microSD card to Linux PC.
Note: Change
/dev/sdb
, to your microSD card device name.
sudo mount /dev/sdb2 /mnt/sd
Note: Directory name
tvm
can be determined by user.
sudo mkdir /mnt/sd/home/root/tvm
Copy the necessary files in execution environment.
Select the appropriate option below based on the application type explained in Building instructions in Step 6.
Option 1. <Application 1>
Check the README.md
document provided in application directory and follow the instruction in the chapter called “Application: Deploy Stage” (or similar) to deploy the application.
For example, in Object Detection application, follow the instruction in here to find files to be copied.
Use the following command to copy the files to root filesystem.
sudo cp $WORK/ai_sdk_setup/data/<Path to target file>/<filename> /mnt/sd/home/root/tvm
Option 2. <Application 2>
Run the following command to copy the whole repository to the root filesystem.
sudo cp $WORK/ai_sdk_setup/data/<Path to repository>/RZV2L_AiLibrary /mnt/sd/home/root/tvm -r
sync
sudo umount /mnt/sd
Note: Change
/dev/sdb
, to your microSD card device name.
sudo eject /dev/sdb
This section explains how to boot the RZ/V2L Evaluation Board Kit.
There are two types of booting options.
You must use this option when booting the board for the first time.
This option uses Windows PC as a serial console.
Please see Appendix: Boot with PC to boot and set the booting configuration.
Users can use this option after they set the booting configuration in Option 1.
This option does not require PC to control the serial console.
The instruction in the application documentation assumes this booting option.
Document of applications on GitHub has the instructions to run the application.
For example, in Object Detection application, follow the instruction in here to run the application.
If you have successfully run the application, you will see following window on HDMI screen.
To power-off the RZ/V2L Evaluation Board Kit, follow the procedures below.
Run the shutdown
command on board console.
shutdown -h now
[xxxxx.xxxxxx] reboot: Power down
Press and hold the power button for 2 seconds.
You have experienced the AI Application development procedures.
Next step is to change the application to create your own AI Application.
You can use the applications listed in AI Applications to expand your ideas!