|
|
# Oniro Blueprint Flutter : Quick Start Guide
|
|
|
|
|
|
![](https://lh3.googleusercontent.com/O33Dube2dbkYl4Hzjro-nIadJPyNuuUZTVK9qplh2fc3-eHLw39q7p1maRJIRa9ZZTWM368b8GSCIRdkhr86GH2nMnps9g8gcEEEoOVTsJm0hVFKx_dIi05v4mn0gjZFcbfeJDxgNjmjfyiFFXLdamCs8ruP)
|
|
|
|
|
|
[[_TOC_]]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## About
|
|
|
|
|
|
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.</span>
|
|
|
|
|
|
This Reference Guide provides step-by-step instructions, from creating an image, to flashing, booting and starting Flutter application example on SECO’s reference board JUNO SBC-D23
|
|
|
|
|
|
|
|
|
## Getting Started
|
|
|
|
|
|
This section will guide you to building your Oniro Project image targeting a supported reference hardware
|
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
|
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</span>
|
|
|
```
|
|
|
|
|
|
## 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:
|
|
|
|
|
|
1. Initialize the build directory
|
|
|
|
|
|
```
|
|
|
$ TEMPLATECONF=../oniro/flavours/linux . ./oe-core/oe-init-build-env build-oniro-blueprint-flutter
|
|
|
```
|
|
|
|
|
|
2. 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
|
|
|
```
|
|
|
|
|
|
3. Buid 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.
|
|
|
|
|
|
1. Go to the build artifacts directory
|
|
|
|
|
|
```
|
|
|
$ cd tmp/deploy/images/seco-px30-d23</span>
|
|
|
```
|
|
|
|
|
|
2. Prepare USB flash drive of at least 8Gb capacity
|
|
|
|
|
|
|
|
|
3. 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
|
|
|
```
|
|
|
|
|
|
## Hardware Preparation
|
|
|
|
|
|
![](https://docs.google.com/document/d/1j1i6_rMe3OumqHiAWpd61QgBJgr2Nqd5-6o3jrokfW4/edit#heading=h.tyjcwt)
|
|
|
|
|
|
### Equipment
|
|
|
|
|
|
* 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.!
|
|
|
|
|
|
[](https://lh5.googleusercontent.com/IIqgzprOMBGxuMPuZHXgjfbPuMFpTra6wpcgih_YEjJ3nKWTwnAQXz9gxar8QCSqMVfMpn2YnvseqhGYz5N1B8tsZNzKuI6Ez9fZad73GpydACbKDCJY9cgFaPs_Ch4Qz3z1spH4vKJ8jY6woiStLVo50r0g)
|
|
|
|
|
|
## 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.
|
|
|
|
|
|
2. 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)
|
|
|
|
|
|
3. Plug USB flash drive in the one of the USB ports type - A on the board.
|
|
|
|
|
|
4. Connect the display HDMI with the board HDMI connector.
|
|
|
|
|
|
5. Power on the board.
|
|
|
|
|
|
The board will start to boot and the Flutter application example (gallery) will start running in a while.
|
|
|
|
|
|
|
|
|
## Updating firmware
|
|
|
|
|
|
Set up the board for updating:
|
|
|
|
|
|
1. Connect the host machine USB port type-A with Debug UART connector (CN 27) on the board over USB to TTL Serial cable.
|
|
|
|
|
|
2. 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)
|
|
|
|
|
|
3. Power on the board and stop boot process within boot delay (5 seconds), using combination of the keys Ctrl+C
|
|
|
|
|
|
|
|
|
4. in U-Boot shell write command:</span>
|
|
|
|
|
|
```
|
|
|
=> 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.
|
|
|
|
|
|
5. Connect the host machine USB port type-A with USB recovery connector on the board over the programming cable.
|
|
|
|
|
|
6. Power on the board
|
|
|
|
|
|
|
|
|
7. 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
|
|
|
```
|
|
|
|
|
|
8. Enter to your oniroproject deploy directory</span>
|
|
|
|
|
|
|
|
|
```
|
|
|
cd ~/oniroproject/build-oniro-blueprint-flutter/tmp/deploy/images/seco-px30-d23
|
|
|
```
|
|
|
|
|
|
9. Launch script that will update firmware:</span>
|
|
|
|
|
|
```
|
|
|
$ sudo ./flash_d23.sh
|
|
|
```
|
|
|
Once it finished, unplug programming cable from your host machine.
|
|
|
|
|
|
10. Power on the board with USB flash drive plugged in. It will boot with new firmware.
|
|
|
|
|
|
## Performance
|
|
|
|
|
|
Flutter application example : Flutter gallery
|
|
|
|
|
|
embedder: ivi-homescreen
|
|
|
|
|
|
Time required to boot the machine with Flutter application example starting as systemd service.
|
|
|
|
|
|
|
|
|
![](https://lh5.googleusercontent.com/nUV9APD3_dbrxZ9Idz_R8AD1tDK0WF4vNAKHCGqaf_zusMkLUEujxOGx-COkNuc33CS6LQBIl3mvY_3-P5c9ltR-_RFvlyGsXGvy9GHyZEiZJ4I5efn2lbI1V_SmMjNHghJkEqaw7KvMtqRMkitLd07Xw--E)
|
|
|
|
|
|
|
|
|
Performance test executed with perf tool on process of the Flutter application example - interacting with UI. Time of exposition ≈ 3 minutes
|
|
|
|
|
|
![](https://lh5.googleusercontent.com/BgkNH834RHxkZO-MY00cvPR4Vu5O0hn5EoZC2ZNyH_GP0XzwrH2HFor0WldQriNFavdhECxxsPkl2ShzbMOpv_grVGcs-TVMsoBlgGpTjZQZO5zJJd6287xLTgrwaB-grzzivEH4IpeyQpdZDbrgnfHx01GF)</span>
|
|
|
|
|
|
|
|
|
|
|
|
Performance test executed with perf tool on process of the Flutter application example - not interacting with UI. Time of exposition ≈ 3 minutes
|
|
|
|
|
|
|
|
|
![](https://lh4.googleusercontent.com/uZ6zMCXAyJJ_-zTBgdxICmDH2z2ald249eyud0GTL9ZI3_DgpVUyqN49kMhsOdfg5ga-SgzeV4imrTehbsnQnKL2zUvKrm63hBjZaX5usmVqECNsEqVDRu2ECaJuZggqgKYTUfUCci2ZwoTz264fPEdjj4r5)
|
|
|
|
|
|
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.
|
|
|
|
|
|
![](https://lh6.googleusercontent.com/MEao2crmfhxhs8ROxkrZPG5fEawCcRhbRoFGZFX94LKTjSXxSDJsrssW1ss3gXMz3541k4TN_Gzgm9yO_vBnBv1zcZZmEIsz0Wqkiuhxy9SFttD7FtS2YwvJ_ChtqMbyarD05uhc6OvNyRQX1aSbMZ2xqtOf)
|
|
|
|
|
|
|
|
|
The light green bar represents more than 30 FPS.
|
|
|
|
|
|
The second FPS value you can see here below, when it is redrawing.
|
|
|
|
|
|
![](https://lh4.googleusercontent.com/INTKCapbqchmYXoRU6Db3x4K3SB6iTA98k-HjdVqcFPq94Sc4NVFOBueoT-_-9NcphHIFirMXQa9rh3BrRFEGjcTu3VhprHH2psh6JGryT0Nuu5U9b1RNpXQjVWwIT92G5IxZUCcjrty1bgQi54tCUueUmsf)
|
|
|
|