Genio 350-EVK Yocto Demo

This demonstration kit is very flexible and can be setup in various configurations, with software support for Yocto or Android. However for the purpose of this Quick Start Guide, a specific configuration is chosen with the following conditions:

  • IoT Yocto software build

  • Both AP1302 ISP Camera Boards and Appletec AR0430 Camera Modules enabled

  • AP1302 ISP Camera Board configured to use the On-Semiconductor AP1302CSSL00SMGA0-DR ISP

  • External HDMI Monitor (not the included TFT LCD Module)

  • Ethernet interface disabled

Additional Items Needed for Quick Start Guide Demo

To support the demo, the following additional items are needed.

  • External Monitor supporting HDMI

  • HDMI Cable

  • Two USB Cables (USB-2.0-A to Micro-B)

  • External PC for loading flash and interacting via command prompt

../_images/Genio_350-EVK_Camera_system_image.jpg

Genio 350-EVK Yocto Demo System Image

Setup PC Environment

Kit Hardware Installation

  • Insert AzureWave Wireless Module and two corresponding jumper wires as shown in AzureWave Wireless Module. The jumper wires connect the module to the on board PCB antennas.

  • Insert Mini-SAS Cable into the corresponding connectors of the Genio 350 EVK mainboard and Camera board.

  • Connector locations can be referred to the marks in the picture as below.

../_images/camera-board-installation.png

Camera Board Installation

Note

You should hear a “click” sound to confirm when the Mini-SAS cables have been correctly inserted into the connectors.

  • Insert the screws into the screw holes on the front of the Genio 350EVK mainboard and screw the plastic standoffs from the back.

../_images/Bracing-frame-installation.png

Standoff assembly

../_images/Bracing-Frame-assembled.jpg

Standoff assembly finished

This requires installation of the Google Android USB driver as outlined in the Setup PC Environment section. If using Windows, open Device Manager and confirm that the driver appears under Android Device \ Android Bootloader Interface.

  • Connect a second USB cable to USB0

This requires installation of the FTDI VCP USB driver as outlined in the Setup PC Environment section. If using Windows, open Device Manager and confirm that the driver appears under Ports (COM & LPT) \ USB Serial Port (COMx), where x is the port assigned by your system.

Further details regarding both USB drivers can be found in the flash trouble-shooting section.

  • Plug AC/DC power adapter into the connector.

../_images/power-adapter-installation.png

Power Adapter Installation

Note

After the EVK power is turned on, confirm that the four LED indicators illuminate.

Connect to the Serial Console

Setup the serial port for viewing debug output and interacting with the kit through a command line interface.

  • Check Device Manager that the USB COM port appears as a UART device under COM Ports

  • Configure your installed serial terminal emulator to use the serial port corresponding to the devices UART0 and operating with the baud rate set to 921600.

../_images/Example-on-Putty.png

Example with Putty

Flash the Software

This guide shows how to “flash” (write) the demo image into the non-volatile flash memory of Genio 350-EVK. The flashing process is performed through the USB0 connection on the Genio 350-EVK. In order to write the on-board storage with Genio Tools, you need to set the IoT SoC in download mode, which allows Genio Tools to transfer a download agent binary to the SRAM of SoC. The download agent then provides a fastboot interface for subsequent image transfer and storage write operations.

Note

Avoid having a long path name by installing to a root folder and shortening the file name if necessary, for example C:\\evk.

  • Open a Windows cmd window (to enter commands)

  • Change working folder to the image directory before running the genio-flash commands:

cd C:\evk
  • View the Flash Image to Board instructions for further details or troubleshooting.

  • Flash the image using the overlay which enables both cameras. which enables Before flashing the board, check if there are certain board features you’d like to enable:

genio-flash --load-dtbo camera-ap1302-ar0430-dual.dtbo
  • Once you see the Looking for a MediaTek SoC ... prompt, start the process to boot the board in flash download mode.

  1. Press and keep pressing the volume up button

  2. Press and release the reset button

  3. Release the volume up button

