5. OpenHarmony User Manual

5.1. List of supported devices

Main Control Board Model Board Specifications (Memory)
RK3568 ROC-RK3568-PC 2G/4G (8G not currently supported)
RK3568 AIOJ-RK3568 2G/4G (8G currently not supported)

5.2. source code compilation

5.2.1. Environment setup

Necessary conditions: X86 Ubuntu18.04 operating system (for other systems, please solve the problem of dependency packages by yourself)

sudo apt-get update && sudo apt-get install binutils git git-lfs gnupg flex
bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib
libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache
libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3.8
python3-pip ruby

5.2.2. Source code download

Get Firefly Patch Script

mkdir openharmony
cd openharmony
wget https://gitlab.com/firefly-linux/openharmony/oh_sdk_preinit/-/raw/master/sdk_init.sh
chmod a+x sdk_init.sh

Choose to compile the development board

cd openharmony

# Find supported devices
./sdk_init.sh -l

# Select the specified development board
./sdk_init.sh -b <BOARD_NAME>

Get the official source code of OpenHarmony

cd openharmony
repo init --repo-url=https://gitlab.com/firefly-linux/git-repo -u https://gitee.com/openharmony/manifest.git -b refs/tags/$(cat .tag_release) --no-clone-bundle
.repo/repo/repo sync -c --no-tags
.repo/repo/repo forall -c 'git lfs pull'

Get Firefly patch source code

cd openharmony
./sdk_init.sh -p

After that, update the code to run the following command:

cd openharmony
./sdk_init.sh -p

5.2.3. Get docker

Get the Docker image

docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:1.0.0

Enter the source root directory and create a local docker

cd openharmony
docker run --name openharmony -itd -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:1.0.0

In the future, run the following command directly to enter docker

docker start openharmony
docker exec -it openharmony /bin/bash

5.2.4. source code compilation

Enter docker to compile

# must enter docker
docker exec -it openharmony /bin/bash
# The first compilation needs to download the toolchain, which can be skipped later
bash build/prebuilts_download.sh
./build.sh --product-name rk3568 --ccache

After compiling, the image is in out/rk3568/packages/phone/images/

5.3. firmware burning

Currently only supports burning firmware to EMMC

Proceed as follows:

  1. Connect the USB cable, please read the link below for the connection method of the cable:

    ROC-RK3568-PC: https://wiki.t-firefly.com/en/ROC-RK3568-PC/03-upgrade_firmware.html

    AIOJ-RK3568: https://wiki.t-firefly.com/en/Core-3568J/03-upgrade_firmware.html

  2. Prepare MiniLoaderAll.bin

    You can download a [MiniLoaderAll.bin] corresponding to the CPU model from the following link (https://www.t-firefly.com/share/index/index/id/4e86cc234c3b26e2b12084e383074ada.html).

  3. Click Advanced Function of the download tool, and then download the prepared MiniLoaderAll.bin to the memory, as shown in the figure below

    _images/load_emmc_with_flash01.png

  4. Click List Storage to read the memory. At this time, SPINOR is selected in the storage list. To ensure that the Nor flash is empty, we select EraseAll to erase

    _images/maskrom_erease_spinor_flash.png

    • X indicates that the memory does not exist on the device

    • 0 means the memory is present, but not selected

    • means the memory exists and is selected

    _images/load_emmc_with_flash02.png

  5. Select Emmc in the storage list and click Switch Storage

    _images/load_emmc_with_flash02.png

    It can be seen that the Emmc status in the storage list will switch from 0 to , indicating that the firmware is selected to be downloaded to eMMC

    _images/load_emmc_with_flash03.png

  6. Click EraseAll to erase

    _images/load_emmc_with_flash04.png

  7. Click Download Image of the download tool

    In the SDK directory “out/rk3568/packages/phone/images/”, find the “config.cfg” file. When right-clicking “Load Config”, select this configuration file. Then change the path of each partition to your firmware path.

    _images/openharmony_firmware_load.png

    If you don’t have this file, you can get it from the community: [https://dev.t-firefly.com/forum.php?mod=attachment&aid=ODc0N3xkNDVjZGI1OHwxNjYwNzkyMTUxfDY0MjY5OXwxMTg2MzE%3D](https://dev.t-firefly.com/forum. php?mod=attachment&aid=ODc0N3xkNDVjZGI1OHwxNjYwNzkyMTUxfDY0MjY5OXwxMTg2MzE%3D)