Building Oniro

Before beginning, ensure that git-lfs and repo are installed. It is recommended to have at least 100GB of free disk space available for the full build.

Obtaining the Source Code

To download the source code, execute the following commands in your terminal:

repo init -u -b OpenHarmony-3.2-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'

Fetching Prebuilt Tools

Once you have the source code run the following script to fetch the prebuilt tools:


Setting Up the Build Environment

For building the project, using an isolated Docker container is recommended for a clean and controlled build environment. Run the following command to start the Docker container:

docker run -it -v $(pwd):/home/openharmony

Configuring and Starting the Build

Inside the Docker instance, set the target device for the build (e.g. rk3568):

hb set

Finally, initiate the build process with:

hb build

Flashing the HiHope HH-SCDAYU200 Development Kit

To begin, connect the board to your computer as outlined in the HiHope DAYU200 documentation. Use the USB-C and mini-USB cables included in the kit to connect to the USB 3.0 OTG port and the mini-USB DEBUG port, respectively.

Power on the device by attaching the power cable. Upon successful connection, your serial console should display output similar to:

Bus 002 Device 009: ID 2207:5000 Fuzhou Rockchip Electronics Company "HDC Device"
Bus 001 Device 069: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

Download the flashing tool from Gitee using the following commands:

git clone hihope_iot_docs
mkdir flash && cp -r hihope_iot_docs/HiHope_DAYU200/烧写工具及指南/linux/* flash/
chmod +x flash/ flash/bin/flash.x86_64

To ensure proper device recognition, install the udev rule:

sudo cp flash/etc/udev/rules.d/85-rk3568.rules /etc/udev/rules.d/85-rk3568.rules

Then, either reload udev rules or reboot your system:

udevadm control --reload-rules

After this setup, running flash/ -q should produce the following output, indicating readiness:


To enable programming mode on the device, perform the following steps:

  1. Press nad hold VOL/RECOVERY then RESET buttons.
  2. Release RESET button.

Confirm the mode by running lsusb, which should show:

Bus 001 Device 070: ID 2207:350a Fuzhou Rockchip Electronics Company USB download gadget

$ flash/ -q

Once the above steps are completed successfully, you can proceed to flash the board:

flash/ -a -i ./out/rk3568/packages/phone/images

Additional Tips and Troubleshooting

Connecting to serial console

To read the serial output, ensure the board is correctly connected and powered on. The default baud rate for the HH-SCDAYU200 board is 1500000. You can use minicom or a similar serial terminal:

minicom -D /dev/ttyUSB0 -b 1500000

No HDC available in the system

If the hdc tool is not available on your host system, build it using the ohos-sdk:

./ --product-name ohos-sdk --ccache

Find the hdc tool in out/sdk/ohos-sdk/linux/toolchains. To verify the connection with the device, run:

$ hdc list targets

For sending commands to the device:

hdc shell

To read hilog output:

hdc hilog