../_images/sw_rity_get-started_flash_download-mode.gif

Reset the board to enter download mode

Note

On most Genio evaluation boards, the volume up button is connected to the KPCOL0 pin of the chip. If you have trouble finding the correct button, refer to the user guide or schematics of your board.

You should see flashing process started after releasing the volume up button. A typical successful log looks like this:

AIoT Tools: v1.3.3
Yocto Image:
        name:     Rity Demo Image (rity-demo-image)
        distro:   Rity Demo Layer 21.3-dev (rity-demo)
        codename: dunfell
        machine:  i350-evk
        overlays: []

Looking for MediaTek SoC matching USB device 0e8d:0003
Opening COM11 using baudate=115200
Connected to MediaTek MT8365 SoC
Sending bootstrap to address: 0x201000
Jumping to bootstrap at address 0x201000 in AArch64 mode
erasing mmc0
< waiting for any device >
Erasing 'mmc0'                                     (bootloader) request sz: 0x3a6800000, real erase len: 0x0
OKAY [  0.233s]

… (shortened for brevity)

Rebooting                                          OKAY [  0.002s]
Finished. Total time: 0.003s
  • Once the kit boots up with the new flash image, debug log messages can be seen through UART0 in the Putty terminal window.

../_images/Log-Setting.png

View of debug log messages appearing from UART0 upon board bootup

  • Verify the desktop screen appears as shown above in the image Genio 350-EVK Yocto Demo System Image

  • Log into board through UART0 interface.

Once board has fully booted, a login prompt is sent across UART0 similar to that shown below.

i350-evk login:

Type root, then enter, to login.

Camera Demo

The Genio 350-EVK Yocto Demo uses an imaging configuration using the Onsemi AR0430 and the Onsemi AP1302.

Camera Setup

  • Set jumpers on the AP1302 ISP Camera Board

There are six jumpers which must be configured as shown in the above figure of the AP1302 ISP Camera Board and Appletec AR0430 Camera Module.

  • Set camera properties with media-ctl command

Before using the cameras, you must set the resolution and the pixel format to 2316 * 1746, UYUV using the media-ctl command. The command requires several parameters, one of which is the media device of the sensor. The index of the media device may differ depending on the probing order of drivers and the number of devices. You can determine the index of the media device by typing the following command. In this example, the media device is /dev/media1.

ls -l /sys/bus/media/devices/ | grep seninf
lrwxrwxrwx 1 root root 0 Sep 20  2020 media1 -> ../../../devices/platform/soc/15040000.seninf/media1

Type the following commands to set the format of the MIPI-CSI 0 camera:

media-ctl -d /dev/media1 -V "'ap1302.2-003d':2 [fmt:UYVY8_1X16/2316x1746]"
media-ctl -d /dev/media1 -V "'15040000.seninf':4 [fmt:UYVY8_1X16/2316x1746]"
media-ctl -d /dev/media1 -V "'15050000.camsv':1 [fmt:UYVY8_1X16/2316x1746]"

Type the following commands to set the format of the MIPI-CSI 1 camera:

media-ctl -d /dev/media1 -V "'ap1302.3-003d':2 [fmt:UYVY8_1X16/2316x1746]"
media-ctl -d /dev/media1 -V "'15040000.seninf':5 [fmt:UYVY8_1X16/2316x1746]"
media-ctl -d /dev/media1 -V "'15050800.camsv':1 [fmt:UYVY8_1X16/2316x1746]"

Show Camera Images on the Screen

You must determine which device nodes are for the cameras. The video device nodes which point to seninf are the cameras. In this example, the cameras are /dev/video3 and /dev/video4.

ls -l /sys/class/video4linux/ | grep seninf
lrwxrwxrwx 1 root root 0 Sep 20 10:44 v4l-subdev0 -> ../../devices/platform/soc/15040000.seninf/video4linux/v4l-subdev0
lrwxrwxrwx 1 root root 0 Sep 20 10:43 video3 -> ../../devices/platform/soc/15040000.seninf/video4linux/video3
lrwxrwxrwx 1 root root 0 Sep 20 10:43 video4 -> ../../devices/platform/soc/15040000.seninf/video4linux/video4

