Oniro Blueprint Flutter : Quick Start Guide
- Oniro Blueprint Flutter : Quick Start Guide
Oniro Project integrates its various components into a representative use-case called a Blueprint. A blueprint shows off the OS capabilities and best practices in building software-based products.
This Reference Guide provides step-by-step instructions, from creating an image, to ﬂashing, booting and starting Flutter application example on SECO’s reference board JUNO SBC-D23.
This section will guide you to building your Oniro Project image targeting a supported reference hardware
Install all the required host packages. Here is an example for Ubuntu.
$ sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm file zstd
Clone Build System Repositories
Install Google git repo tool. For example, on Ubuntu 20.04, you can do this by:
$ sudo add-apt-repository ppa:ostc/ppa $ sudo apt-get update $ sudo apt-get install git-repo
Initialize a repo workspace and clone all required repositories:
$ mkdir oniroproject; cd oniroproject $ git clone https://booting.oniroproject.org/rzr/meta-oniro-blueprint-flutter $ repo sync --no-clone-bundle
Building an Oniro blueprint flutter image:
- Initialize the build directory
$ TEMPLATECONF=../oniro/flavours/linux . ./oe-core/oe-init-build-env build-oniro-blueprint-flutter
- Add the meta-oniro-blueprint-flutter layer to the build:
$ bitbake-layers add-layer ~/oniroproject/meta-flutter $ bitbake-layers add-layer ~/oniroproject/meta-oniro-blueprint-flutter $ bitbake-layers add-layer ~/oniroproject/meta-seco-rockchip
- Build blueprint-flutter-image for target seco-px30-d23
$ DISTRO=oniro-linux-blueprint-flutter MACHINE=seco-px30-d23 bitbake blueprint-flutter-image
USB flash drive preparation:
The board will boot into Oniro distro, using USB flash drive as boot device.
Note: in this case SPL and U-Boot are in the eMMC.
Build artifacts are located in ./tmp/deploy/images/seco-px30-d23/ , relative to the build directory.
- Go to the build artifacts directory
$ cd tmp/deploy/images/seco-px30-d23</span>
Prepare USB flash drive of at least 8Gb capacity
Write the image to USB key with dd command
Note: Be careful identifying the USB key device attached to the host machine, use lsblk command for that!
For example suppose the USB flash drive has device node /dev/sdc assigned to it.
$ sudo dd if=blueprint-flutter-image-seco-px30-d23-usbdisk.wic of=/dev/sdc bs=1M conv=sync
- 1x Juno (SBC-D23) board
- 1x HDMI-HDMI cable
- 1x HDMI display
- 1x power supply 12V-24V
To attach to and communicate via Debug UART (if you want to see the boot console output):
- 1x USB to TTL Serial cable
To flash the firmware to eMMC (in case you have to update the firmware):
- 1x programming cable
For the detailed description of the hardware, see SBC-D23_manual.pdf
Top side of the board.
The connectors used in this guide are highlighted.!
Booting JUNO (SBC-D23) board
You can skip steps 1 and 2, if your do not need to see boot console output.
1. Connect the host machine USB port type-A with Debug UART connector (CN 27) on the board over USB to TTL Serial cable.
Open in the terminal your preferred serial port communication program ( minicom or gtkterm, for example ) and configure the serial port ( port: dev/ttyUSB0, baud rate: 115200, data bits: 8, stop bit: 1, parity: none, flow control: none)
Plug USB flash drive in the one of the USB ports type - A on the board.
Connect the display HDMI with the board HDMI connector.
Power on the board.
The board will start to boot and the Flutter application example (gallery) will start running in a while.
Set up the board for updating:
Connect the host machine USB port type-A with Debug UART connector (CN 27) on the board over USB to TTL Serial cable.
Open in the terminal your preferred serial port communication program ( minicom or gtkterm, for example) and configure the serial port ( port: dev/ttyUSB0, baud rate: 115200, data bits: 8, stop bit: 1, parity: none, flow control: none)
Power on the board and stop boot process within boot delay (5 seconds), using combination of the keys Ctrl+C
in U-Boot shell write command:
=> mmc erase 0x4000 0x2000
This command will erase u-boot from eMMC and in this way the board will enter into Rockusb mode on the next power on.
Connect the host machine USB port type-A with USB recovery connector on the board over the programming cable.
Power on the board
Check if on your host machine the board is appeared as USB device:
lsusb | grep Rockchip
You will see the command output like this :
Bus 001 Device 010: ID 2207:330d Fuzhou Rockchip Electronics Company
- Enter to your oniroproject deploy directory
- Launch script that will update firmware:
$ sudo ./flash_d23.sh
Once it finished, unplug programming cable from your host machine.
- Power on the board with USB flash drive plugged in. It will boot with new firmware.
Flutter application example : Flutter gallery
Time required to boot the machine with Flutter application example starting as systemd service.
Performance test executed with perf tool on process of the Flutter application example - interacting with UI. Time of exposition ≈ 3 minutes
Performance test executed with perf tool on process of the Flutter application example - not interacting with UI. Time of exposition ≈ 3 minutes
This application is not animated one, that‘s why the FPS test could be less indicative. We will try to interact with UI, doing 1 click every 1 second to redraw the frame.
To see the FPS log message we have to stop application service and restart it manually after exporting additional flags:
root@seco-px30-d23:~# systemctl stop homescreen.service root@seco-px30-d23:~# export HOME=/home/root root@seco-px30-d23:~# export XDG_RUNTIME_DIR=/run/user/0 root@seco-px30-d23:~# export FPS_OUTPUT_CONSOLE=1
Optionally, if you would like to see the bar chart overlay, representing FPS add this export:
root@seco-px30-d23:~# export FPS_OUTPUT_OVERLAY=1 root@seco-px30-d23:~# /usr/bin/homescreen --f --a=/usr/share/gallery --t=DMZ-White
We suggest to enable "slow motion" in the application settings to get the app more animated for this test.
The light green bar represents more than 30 FPS.
The second FPS value you can see here below, when it is redrawing.