The RZ/V2L is an exciting AI on the edge device, but it also has strong HMI capabilities! Grouping an AI accelerator, HDMI/MIPI output, and MIPI CSI input together is powerful. Integrating responsive GUIs, even touch screens, along with fast real-time AI is one of the primary goals of the RZ/V2L.
One of the industry leading GUI frameworks is Qt; known for its cross platform, performance oriented, and feature rich framework. Building with Qt requires both license understanding and Qt device support.
Qt has two available license formats: commercial and open source. Additionally, different versions of Qt have different license availabilities and restrictions.
In terms of Qt device support, the RZ/V2L can simply build Qt support into its Linux build. Building a custom Linux BSP for the RZ/V2L is pretty easy, as the process is documented and open source. In summary, this project will step through the process of how to:
- Setup an Ubuntu 20.04 LTS build host for Yocto development
- Configure a Yocto metalayer & build environment for QT support
- Use Yocto to build RZ/V2L images with built-in QT applications.
- Deploy the built images with an open source serial tool
- Run QT applications with mouse, keyboard, and display on the RZ/V2L
If the information present here is not sufficient, check out the RZ/V2L information hub for documentation.
Moving forward, it is assumed the reader has a basic/moderate understanding of python (pip installing), subnet/ip management, and linux commands.
PrerequisitesBefore you begin, make sure you have the linked peripheral hardware the below build host in place.
Build Host
- 64-bit Ubuntu 20.04 LTS
- 100+ GB drive space
Note, since the release of this blog, there was a new release: Verified Linux Package 3.0.4 that will have different packages and dependencies. I recommend trying to build VLP 3.0.4.
We are going to download the packages that correspond to a release called Verified Linux Package 3.0.2. These packages will contain Yocto layers, documentation, and more. We will be working out of a directory called ~/rz_qt5/
moving forward.
The following packages should be downloaded to a working directory, ~/rz_qt5/
:
RZ/V Verified Linux Package V3.0.2
RZ MPU Graphics Library Evaluation Version V1.4
RZ MPU Codec Library Evaluation Version V1.0.1
RZ/V2L DRP-AI Support Package V7.30
VLP 3.0.4 Packages (newer, recommended)RZ/V Verified Linux Package V3.0.4
RZ MPU Graphics Library Evaluation Version V1.1.0
RZ MPU Codec Library Evaluation Version V1.1.0
RZ/V2L DRP-AI Support Package V7.40
As mentioned below, this VLP has a different Meta-RzBoard branch. Make sure to be on rzboard_dunfell_5.10_v3 branch for the Meta-Rzboard layer: https://github.com/Avnet/meta-rzboard/tree/rzboard_dunfell_5.10_v3
Package Notes:The Renesas website provides two version packages, "Evaluation Version" and "Unrestricted Version", for each of the RZ MPU Graphics Library and the RZ MPU Codec Library.The "Evaluation Version" can be downloaded immediately, but has a 2 hour timeout after every board boot.The "Unrestricted Versions" is not available for download until the request for permission on the Renesas website is complete.Repository Dependencies
We will be cloning the following repositories later in the blog
- Flashing Utility
- Meta-RzBoard Layer (older) , Meta-RzBoard Layer for VLP 3.0.4 (newer, notice the branch is different)
Now that prerequisites have been met, lets begin setting up our build host!
Setup the build environmentInstall the following required packages on your Ubuntu build host:
$ sudo apt update
$ sudo apt install -y gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \
xz-utils debianutils iputils-ping libsdl1.2-dev xterm p7zip-full libyaml-dev \
rsync curl locales bash-completion
If Git is not already configured, set Git configuration:
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"
Verify the correct files are present in your working directory rz_qt5
.
$ cd ~/rz_qt5
$ ls -gnGh
total 2.5G
-rw-rw-r-- 1 2.0M Sep 22 12:49 r01an6238ej0110-rzv2l-cm33-multi-os-pkg.zip
-rw-rw-r-- 1 2.4G Sep 22 12:49 r11an0549ej0730-rzv2l-drpai-sp.zip
-rw-rw-r-- 1 36M Sep 22 12:49 RTK0EF0045Z0024AZJ-v3.0.2.zip
-rw-rw-r-- 1 79M Sep 22 12:49 RTK0EF0045Z13001ZJ-v1.4_EN.zip
-rw-rw-r-- 1 1.7M Sep 22 12:49 RTK0EF0045Z15001ZJ-v1.0.1_EN.zip
Download and run a script used to establish our build environment, a directory yocto_rzboard/
$ wget https://raw.githubusercontent.com/Avnet/meta-rzboard/rzboard_dunfell_5.10_v2/tools/create_yocto_rz_src.sh
$ chmod a+x create_yocto_rz_src.sh
$ ./create_yocto_rz_src.sh
$ ls -gnGh yocto_rzboard/
total 32K
drwxr-xr-x 10 4.0K Sep 22 2022 meta-gplv2
drwxrwxr-x 10 4.0K Dec 27 2022 meta-multi-os
drwxr-xr-x 13 4.0K Sep 22 2022 meta-openembedded
drwxr-xr-x 9 4.0K Sep 22 2022 meta-qt5
drwxr-xr-x 12 4.0K Dec 15 2022 meta-renesas
drwxrwxr-x 7 4.0K Dec 19 2022 meta-rz-features
drwxr-xr-x 15 4.0K Sep 22 2022 meta-virtualization
drwxr-xr-x 11 4.0K Sep 22 2022 poky
Download meta-rzboard
$ cd yocto_rzboard
$ git clone https://github.com/Avnet/meta-rzboard.git -b rzboard_dunfell_5.10_v2
So far, all the yocto related sources are in place.
ls ~/rz_qt5/yocto_rzboard
meta-gplv2 meta-multi-os meta-openembedded meta-qt5 meta-renesas meta-rzboard meta-rz-features meta-virtualization poky
Prepare the Build Configuration$ cd ~/rz_qt5/yocto_rzboard/
$ mkdir -p ./build/conf
$ cp meta-rzboard/conf/rzboard/* build/conf/
$ ls build/conf/
bblayers.conf local.conf
Enable built-in QT demos by editing ~/rz_qt5/yocto_rzboard/build/conf/local.conf
to include the QT_DEMO = "1"
line
...
CONF_VERSION = "1"
# NEW ADDITION BELOW
QT_DEMO = "1"
DISTRO_FEATURES_append = " systemd"
...
Build the imageFinally, we are ready to build the qt image! The bitbake command will take several hours without caching.
$ cd ~/rz_qt5/yocto_rzboard/
$ source poky/oe-init-build-env build/
$ bitbake avnet-core-image
As you can see, you can expect a whole lot of command output, and a few benign warnings. Above is an shortened example of the stdout results of a successful build. The particular build above used caching from a previous build.
After the build is successfully completed, the output files will be located in build/tmp/deploy/images/rzboard/ directory.
Deploying to RzBoard V2LBefore deploying to the RZ/V2L, we must setup our hardware for flashing & setup our build host for serial/ethernet deployment.
Hardware ConfigurationFirstly, the RZBoard hardware must be in a SCIF flash configuration.
- Power off the RZBoard
- Place the RZBoard into "SCIF download boot-mode" by setting:
- BOOT2=1 by strapping J19-pin1 J1-pin2
- BOOT1=0 by strapping SW1.1 = ON
- BOOT0=1 by removing the SD card from MicroSD slot
- Connect RZBoard & build host such that they can be on the same subnet. For this demonstration, I connected RZBoard directly to build host via ethernet.
- Connect the RZBoard with the build host via the USB-Serial cable. The fly leads will connect with the 4-pin debug UART header.
Additionally, you will need a flash-writer tool to send the data over the USB-serial cable. To download the flash writer and its related dependencies, run the following:
$ cd ~/rz_qt5
$ git clone https://github.com/Avnet/rzboard_flash_util.git
$ cd rzboard_flash_util
$ pip3 install -r requirements.txt
The flash-writer tool makes a few assumptions (README):
- The images to be flashed are located in the directory of the flash writer
rzboard_flash-util
(with the original names output by bitbake) - /dev/ttyUSB0 is used (check out the flash writer docs for overriding the default serial port)
Before running the flash-writer, you can verify your USB-Serial device is protected. I'm using a Prolific PL2303TA which shows up in lsusb
like:
$ lsusb
...
Bus 001 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
...
Gather the FilesTo deploy your QT build, you will need the following files
Copy the files over to the target directory ~/rz_qt5/rzboard_flash_util
$ cd ~/rz_qt5/yocto_rzboard/build/
$ cp tmp/deploy/images/rzboard/avnet-core-image-rzboard.wic ~/rz_qt5/rzboard_flash_util/
$ cp tmp/deploy/images/rzboard/bl2_bp-rzboard.srec ~/rz_qt5/rzboard_flash_util/
$ cp tmp/deploy/images/rzboard/fip-rzboard.srec ~/rz_qt5/rzboard_flash_util/
$ cp tmp/deploy/images/rzboard/Flash_Writer_SCIF_rzboard.mot ~/rz_qt5/rzboard_flash_util/
Flash the Bootloaders & System ImageLastly, flash the bootloaders and system image using the --full
flash writer parameter. For --full
or--rootfs
, flash_rzboard.py
will try to automatically find the RZBoard IP address, unless you specify a static IP. For this demonstration, a static IP was preferred.
The next steps require power cycling, here is a reminder of where the power button is:
When performing a --full
flash, follow the flash writer output. The general order of operations will be:
0. Power down RZBoard, configure for SCIF download boot mode
1. Give build host 192.168.1.X IP so it can share same subnet with RZBoard. Personally, I ran $ ifconfig eno1 192.168.1.88
, as eno1 was the ethernet port connected directly to the RzBoard.
2. On build host, run $ python flash_rzboard.py --full --static_ip 192.168.1.99
from ~/rz_qt5/rzboard_flash_util
3. Power up RZBoard (Still in SCIF download boot mode)
4. Let the flash_rzboard.py
script flash the flash writer, bl2, and FIP image.
5. Wait for the Power on Board. Make sure boot2 strap is NOT on
flash log
6. Power down the RZBoard, removing the BOOT2 flywire strapping J19-pin1 J1-pin2
7. Power on the RZBoard
8. Wait for the Finished. Total time: X.Ys
log before rebooting the RZBoard
NOTE: Use your preferred parameters/method, but know the RZBoard & build host must be on the same subnet. More information on the flashing utility can be found in the README
$ python flash_rzboard.py --full --static_ip 192.168.1.99
Please power on board. Make sure boot2 is strapped.
Writing Flash Writer application.
Writing bl2 image.
Writing FIP image.
Power on board. Make sure boot2 strap is NOT on.
Waiting for device...
Setting static IP: 192.168.1.99
Putting device into fastboot mode
Device in fastboot mode
error: no response from target
< waiting for udp:192.168.1.99>
fastboot: verbose: Do flash rawimg /home/ljkeller/code/rzv2l/rzboard_flash_util/avnet-core-image-rzboard.wic
fastboot: verbose: target reported max-download-size of 117440512 bytes
Sending sparse 'rawimg' 1/27 (102256 KB) OKAY [ 11.173s]
Writing 'rawimg' OKAY [ 20.617s]
Sending sparse 'rawimg' 2/27 (114684 KB) OKAY [ 12.525s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.997s]
Sending sparse 'rawimg' 3/27 (114684 KB) OKAY [ 12.511s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.965s]
Sending sparse 'rawimg' 4/27 (114684 KB) OKAY [ 12.522s]
Writing 'rawimg' OKAY [ 10.126s]
Sending sparse 'rawimg' 5/27 (114684 KB) OKAY [ 12.532s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.935s]
Sending sparse 'rawimg' 6/27 (114684 KB) OKAY [ 13.524s]
Writing 'rawimg' (bootloader) writing
OKAY [ 10.106s]
Sending sparse 'rawimg' 7/27 (114684 KB) OKAY [ 12.520s]
Writing 'rawimg' OKAY [ 9.933s]
Sending sparse 'rawimg' 8/27 (114684 KB) OKAY [ 12.543s]
Writing 'rawimg' (bootloader) writing
OKAY [ 10.112s]
Sending sparse 'rawimg' 9/27 (114684 KB) OKAY [ 13.457s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.931s]
Sending sparse 'rawimg' 10/27 (114684 KB) OKAY [ 12.519s]
Writing 'rawimg' OKAY [ 9.924s]
Sending sparse 'rawimg' 11/27 (114684 KB) OKAY [ 12.536s]
Writing 'rawimg' (bootloader) writing
OKAY [ 10.106s]
Sending sparse 'rawimg' 12/27 (114684 KB) OKAY [ 13.537s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.940s]
Sending sparse 'rawimg' 13/27 (114684 KB) OKAY [ 12.527s]
Writing 'rawimg' OKAY [ 9.937s]
Sending sparse 'rawimg' 14/27 (114684 KB) OKAY [ 12.523s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.925s]
Sending sparse 'rawimg' 15/27 (114684 KB) OKAY [ 12.609s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.942s]
Sending sparse 'rawimg' 16/27 (114684 KB) OKAY [ 12.524s]
Writing 'rawimg' OKAY [ 15.702s]
Sending sparse 'rawimg' 17/27 (114684 KB) OKAY [ 12.527s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.972s]
Sending sparse 'rawimg' 18/27 (113788 KB) OKAY [ 12.409s]
Writing 'rawimg' (bootloader) writing
OKAY [ 15.134s]
Sending sparse 'rawimg' 19/27 (114684 KB) OKAY [ 12.531s]
Writing 'rawimg' OKAY [ 9.985s]
Sending sparse 'rawimg' 20/27 (114684 KB) OKAY [ 12.529s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.960s]
Sending sparse 'rawimg' 21/27 (113976 KB) OKAY [ 12.466s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.885s]
Sending sparse 'rawimg' 22/27 (114684 KB) OKAY [ 12.532s]
Writing 'rawimg' OKAY [ 9.975s]
Sending sparse 'rawimg' 23/27 (114684 KB) OKAY [ 12.525s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.932s]
Sending sparse 'rawimg' 24/27 (114684 KB) OKAY [ 12.515s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.948s]
Sending sparse 'rawimg' 25/27 (114684 KB) OKAY [ 12.514s]
Writing 'rawimg' OKAY [ 9.932s]
Sending sparse 'rawimg' 26/27 (114684 KB) OKAY [ 12.172s]
Writing 'rawimg' (bootloader) writing
OKAY [ 9.925s]
Sending sparse 'rawimg' 27/27 (104524 KB) OKAY [ 11.985s]
Writing 'rawimg' (bootloader) writing
(bootloader) writing
(bootloader) writing
OKAY [ 73.463s]
Finished. Total time: 693.934s
NOTE: flash_rzboard.py has been updated since this blog post and now has more verbose output than posted above. The new output should be a superset of what you see above.Running Qt Applications
Now that your image is deployed, you can start running Qt applications on the RzBoard V2L. Connect an HDMI display (or optionally use the MIPI-DSI display), keyboard, and mouse to begin running a QT demo!
Here is a reminder image of the RZBoard IO.
If you choose MIPI-DSI display and it’s model# is PH720128T003, you should edit uEnv.txt as follows:
#enable_overlay_disp=mipi
fdt_extra_overlays=rzboard-mipi-ph720128t003.dtbo
- If you choose MIPI-DSI display and it’s model# is PH720128T003, you should edit uEnv.txt as follows:
#enable_overlay_disp=mipi
fdt_extra_overlays=rzboard-mipi-ph720128t003.dtbo
If you choose MIPI-DSI display and it’s model# is PH720128T005, you should edit uEnv.txt as follows:
enable_overlay_disp=mipi
#fdt_extra_overlays=...
- If you choose MIPI-DSI display and it’s model# is PH720128T005, you should edit uEnv.txt as follows:
enable_overlay_disp=mipi
#fdt_extra_overlays=...
MIPI-DSI supports adjustment of the LCD backlight brightness. The backlight brightness has a range from 0 to 9, where 9 is highest brightness, 0 is the lowest. Execute the following instructions on the serial terminal to implement the backlight test
$ echo 7 > /sys/class/backlight/backlight/brightness
QT DemoHere is an example of what you an expect your boot-up screen to look like.
Once the wayland desktop has launched, there are several available Qt demos to launch. These demos are marked by icons in the top-left corner of the desktop.
Here is a collab of some of the same demos, for example:
If you are interested in interacting more with the Qt demo internals, you can open the.ui files with the QtDesigner at the /usr/bin/qt5
path by running /usr/bin/qt5/designer
. However, if you plan to do deeper application development, it would be easier to develop Qt applcations on the build host & deploy them to the RzV2L.
Finally, lets launch the smart-home demo! Do so by clicking this icon:
You should expect the smart-home demo to pop up on your screen. Feel free to click through the UI!
Interested in what qt applications are available on this system image? Check out /usr/bin/qt5
Want to learn more about deployment/boot methods on RZBoard V2L? Check out this project.
Feedback and ContributionsWe welcome feedback, bug reports, and contributions. If you encounter any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request. Our support will be focused on the meta-rzboard repository.
Related BlogsWant more RzBoard V2L content? Checkout out the following projects:
Comments
Please log in or sign up to comment.