Using the video device nodes determined above, use the gst-launch-1.0 command to cause the cameras to display live video on the HDMI monitor.

gst-launch-1.0 v4l2src device=/dev/video3 ! video/x-raw,width=2316,height=1746,format=UYVY ! v4l2convert output-io-mode=dmabuf-import ! video/x-raw,width=400,height=300 ! fpsdisplaysink video-sink=waylandsink sync=false &
gst-launch-1.0 v4l2src device=/dev/video4 ! video/x-raw,width=2316,height=1746,format=UYVY ! v4l2convert output-io-mode=dmabuf-import ! video/x-raw,width=400,height=300 ! fpsdisplaysink video-sink=waylandsink sync=false &

You should see both camera images as shown below.

../_images/sw_rity_app-dev_camera_multi-camera-01.gif

Multi-camera images using GStreamer

These commands are started in the background by using the ampersand symbol at the end of the command. To end any of these processes, you can type fg to place the process in the foreground, then CTRL+C to end it. Before proceeding to the next demo, type

fg
CTRL+C

This kills the second camera process.

fg
CTRL+C

This kills the first camera process.

Further details about hardware operation, background theory, or troubleshooting can be found in the BSP User Guide - Camera section.

GPU Demo

On IoT Yocto, there are several OpenGL ES applications that can used to check that the GPU is running and well integrated within the Wayland/Weston system. In this section we introduce two GLES applications: weston-simple-egl and kmscube. They both use the GPU to render content, but they have different approaches to creating their graphic windows.

Display a Rotating Cube

This is a simple GLES program demonstrating how to drive bare metal graphics without a compositor (Wayland), using DRM/KMS, GBM, and EGL for rendering content using OpenGL ES.

After having typed CTRL+C from the above step, you should see only the simple desktop window which shows the date and time in the upper right hand corner. This desktop graphic is being driven by the weston service. In this demo, we will display a rotating cube by running the kmscube command. However kmscube will create its own window on which it renders content. So, before we launch kmscube, we must make sure that no other window system occupies the display. This means stopping the Weston process that drives the desktop.

  • Stop weston service if it already started.

    systemctl stop weston
    
  • Confirm that the desktop disappears and you see only a dark screen on the HDMI monitor.

  • Launch kmscube and confirm that you can see a rotating cube as shown in below figure.

    kmscube
    
../_images/sw_yocto_gpu-kmscube-screenshot.png

Screenshot of kmscube

  • Type CTRL+C to stop displaying the rotating cube.

Display a Rotating Triangle

This is a simple demonstration GLES program that draws a rotating colorized triangle on a transparent Wayland window. This program is not responsible for creating the window, and instead merely renders its content on an existing window which Weston creates. So, before launching it, we must start Weston.

  • Start weston service if it is not started yet.

    systemctl start weston@root.service
    
  • Confirm that the desktop reappears which shows the date and time in the upper right hand corner.

  • Launch weston-simple-egl and confirm that you can see a rotating triangle as shown in below figure.

    weston-simple-egl
    153 frames in 5 seconds: 30.600000 fps
    150 frames in 5 seconds: 30.000000 fps
    ...
    
../_images/sw_yocto_gpu-weston-simple-egl-screenshot.png

Screenshot of weston-simple-egl

Additional Details

You can find source code for weston-simple-egl in the Weston codebase: $BUILD_DIR/tmp/work/aarch64-poky-linux/weston/8.0.0-r0/weston-8.0.0/clients/simple-egl.c or weston github

You can find source code in Weston codebase: $BUILD_DIR/tmp/work/aarch64-poky-linux/kmscube/git-r0/git or mesa gitlab

Further details about the GPU, background theory, or troubleshooting can be found in the BSP User Guide - GPU section.