提交 2c3df7db 编写于 作者: E ester.zhou

Update docs (11465)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 b0fa0e39
# Getting Started # Getting Started
- Getting Started with Mini and Small Systems (IDE Mode, Recommended)
- [Mini and Small System Overview](quickstart-ide-lite-overview.md) - [Quick Start Overview](quickstart-overview.md)
- Environment Preparation - Getting Started in IDE Mode
- [Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-lite-env-setup-win-ubuntu.md) - Setting Up the Development Environment
- [Obtaining Source Code](quickstart-ide-lite-sourcecode-acquire.md) - [Setting Up the Windows Environment](quickstart-ide-env--win.md)
- [Creating a Source Code Project](quickstart-ide-lite-create-project.md) - [Setting Up the Ubuntu Environment](quickstart-ide-env-ubuntu.md)
- Running a Hello World Program - [Configuring the Environment for Remote Access](quickstart-ide-env-remote.md)
- Hi3861 Development Board - [Creating a Project and Obtaining Source Code](quickstart-ide-import-project.md)
- [Writing a Hello World Program](quickstart-ide-lite-steps-hi3861-helloworld.md) - Mini System (Based on the Hi3861 Development Board)
- [Building](quickstart-ide-lite-steps-hi3861-building.md) - [Writing a Hello World Program](quickstart-ide-3861-helloworld.md)
- [Burning](quickstart-ide-lite-steps-hi3861-burn.md) - [Building Source Code](quickstart-ide-3861-build.md)
- [Networking](quickstart-ide-lite-steps-hi3861-netconfig.md) - [Burning an Image](quickstart-ide-3861-burn.md)
- [Debugging and Verification](quickstart-ide-lite-steps-hi3861-debug.md) - [Running an Image](quickstart-ide-3861-running.md)
- [Running](quickstart-ide-lite-steps-hi3861-running.md) - Small System (Based on the Hi3516 Development Board)
- Hi3516 Development Board - [Writing a Hello World Program](quickstart-ide-3516-helloworld.md)
- [Writing a Hello World Program](quickstart-ide-lite-steps-hi3516-helloworld.md) - [Building Source Code](quickstart-ide-3516-build.md)
- [Building](quickstart-ide-lite-steps-hi3516-building.md) - [Burning an Image](quickstart-ide-3516-burn.md)
- [Burning](quickstart-ide-lite-steps-hi3516-burn.md) - [Running an Image](quickstart-ide-3516-running.md)
- [Running](quickstart-ide-lite-steps-hi3516-running.md) - Standard System (Based on the RK3568 Development Board)
- Appendix - [Writing a Hello World Program](quickstart-ide-3568-helloworld.md)
- [Introduction to the Hi3861 Development Board](quickstart-ide-lite-introduction-hi3861.md) - [Building Source Code](quickstart-ide-3568-build.md)
- [Introduction to the Hi3516 Development Board](quickstart-ide-lite-introduction-hi3516.md) - [Burning an Image](quickstart-ide-3568-burn.md)
- [Overall Description of Compilation Form Factors](quickstart-build.md) - [Running an Image](quickstart-ide-3568-running.md)
- Getting Started with Mini and Small Systems (Installation Package Mode) - Getting Started in CLI Mode
- [Mini and Small System Overview](quickstart-lite-overview.md) - Setting Up the Development Environment
- [Environment Preparation](quickstart-lite-env-setup.md) - [Setting Up the Development Environment](quickstart-pkg-prepare.md)
- Running a Hello World Program - [Installing Libraries and Tools](quickstart-pkg-install_package.md)
- Hi3861 Development Board - [Obtaining Source Code](quickstart-pkg-sourcecode.md)
- [Setting Up the Hi3861 Development Board Environment](quickstart-lite-steps-hi3861-setting.md) - [Installing the Compilation Tools](quickstart-pkg-install_tool.md)
- [Writing a Hello World Program](quickstart-lite-steps-hi3861-helloworld.md) - Mini System (Based on the Hi3861 Development Board)
- [Building](quickstart-lite-steps-hi3861-building.md) - [Installing Tools Specially Required by the Hi3861 Development Board](quickstart-pkg-3861-tool.md)
- [Burning](quickstart-lite-steps-hi3861-burn.md) - [Writing a Hello World Program](quickstart-pkg-3861-helloworld.md)
- [Networking](quickstart-lite-steps-hi3861-netconfig.md) - [Building Source Code](quickstart-pkg-3861-build.md)
- [Debugging and Verification](quickstart-lite-steps-hi3861-debug.md) - [Burning an Image](quickstart-pkg-3861-burn.md)
- [Running](quickstart-lite-steps-hi3861-running.md) - [Running an Image](quickstart-pkg-3861-running.md)
- Hi3516 Development Board - Small System (Based on the Hi3516 Development Board)
- [Setting Up the Hi3516 Development Board Environment](quickstart-lite-steps-hi3516-setting.md) - [Writing a Hello World Program](quickstart-pkg-3516-helloworld.md)
- [Writing a Hello World Program](quickstart-lite-steps-hi3516-helloworld.md) - [Building Source Code](quickstart-pkg-3516-build.md)
- [Building](quickstart-lite-steps-hi3516-building.md) - [Burning an Image](quickstart-pkg-3516-burn.md)
- [Burning](quickstart-lite-steps-hi3516-burn.md) - [Running an Image](quickstart-pkg-3516-running.md)
- [Running](quickstart-lite-steps-hi3516-running.md) - Standard System (Based on the RK3568 Development Board)
- FAQs - [Writing a Hello World Program](quickstart-pkg-3568-helloworld.md)
- [Fixing hb Installation Issues](quickstart-lite-faq-hb.md) - [Building Source Code](quickstart-pkg-3568-build.md)
- [Fixing Compilation Issues](quickstart-lite-faq-compose.md) - [Burning an Image](quickstart-pkg-3568-burn.md)
- [Fixing Burning Issues](quickstart-lite-faq-burning.md) - [Running an Image](quickstart-pkg-3568-running.md)
- Appendix - Miscellaneous
- Introduction to Development Boards - [Configuring the Proxy](quickstart-pkg-common-proxy.md)
- [Introduction to the Hi3861 Development Board](quickstart-lite-introduction-hi3861.md) - [Building Source Code Using the build.sh Script](quickstart-pkg-common-build.md)
- [Introduction to the Hi3516 Development Board](quickstart-lite-introduction-hi3516.md) - [Fixing hb Installation Errors](quickstart-pkg-common-hberr.md)
- [Reference](quickstart-lite-reference.md) - [Fixing Compilation and Building Error](quickstart-pkg-common-builderr.md)
- [Burning Code by Using HiTool](quickstart-lite-hitool.md) - [Fixing Image Burning Errors](quickstart-pkg-common-burnerr.md)
- [Overall Description of Compilation Form Factors](quickstart-build.md) - Appendix
- Getting Started with Standard System (IDE Mode, Recommended) - [Hi3516 Development Board](quickstart-appendix-hi3516.md)
- [Standard System Overview](quickstart-ide-standard-overview.md) - [Hi3861 Development Board](quickstart-appendix-hi3861.md)
- Environment Preparation - [RK3568 Development Board](quickstart-appendix-rk3568.md)
- [Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-standard-env-setup-win-ubuntu.md) - [Build Form Factors](quickstart-appendix-compiledform.md)
- [Obtaining Source Code](quickstart-ide-standard-sourcecode-acquire.md) - [Getting Started with the Standard System with Hi3516 (IDE Mode)](quickstart-appendix-hi3516-ide.md)
- [Creating a Source Code Project](quickstart-ide-standard-create-project.md) - [Getting Started with the Standard System with Hi3516 (CLI Mode)](quickstart-appendix-hi3516-pkg.md)
- Running a Hello World Program
- Hi3516 Development Board
- [Writing a Hello World Program](quickstart-ide-standard-running-hi3516-create.md)
- [Building](quickstart-ide-standard-running-hi3516-build.md)
- [Burning](quickstart-ide-standard-running-hi3516-burning.md)
- [Running](quickstart-ide-standard-running-hi3516-running.md)
- RK3568 Development Board
- [Writing a Hello World Program](quickstart-ide-standard-running-rk3568-create.md)
- [Building](quickstart-ide-standard-running-rk3568-build.md)
- [Burning](quickstart-ide-standard-running-rk3568-burning.md)
- [Running](quickstart-ide-standard-running-rk3568-running.md)
- Appendix
- [Introduction to the Hi3516 Development Board](quickstart-ide-standard-board-introduction-hi3516.md)
- [Introduction to the RK3568 Development Board](quickstart-ide-standard-board-introduction-rk3568.md)
- [Overall Description of Compilation Form Factors](quickstart-build.md)
- Getting Started with Standard System (Installation Package Mode)
- [Standard System Overview](quickstart-standard-overview.md)
- [Setting Up Environments for Standard System](quickstart-standard-env-setup.md)
- Running a Hello World Program
- Hi3516 Development Board
- [Writing a Hello World Program](quickstart-std-3516-create.md)
- [Building](quickstart-standard-running-hi3516-build.md)
- [Burning](quickstart-standard-running-hi3516-burning.md)
- [Running](quickstart-standard-running-hi3516-running.md)
- RK3568 Development Board
- [Writing a Hello World Program](quickstart-standard-running-rk3568-create.md)
- [Building](quickstart-standard-running-rk3568-build.md)
- [Burning](quickstart-standard-running-rk3568-burning.md)
- [Running](quickstart-standard-running-rk3568-running.md)
- FAQs
- [Fixing hb Installation Issues](quickstart-standard-faq-hb.md)
- [Fixing Compilation Issues](quickstart-standard-faq-compose.md)
- [Fixing Burning Issues](quickstart-standard-faq-burning.md)
- Appendix
- Introduction to Development Boards
- [Introduction to the Hi3516 Development Board](quickstart-standard-board-introduction-hi3516.md)
- [Introduction to the RK3568 Development Board](quickstart-standard-board-introduction-rk3568.md)
- [Reference](quickstart-standard-reference.md)
- [Burning Code by Using HiTool](quickstart-standard-hitool.md)
- [Overall Description of Compilation Form Factors](quickstart-build.md)
# Build Form Factors
During the compilation, select a build form factor based on the site requirements. Click the links to learn about the specific build form factors and related differences.
**Table 1** Build form factors
| Build Form Factor | Development Board| Main Chip| Kernel| System Type|
| -------- | -------- | -------- | -------- | -------- |
| [neptune100](https://gitee.com/openharmony/vendor_hihope/blob/master/neptune_iotlink_demo/config.json) | neptune100 | WinnerMicro | LiteOS-M | Mini |
| [rk3568](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/config.json) | rk3568 | Rockchip | Linux | standard |
| [rk3568_Mini_system](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568_Mini_system/config.json) | rk3568 | Rockchip | Linux | Standard |
| [bearpi_hm_micro](https://gitee.com/openharmony/vendor_bearpi/blob/master/bearpi_hm_micro/config.json) | bearpi_hm_micro | STM32MP1xx | LiteOS-A | small |
| [bearpi_hm_nano](https://gitee.com/openharmony/vendor_bearpi/blob/master/bearpi_hm_nano/config.json) | bearpi_hm_nano | Hi3861V100 | LiteOS-M | Mini |
| [wifiiot_hispark_pegasus](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_pegasus/config.json) | hispark_pegasus | Hi3861V100 | LiteOS-M | Mini |
| [ipcamera_hispark_aries](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_aries/config.json) | hispark_aries | Hi3518EV300 | LiteOS-A | Small |
| [ipcamera_hispark_taurus](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus/config.json) | hispark_taurus | Hi3516DV300 | LiteOS-A | Small |
| [ipcamera_hispark_taurus_Linux](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_Linux/config.json) | hispark_taurus | Hi3516DV300 | Linux | Small |
| [hispark_taurus_Standard](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_Standard/config.json) | hispark_taurus | Hi3516DV300 | Linux | Standard |
| [watchos](https://gitee.com/openharmony/vendor_hisilicon/blob/master/watchos/config.json) | hispark_taurus | Hi3516DV300 | Linux | Standard |
| [hispark_phoenix](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_phoenix/config.json) | hispark_phoenix | Hi3751V350 | Linux | Standard |
| [hispark_taurus_Mini_system](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_Mini_system/config.json) | hispark_taurus | Hi3516DV300 | LiteOS-A | Mini |
| [hispark_pegasus_Mini_system](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_pegasus_Mini_system/config.json) | hispark_pegasus | Hi3861V100 | LiteOS-M | Mini |
| [gr5515_sk_iotlink_demo](https://gitee.com/openharmony/vendor_goodix/blob/master/gr5515_sk_iotlink_demo/config.json) | gr5515_sk | GR551x | LiteOS-M | Mini |
| [gr5515_sk_xts_demo](https://gitee.com/openharmony/vendor_goodix/blob/master/gr5515_sk_xts_demo/config.json) | gr5515_sk | GR551x | LiteOS-M | Mini |
| [wifi_demo](https://gitee.com/openharmony/vendor_asrmicro/blob/master/wifi_demo/config.json) | dev_wifi_a | ASR582X | LiteOS-M | Mini |
| [xts_demo](https://gitee.com/openharmony/vendor_asrmicro/blob/master/xts_demo/config.json) | dev_wifi_a | ASR582X | LiteOS-M | Mini |
| [display_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/display_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [xts_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/xts_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [iotlink_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/iotlink_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [Mini_distributed_music_player](https://gitee.com/openharmony/vendor_bestechnic/blob/master/Mini_distributed_music_player/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [niobe407](https://gitee.com/openharmony/vendor_talkweb/blob/master/niobe407/config.json) | niobe407 | STM32F4xx | LiteOS-M | Mini |
| [QEMU_Mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/QEMU_Mini_system_demo/config.json) | arm_mps2_an386 | QEMU | LiteOS-M | Mini |
| [QEMU_csky_Mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/QEMU_csky_Mini_system_demo/config.json) | SmartL_E802 | QEMU | LiteOS-M | Mini |
| [QEMU_cm55_Mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/QEMU_cm55_Mini_system_demo/config.json) | arm_mps3_an547 | QEMU | LiteOS-M | Mini |
| [QEMU_xtensa_Mini_system_demo](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_xtensa_Mini_system_demo/config.json) | esp32 | QEMU | LiteOS-M | Mini |
| [QEMU_riscv_Mini_system_demo](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_riscv32_Mini_system_demo/config.json) | ricsv32_virt | QEMU | LiteOS-M | Mini |
| [QEMU_ca7_Mini_system_demo](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_ca7_Mini_system_demo/config.json) | arm_virt | QEMU | LiteOS-A | Small |
| [QEMU_Small_system_demo](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_Small_system_demo/config.json) | arm_virt | QEMU | LiteOS-A | Small |
| [QEMU_arm_Linux_min](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_arm_Linux_min/config.json) | QEMU-arm-Linux | QEMU | Linux | Standard |
| [QEMU_arm_Linux_headless](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_arm_Linux_headless/config.json) | QEMU-arm-Linux | QEMU | Linux | Standard |
| [iotlink_demo](https://gitee.com/Rockchip/vendor_Chipsea/blob/master/iotlink_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini |
| [dsoftbus_demo](https://gitee.com/Rockchip/vendor_Chipsea/blob/master/dsoftbus_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini |
| [xts_demo](https://gitee.com/Rockchip/vendor_Chipsea/blob/master/xts_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini |
# Getting Started with the Standard System with Hi3516 (IDE Mode)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> Since OpenHarmony 3.2, the standard system does not perform adaptation verification for the Hi3516D V300 development board. You are advised to use RK3568 to develop standard-system devices.
>
> If you still need to use Hi3516DV300 to develop standard-system devices, adaptation may fail. In this case, contact the chip supplier to obtain the adaptation guide or complete adaptation by yourself.
In addition to the small system, the Hi3516D V300 development board also supports the standard system. This topic describes how to develop the standard system on Hi3516DV300 by using DevEco Device Tool.
The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!" .
Before development, complete the following preparations:
- [Setting Up the Development Environment](quickstart-ide-env--win.md)
- [Creating a Project and Obtaining Source Code](quickstart-ide-import-project.md)
## Writing a Hello World Program
### Example Directory
```
applications/sample/hello
│── BUILD.gn
│── include
│ └── helloworld.h
│── src
│ └── helloworld.c
├── bundle.json
build
└── subsystem_config.json
productdefine/common
└── products
└── Hi3516DV300.json
```
### How to Develop
Perform the steps below in the source code directory:
1. Create a directory and write the service code.
Create the **applications/sample/hello/src/helloworld.c** directory and file whose code is shown in the following example. You can customize the content to be printed. For example, you can change **World** to **OHOS**. Declare the string printing function **HelloPrint** in the **helloworld.h** file. You can use either C or C++ to develop a program.
```
#include <stdio.h>
#include "helloworld.h"
int main(int argc, char **argv)
{
HelloPrint();
return 0;
}
void HelloPrint()
{
printf("\n\n");
printf("\n\t\tHello World!\n");
printf("\n\n");
}
```
Add the header file **applications/sample/hello/include/helloworld.h**. The sample code is as follows:
```
#ifndef HELLOWORLD_H
#define HELLOWORLD_H
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
void HelloPrint();
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif // HELLOWORLD_H
```
2. Create a build file.
1. Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows:
```
import("//build/ohos.gni") # Import the build template.
ohos_executable("helloworld") {# Executable module.
sources = [ # Source code of the module.
"src/helloworld.c"
]
include_dirs = [ # Directory of header files on which the module depends.
"include"
]
cflags = []
cflags_c = []
cflags_cc = []
ldflags = []
configs = []
deps =[] # Internal dependencies of the component.
part_name = "hello" # Component name. This parameter is mandatory.
install_enable = true # Whether to install the software by default. This parameter is optional. By default, the software is not installed.
}
```
2. Create the **applications/sample/hello/bundle.json** file and add the description of the **sample** component. The content is as follows:
```
{
"name": "@ohos/hello",
"description": "Hello world example.",
"version": "3.1",
"license": "Apache License 2.0",
"publishAs": "code-segment",
"segment": {
"destPath": "applications/sample/hello"
},
"dirs": {},
"scripts": {},
"component": {
"name": "hello",
"subsystem": "sample",
"syscap": [],
"features": [],
"adapted_system_type": [ "mini", "small", "standard" ],
"rom": "10KB",
"ram": "10KB",
"deps": {
"components": [],
"third_party": []
},
"build": {
"sub_component": [
"//applications/sample/hello:helloworld"
],
"inner_kits": [],
"test": []
}
}
}
```
The **bundle.json** file consists of two parts. The first part describes the information about the subsystem to which the component belongs, and the second part defines the build configuration for the component. When adding a component, you must specify the **sub_component** of the component. If there are APIs provided for other components, add them in **inner_kits**. If there are test cases, add them in **test**.
3. Modify the subsystem configuration file.
Add the configuration of the new subsystem to the **build/subsystem_config.json** file.
```
"sample": {
"path": "applications/sample/hello",
"name": "sample"
},
```
4. Modify the product configuration file.
In the **productdefine/common/products/Hi3516DV300.json** file, add the **hello** part after the existing part.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> In this example, the OpenHarmony-v3.1-Release version is used, where the Hi3516 configuration file is **productdefine/common/products/Hi3516DV300.json**. In OpenHarmony-v3.2-Beta2 and later versions, the Hi3516 configuration file is **vendor/hisilicon/Hi3516DV300/config.json**.
```
"usb:usb_manager_native":{},
"applications:prebuilt_hap":{},
"sample:hello":{},
"wpa_supplicant-2.9:wpa_supplicant-2.9":{},
```
## Building Source Code
With DevEco Device Tool, you can easily build source code of the Hi3516DV300 development board, thanks to its productivity-boosting features, such as the compiler toolchain, detection of the build environment dependencies, and one-click installation of the dependencies.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> The build environment of Hi3516DV300 is Ubuntu.
1. Click **Project Settings** on the menu bar to access the Hi3516DV300 project configuration page.
![en-us_image_0000001274745038](figures/en-us_image_0000001274745038.png)
2. On the **Tool Chain** tab page, DevEco Device Tool automatically checks whether the dependent compiler toolchain is complete. If a message is displayed indicating that some tools are missing, click **Install** to automatically install the required tools.
![en-us_image_0000001292531862](figures/en-us_image_0000001292531862.png)
3. Install the toolchain related to Hi3516DV300. Certain tools may require the root access to install. In this case, enter the user password in the **TERMINAL** window.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> - If pip fails to be installed, [change the Python source](https://device.harmonyos.com/en/docs/documentation/guide/ide-set-python-source-0000001227639986) and try again.
> - If APT fails to be installed, [change the APT source](https://device.harmonyos.com/en/docs/documentation/guide/faq-toolchain-install-0000001301623822) and try again.
![en-us_image_0000001274748606](figures/en-us_image_0000001274748606.png)
After the toolchain is automatically installed, the figure below is displayed.
![en-us_image_0000001296270098](figures/en-us_image_0000001296270098.png)
4. On the **hispark_taurus_standard** tab page, set **build_type**, whose default value is **debug**.
![en-us_image_0000001325269477](figures/en-us_image_0000001325269477.png)
5. Choose **PROJECT TASKS** > **hispark_taurus_standard** > **Build** to start building.
![en-us_image_0000001292849062](figures/en-us_image_0000001292849062.png)
6. Wait until **SUCCESS** is displayed in the **TERMINAL** window, indicating that the build is complete.
![en-us_image_0000001366345198](figures/en-us_image_0000001366345198.png)
After the compilation is complete, go to the **out** directory of the project to view the generated files and perform burning operations.
## Burning an Image
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
The images of Hi3516DV300 are burnt in the Windows environment. After burning is initiated, DevEco Device Tool copies the target program files generated in the Ubuntu environment to the specified Windows directory in remote mode, and then burns the program files to Hi3516DV300 using the Windows burning tool.
Hi3516DV300 supports burning for the standard system through the USB port and network port. This topic describes how to burn source code through the USB port.
### Prerequisites
- The serial port driver has been installed on Hi3516DV300. For details, see [Installing the Serial Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/hi3516_hi3518-drivers-0000001050743695).
- The USB port driver has been installed on Hi3516DV300. For details, see [Installing the USB Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393).
### Procedure
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Hi3516 Development Board](quickstart-appendix-hi3516.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
- If ![en-us_image_0000001326512673](figures/en-us_image_0000001326512673.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001275432904](figures/en-us_image_0000001275432904.png) is displayed, click the connect icon. During the connection, DevEco Device Tool will restart. Therefore, to avoid task interruptions, do not connect to DevEco Device Tool when downloading or building source code.
![en-us_image_0000001285658392](figures/en-us_image_0000001285658392.png)
3. Click **Project Settings** on the menu bar to access the Hi3516DV300 project configuration page.
![en-us_image_0000001275752808](figures/en-us_image_0000001275752808.png)
4. On the **Tool Chain** tab page, set the Uploader burning tool. You can click **Install** on this page to install the tool online.
![Phoenix-upload](figures/Phoenix-upload.png)
5. On the **hispark_taurus_standard** tab page, set the burning options. The settings are automatically saved.
- **upload_partitions_profile**: Select the burning profile file (preset by default), which specifies the files to be burnt, start address and length of the partition, and other burning settings. In addition, select **Enable to use upload_partitions_profile**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> In the burning profile file, you can change the start address and length of the partition based on the size of the files to be burnt. Make sure the size of the partition is greater than that of the files to be burnt and the partition addresses of the files do not overlap.
>
> If this is the first time you burn files to the development board, select **Enable to use upload_partitions_profile for upload** so that the upload_partitions file will be automatically generated. Afterward, select **Enable to use upload_partitions_profile for upload** only when you need to generate a new **upload_partitions** file.
- **upload_protocol**: Select the burning protocol **hiburn-usb**.
- **upload_port**: Select the serial port number obtained.
![en-us_image_0000001338622229](figures/en-us_image_0000001338622229.png)
6. Click **Upload** under **hispark_taurus_standard**.
![en-us_image_0000001276281922](figures/en-us_image_0000001276281922.png)
When the "Operation paused, Please press Enter key to continue" message is displayed, which indicates that the transfer is complete, press **Enter** to start burning.
![en-us_image_0000001326201857](figures/en-us_image_0000001326201857.png)
7. When the following information is displayed in the **TERMINAL** window, press and hold the **Update** key within 15 seconds, remove and insert the USB cable, and then release the **Update** key to start burning.
![en-us_image_0000001276122010](figures/en-us_image_0000001276122010.png)
When the "SUCCESS" message is displayed, it indicates that the burning is successful.
![en-us_image_0000001275802150](figures/en-us_image_0000001275802150.png)
8. When the burning is successful, perform the operations in "Running" to start the system.
## Running an Image
### Starting the System
After the burning is complete, perform the following steps to start the system:
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> This operation procedure is required only if this is the first time you burn an image for the standard system.
1. In DevEco Device Tool, click **Monitor** to open the serial port tool.
![quickstart-appendix-hi3516-ide-run](figures/quickstart-appendix-hi3516-ide-run.png)
2. Restart the development board. Before the autoboot countdown ends, press any key to enter the system.
![press-any-key-to-enter-the-system](figures/press-any-key-to-enter-the-system.gif)
3. Run the following commands to set system boot parameters:
```shell
setenv bootargs 'mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M clk_ignore_unused rootdelay=10 hardware=Hi3516DV300 init=/init root=/dev/ram0 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),2M(misc),3307M(system),256M(vendor),-(userdata)';
```
```shell
setenv bootcmd 'mmc read 0x0 0x82000000 0x800 0x4800; bootm 0x82000000'
```
![setenv-bootargs](figures/setenv-bootargs.png)
4. Save the parameter settings.
```shell
save
```
![Save the parameter settings](figures/quickstart-appendix-hi3516-ide-run-set.png)
5. Restart the development board to start the system.
```shell
reset
```
![start the system](figures/quickstart-appendix-hi3516-ide-run-start.png)
### Running a Hello World Program
After the system is started, start the serial port tool, run the **helloworld** command in any directory, and press **Enter**. If the message "Hello World!" is displayed, the program runs successfully.
![helloworld](figures/helloworld.png)
### Next
Congratulations! You have finished all steps! Proceed to [develop a sample](../guide/device-clock-guide.md) to better familiarize yourself with OpenHarmony development.
# Writing a Hello World Program # Getting Started with the Standard System with Hi3516 (CLI Mode)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> Since OpenHarmony 3.2, the standard system does not perform adaptation verification for the Hi3516D V300 development board. You are advised to use RK3568 to develop standard-system devices.
>
> If you still need to use Hi3516DV300 to develop standard-system devices, adaptation may fail. In this case, contact the chip supplier to obtain the adaptation guide or complete adaptation by yourself.
The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!" .
## Example Directory In addition to the small system, the Hi3516D V300 development board also supports the standard system. This topic describes how to develop the standard system on Hi3516DV300 by using the command-line interface (CLI).
The complete code directory is as follows:
The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!"
Before development, [set up the development environment](quickstart-pkg-prepare.md).
## Writing a Hello World Program
### Example Directory
``` ```
applications/sample/hello applications/sample/hello
│── BUILD.gn │── BUILD.gn
│── include │── include
│ └── helloworld.h │ └── helloworld.h
│── src │── src
│ └── helloworld.c │ └── helloworld.c
│ └── bundle.json ── bundle.json
build build
└── subsystem_config.json └── subsystem_config.json
vendor/hisilicon vendor/hisilicon
└── Hi3516DV300 └── Hi3516DV300
└── config.json └── config.json
``` ```
## How to Develop ### How to Develop
Perform the steps below in the source code directory: Perform the steps below in the source code directory:
1. Create a directory and write the service code. 1. Create a directory and write the service code.
Create the **applications/sample/hello/src/helloworld.c** directory and file whose code is shown in the following example. You can customize the content to be printed. For example, you can change **World** to **OH**. Declare the string printing function **HelloPrint** in the **helloworld.h** file. You can use either C or C++ to develop a program. Create the **applications/sample/hello/src/helloworld.c** directory and file whose code is shown in the following example. You can customize the content to be printed. For example, you can change **World** to **OHOS**. Declare the string printing function **HelloPrint** in the **helloworld.h** file. You can use either C or C++ to develop a program.
``` ```
#include <stdio.h> #include <stdio.h>
#include "helloworld.h" #include "helloworld.h"
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
HelloPrint(); HelloPrint();
return 0; return 0;
} }
void HelloPrint() void HelloPrint()
{ {
printf("\n\n"); printf("\n\n");
...@@ -64,9 +75,7 @@ Perform the steps below in the source code directory: ...@@ -64,9 +75,7 @@ Perform the steps below in the source code directory:
extern "C" { extern "C" {
#endif #endif
#endif #endif
void HelloPrint(); void HelloPrint();
#ifdef __cplusplus #ifdef __cplusplus
#if __cplusplus #if __cplusplus
} }
...@@ -76,7 +85,6 @@ Perform the steps below in the source code directory: ...@@ -76,7 +85,6 @@ Perform the steps below in the source code directory:
``` ```
2. Create a build file. 2. Create a build file.
1. Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows: 1. Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows:
``` ```
...@@ -85,7 +93,7 @@ Perform the steps below in the source code directory: ...@@ -85,7 +93,7 @@ Perform the steps below in the source code directory:
sources = [ # Source code of the module. sources = [ # Source code of the module.
"src/helloworld.c" "src/helloworld.c"
] ]
include_dirs = [ # Directory of header file on which the module depends. include_dirs = [ # Directory of header files on which the module depends.
"include" "include"
] ]
cflags = [] cflags = []
...@@ -93,7 +101,7 @@ Perform the steps below in the source code directory: ...@@ -93,7 +101,7 @@ Perform the steps below in the source code directory:
cflags_cc = [] cflags_cc = []
ldflags = [] ldflags = []
configs = [] configs = []
deps =[] # Internal dependencies of a component. deps =[] # Internal dependencies of the component.
part_name = "hello" # Component name. This parameter is mandatory. part_name = "hello" # Component name. This parameter is mandatory.
install_enable = true # Whether to install the software by default. This parameter is optional. By default, the software is not installed. install_enable = true # Whether to install the software by default. This parameter is optional. By default, the software is not installed.
} }
...@@ -135,7 +143,7 @@ Perform the steps below in the source code directory: ...@@ -135,7 +143,7 @@ Perform the steps below in the source code directory:
} }
``` ```
The **bundle.json** file consists of two parts. The first part describes the information about the subsystem to which the component belongs, and the second part defines the component building configuration. When adding a part, you need to specify the **sub_component** contained in the part. If there are interfaces provided for other components, describe them in **inner_kits**. If there are test cases, describe them in **test**. The **bundle.json** file consists of two parts. The first part describes the information about the subsystem to which the component belongs, and the second part defines the build configuration for the component. When adding a component, you must specify the **sub_component** of the component. If there are APIs provided for other components, add them in **inner_kits**. If there are test cases, add them in **test**.
3. Modify the subsystem configuration file. 3. Modify the subsystem configuration file.
...@@ -151,7 +159,7 @@ Perform the steps below in the source code directory: ...@@ -151,7 +159,7 @@ Perform the steps below in the source code directory:
4. Modify the product configuration file. 4. Modify the product configuration file.
In the **vendor\hisilicon\Hi3516DV300\config.json** file, add the **hello** part after the existing part. In the **vendor/hisilicon/Hi3516DV300/config.json** file, add the **hello** part after the existing part.
``` ```
...@@ -160,3 +168,155 @@ Perform the steps below in the source code directory: ...@@ -160,3 +168,155 @@ Perform the steps below in the source code directory:
"sample:hello":{}, "sample:hello":{},
"wpa_supplicant-2.9:wpa_supplicant-2.9":{}, "wpa_supplicant-2.9:wpa_supplicant-2.9":{},
``` ```
## Building Source Code
You can build source code with hb or the **build.sh** script. The following exemplifies how to build source code with hb. For details about how to build source code with the **build.sh** script, see [Building Source Code Using the build.sh Script](quickstart-pkg-common-build.md).
For details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
### Prerequisites
- The [required libraries and tools](quickstart-pkg-install_package.md) have been installed.
- The [compilation tools](quickstart-pkg-install_tool.md) have been installed.
- A **Hello World** program has been created with code written.
- The access to the Ubuntu environment is normal.
### Procedure
Go to the root directory of the source code and run the build command.
1. Set the build path.
```
hb set
```
2. Select the current path.
```
.
```
3. Select **hispark_taurus_standard** under **hisilicon** and press **Enter**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> When adapting the development board to a specific use case, select an appropriate build form factor, that is, **product** settings. For details, see [Build Form Factors](quickstart-appendix-compiledform.md).
**Figure 1** Hi3516 build settings
![quick-start-hi3516-standard-build](figures/quick-start-hi3516-standard-build.png)
4. Start building.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> - To build a component (for example, **hello**), run the **hb build -T *targetName*** command.
>
> - To build a product incrementally, run the **hb build** command.
>
> - To build a product from the scratch, run the **hb build -f** command.
>
> This example builds a product from the scratch.
```
hb build -f
```
5. Check the build result. If "build success" is displayed, the building is successful.
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
>
> The build result and log files are stored in **out/hi3516dv300**.
## Burning an Image
The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You can also do so using DevEco Device Tool, by following instructions in [Burning an Image](quickstart-appendix-hi3516-ide.md#burning-an-image).
### Prerequisites
- The source code of the development board has been compiled into files for burning.
- [HiTool](http://www.hihope.org/download/download.aspx) has been installed on the client platform (for example, a Windows-based computer).
- The USB port driver has been installed on the client platform. For details, see [Installing the USB Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393).
- A serial port terminal tool, such as IPOP, has been installed on the client platform.
- The client platform and development board are connected using a USB cable and serial cable.
### Procedure
1. Prepare the files to be burnt.
1. On the client platform, create a folder for storing the files to be burnt, for example, **D:\L2**.
2. Download the compiled source package to the client platform, decompress the package, and copy the files required for burning to the folder created in step 1.
For the Hi3516DV300 development board, the files required for burning of the standard system are as follows: **boot.img**, **Hi3516DV300-emmc.xml**, **system.img**, **u-boot-hi3516dv300_emmc.bin**, **uImage**, **updater.img**, **userdata.img**, and **vendor.img**.
2. Burn the image files using HiTool.
1. Open HiTool.
2. Set up HiTool.
Set the transfer mode to USB and burning mode to eMMC (the storage medium of the development board is eMMC).
3. Click **Browse** and select the burning configuration file (for example, **Hi3516DV300-emmc.xml**) from the folder created in step 1.
![quickstart-hi3516-standard-hitool-select](figures/quickstart-hi3516-standard-hitool-select.png)
4. After clicking the **Burn** button, press and hold the **Update** key next to the serial port on the development board, and remove and insert the USB cable.
After the burning starts, logs are displayed in the console area at the bottom of HiTool.
When the burning is complete, HiTool displays a dialog box indicating that the burning is successful.
5. Click **OK**.
3. Import startup parameters.
1. Use the terminal tool to enable the serial port.
2. Restart the development board by removing and inserting its power supply. Press **Enter** in the serial port terminal tool within 3 seconds.
If **hisilicon \#** is displayed on the terminal tool page, the serial port of the development board is connected.
3. Copy the following startup parameters in the serial port terminal tool and press **Enter** to complete the setup.
```
setenv bootargs 'mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M clk_ignore_unused androidboot.selinux=permissive rootdelay=10 hardware=Hi3516DV300 init=/init root=/dev/ram0 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),2M(misc),3307M(system),256M(vendor),-(userdata)';setenv bootcmd 'mmc read 0x0 0x82000000 0x800 0x4800; bootm 0x82000000'
saveenv
reset
```
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
>
> When entering startup parameters, do not delete blank lines.
## Running an Image
After the system is started, copy the executable file **helloworld** in the **out** directory of the source code to the **bin** directory, and run the Hello World program as follows:
### Procedure
1. Go to the **bin** directory on the startup page.
```
cd bin
```
2. Run the following command to run the **helloworld** program:
```
./helloworld
```
If the message "Hello World!" is displayed, the program runs successfully.
### Next
Congratulations! You have finished all steps! Proceed to [develop a sample](../guide/device-clock-guide.md) to better familiarize yourself with OpenHarmony development.
# Hi3516 Development Board
## Introduction
Hi3516DV300 is a next-generation system on chip (SoC) designed for the industry-dedicated smart HD IP camera. Thanks to its next-generation image signal processor (ISP), H.265 video compression encoder, and high-performance NNIE engine, Hi3516DV300 provides low bit rates, high image quality, low power consumption, and intelligent processing and analysis.
**Figure 1** Hi3516 front view
![en-us_image_0000001271234717](figures/en-us_image_0000001271234717.png)
## Specifications
**Table 1** Hi3516 specifications
| Item| Description|
| -------- | -------- |
| Processor and internal memory| - Hi3516DV300 chip<br>-&nbsp;DDR3&nbsp;1GB<br>- eMMC 4.5, 8 GB capacity|
| External components| - Ethernet port<br>- Audio and video<br> - 1 voice input<br> - 1 mono channel (AC_L) output, connected to a 3 W power amplifier (LM4871)<br> - MicroHDMI (1-channel HDMI 1.4)<br>- Camera<br> - Sensor IMX335<br> - M12 lens, 4 mm focal length, and f/1.8 aperture<br>- Display<br> - 2.35-inch LCD connector<br> - 5.5-inch LCD connector<br>- External components and ports<br> - Memory card port<br> - JTAG/I2S port<br> - ADC port<br> - Steering gear port<br> - Grove connector<br> - USB 2.0 (Type-C)<br> - Three function keys, two user-defined keys, and one upgrade key<br> - LED indicator, green or red |
# Introduction to the Hi3861 Development Board # Hi3861 Development Board
## Introduction ## Introduction
Hi3861 is a 2 x 5 cm development board. It is a 2.4 GHz WLAN SoC chip that highly integrates the IEEE 802.11b/g/n baseband and radio frequency (RF) circuit. It supports OpenHarmony and provides an open and easy-to-use development and debugging environment. Packed in the 2 cm x 5 cm size, Hi3861 is a 2.4 GHz WLAN SoC with an IEEE 802.11b/g/n baseband and RF circuit. It supports OpenHarmony and allows for open and intuitive development and debugging.
**Figure 1** Hi3861 development board **Figure 1** Hi3861 front view
![en-us_image_0000001226634692](figures/en-us_image_0000001226634692.png) ![hi3861-front](figures/hi3861-front.png)
The Hi3861 development board can also be connected to the Hi3861 mother board to expand its peripheral capabilities. The following figure shows the Hi3861 mother board. The Hi3861 development board can also be connected to the Hi3861 mother board to expand its peripheral capabilities. The following figure shows the Hi3861 mother board.
**Figure 2** Hi3861 mother board **Figure 2** Hi3861 rear view
![en-us_image_0000001226794660](figures/en-us_image_0000001226794660.png) ![hi3861-rear](figures/hi3861-rear.png)
- The RF circuit includes modules such as the power amplifier (PA), low noise amplifier (LNA), RF Balun, antenna switch, and power management. It supports a standard bandwidth of 20 MHz and a narrow bandwidth of 5 MHz or 10 MHz, and provides a maximum rate of 72.2 Mbit/s at the physical layer. - The RF circuit includes modules such as the power amplifier (PA), low noise amplifier (LNA), RF Balun, antenna switch, and power management. It supports a standard bandwidth of 20 MHz and a narrow bandwidth of 5 MHz or 10 MHz, and provides a maximum rate of 72.2 Mbit/s at the physical layer.
...@@ -25,33 +25,33 @@ The Hi3861 development board can also be connected to the Hi3861 mother board to ...@@ -25,33 +25,33 @@ The Hi3861 development board can also be connected to the Hi3861 mother board to
**Figure 3** Functional block diagram of Hi3861 **Figure 3** Functional block diagram of Hi3861
![en-us_image_0000001271234729](figures/en-us_image_0000001271234729.png) ![hi3861-function](figures/hi3861-function.png)
## Resources and Constraints ## Resources and Constraints
The resources of the Hi3861 development board are limited. The entire board has a 2 MB flash memory and 352 KB RAM. When writing service code, pay attention to the resource usage efficiency. The Hi3861 development board comes with a mere 2 MB of flash memory and 352 KB of RAM. When writing service code, pay attention to the resource usage efficiency.
## Development Board Specifications ## Specifications
**Table 1** Hi3861 specifications **Table 1** Hi3861 specifications
| Item| Description| | Item| Description|
| -------- | -------- | | -------- | -------- |
| General specifications| -&nbsp;1 x 1 2.4 GHz frequency band (ch1–ch14)<br>-&nbsp;PHY supports IEEE 802.11b/g/n.<br>-&nbsp;MAC supports IEEE802.11d/e/h/i/k/v/w.<br>-&nbsp;Built-in PA and LNA; integrated TX/RX switch and Balun<br>-&nbsp;Support for STA and AP modes. When functioning as an AP, it supports a maximum of 6 STAs.<br>-&nbsp;Support for WFA WPA/WPA2 personal and WPS2.0.<br>-&nbsp;2/3/4-line PTA solution that coexists with BT/BLE chips.<br>-&nbsp;Input voltage range: 2.3 V to 3.6 V<br>-&nbsp;I/O power voltage: 1.8 V or 3.3 V.<br>-&nbsp;RF self-calibration<br>-&nbsp;Low power consumption:<br>&nbsp;&nbsp;-&nbsp;Ultra Deep Sleep mode: 5 μA@3.3 V<br>&nbsp;&nbsp;-&nbsp;DTIM1: 1.5 mA \@3.3V<br>&nbsp;&nbsp;-&nbsp;DTIM3: 0.8 mA \@3.3V| | General specifications| - 1 x 1 2.4 GHz frequency band (ch1–ch14)<br>- PHY supports IEEE 802.11b/g/n.<br>- MAC supports IEEE802.11d/e/h/i/k/v/w.<br>- Built-in PA and LNA; integrated TX/RX switch and Balun<br>- Support for STA and AP modes. When functioning as an AP, it supports a maximum of 6 STAs.<br>- Support for WFA WPA/WPA2 personal and WPS2.0.<br>- 2/3/4-line PTA solution that coexists with BT/BLE chips.<br>- Input voltage range: 2.3 V to 3.6 V<br>- I/O power voltage: 1.8 V or 3.3 V<br>- RF self-calibration<br>- Low power consumption:<br> - Ultra Deep Sleep mode: 5 μA@3.3 V<br> - DTIM1: 1.5 mA \@3.3 V<br> - DTIM3: 0.8 mA \@3.3 V |
| PHY features| -&nbsp;Supports all data rates of the IEEE802.11b/g/n single antenna.<br>-&nbsp;Supported maximum rate: 72.2 Mbps\@HT20&nbsp;MCS7<br>-&nbsp;20 MHz standard bandwidth and 5 MHz/10 MHz narrow bandwidth.<br>-&nbsp; STBC.<br>-&nbsp;Short-GI.| | PHY features| - All data rates of the IEEE802.11b/g/n single antenna<br>- Supported maximum rate: 72.2 Mbps\@HT20 MCS7<br>- 20 MHz standard bandwidth and 5 MHz/10 MHz narrow bandwidth.<br>- STBC<br>- Short-GI |
| MAC features| -&nbsp;A-MPDU and A-MSDU.<br>-&nbsp;Blk-ACK.<br>-&nbsp;QoS to meet the quality requirements of different services.| | MAC features| - A-MPDU and A-MSDU<br>- Blk-ACK<br>- QoS to meet the quality requirements of different services |
| CPU subsystem| - &nbsp;High-performance 32-bit microprocessor with a maximum working frequency of 160 MHz.<br>-&nbsp;Embedded SRAM of 352 KB; ROM of 288 KB<br>-&nbsp;Embedded 2 MB flash memory| | CPU subsystem| - High-performance 32-bit microprocessor with a maximum working frequency of 160 MHz<br>- Embedded 352 KB of SRAM; 288 KB of ROM<br>- Embedded 2 MB flash memory |
| Peripheral ports| -&nbsp;One SDIO interface, two SPI interfaces, two I2C interfaces, three UART interfaces, 15 GPIO interfaces, seven ADC inputs, six PWM interfaces, and one I2S interface (Note: These interfaces are all multiplexed.)<br>-&nbsp;Frequency of the external main crystal: 40 MHz or 24 MHz| | Peripheral ports| - One SDIO interface, two SPI interfaces, two I2C interfaces, three UART interfaces, 15 GPIO interfaces, seven ADC inputs, six PWM interfaces, and one I2S interface (Note: These interfaces are all multiplexed.)<br>- Frequency of the external main crystal: 40 MHz or 24 MHz|
| Others| -&nbsp;Package: QFN-32, 5 mm x 5 mm<br>-&nbsp;Working temperature: -40°C to +85°C| | Others| - Package: QFN-32, 5 mm x 5 mm<br>- Working temperature: -40°C to +85°C|
## OpenHarmony Key Features ## Key Features
OpenHarmony provides a wide array of available capabilities based on the Hi3861 platform. The following table describes the available key components. OpenHarmony provides a series of available capabilities based on Hi3861. The following table describes the available key components.
**Table 2** Key components of OpenHarmony **Table 2** Key components
| Component| Capability| | Component| Capability|
| -------- | -------- | | -------- | -------- |
...@@ -60,9 +60,9 @@ OpenHarmony provides a wide array of available capabilities based on the Hi3861 ...@@ -60,9 +60,9 @@ OpenHarmony provides a wide array of available capabilities based on the Hi3861
| DSoftBus| Provides the capabilities of device discovery and data transmission in the distributed network.| | DSoftBus| Provides the capabilities of device discovery and data transmission in the distributed network.|
| hichainsdk| Provides the capability of securely transferring data between devices when they are interconnected.| | hichainsdk| Provides the capability of securely transferring data between devices when they are interconnected.|
| huks| Provides capabilities of key management, encryption, and decryption.| | huks| Provides capabilities of key management, encryption, and decryption.|
| System service management| Provides a unified OpenHarmony service development framework based on the service-oriented architecture.| | System service management| Provides a unified OpenHarmony service development framework based on the service-oriented architecture. |
| Boot| Provides the entry identifier for starting a system service. When the system service management is started, the function identified by bootstrap is called to start a system service.| | Boot| Provides the entry identifier for starting a system service. When the system service management is started, the function identified by bootstrap is called to start a system service.|
| System attribute| Provides capabilities of obtaining and setting system attributes.| | System attribute| Provides capabilities of obtaining and setting system attributes.|
| Base library| Provides the common basic library capability, including file operations and KV storage management.| | Base library| Provides the common basic library capability, including file operations and KV storage management.|
| DFX | Provides the DFX capability, such as logging and printing.| | DFX | Provides the DFX capability, such as logging and printing.|
| XTS | Provides a set of OpenHarmony certification test suites.| | XTS | Provides a set of certification test suites.|
# Introduction to the RK3568 Development Board # RK3568 Development Board
## Overview ## Overview
Bolstered by the Rockchip RK3568 chip, the RK3568 development board integrates a dual-core GPU and high-efficiency NPU. Its quad-core 64-bit Cortex-A55 processor uses the advanced 22 nm manufacturing process and is clocked at up to 2.0 GHz. The development board is packed with Bluetooth, Wi-Fi, audio, video, and camera features, with a wide range of expansion ports as well as video input and output ports. It comes with dual GE auto-sensing RJ45 ports, so it can be used in multi-connectivity products, such as NVRs and industrial gateways. Bolstered by the Rockchip RK3568 chip, the RK3568 development board integrates a dual-core GPU and high-efficiency NPU. Its quad-core 64-bit Cortex-A55 processor uses the advanced 22 nm manufacturing process and is clocked at up to 2.0 GHz. The development board is packed with Bluetooth, Wi-Fi, audio, video, and camera features, with a wide range of expansion ports as well as video input and output ports. It comes with dual GE auto-sensing RJ45 ports, so it can be used in multi-connectivity products, such as NVRs and industrial gateways.
**Figure 1** Front view of the RK3568 development board **Figure 1** RK3568 front view
![en-us_image_0000001271442261](figures/en-us_image_0000001271442261.png) ![rk3568-front](figures/rk3568-front.png)
**Figure 2** RK3568 rear view **Figure 2** RK3568 rear view
![en-us_image_0000001271322293](figures/en-us_image_0000001271322293.png) ![rk3568-rear](figures/rk3568-rear.png)
## Development Board Specifications ## Specifications
**Table 1** RK3568 specifications **Table 1** RK3568 specifications
| Item| Description| | Item| Description|
| -------- | -------- | | -------- | -------- |
| Display| -&nbsp;1 x HDMI 2.0 (Type-A) port, supporting 4K/60 fps output<br>-&nbsp;2 x MIPI, supporting 1920 x 1080\@60 fps output<br>-&nbsp; 1 x eDP, supporting 2K@60 fps output| | Display| - 1 x HDMI 2.0 (Type-A) port, supporting 4K/60 fps output<br>- 2 x MIPI, supporting 1920 x 1080\@60 fps output<br>- 1 x eDP, supporting 2K@60 fps output|
| Audio port| -&nbsp;1×8ch&nbsp;I2S/TDM/PDM<br>-&nbsp;1 x HDMI<br>-&nbsp;1 x speaker output<br>-&nbsp;1 x headset output<br>-&nbsp;1 x microphone for onboard audio input| | Audio| - 1 x 8ch I2S/TDM/PDM<br>- 1 x HDMI<br>- 1 x speaker output<br>- 1 x headset output<br>- 1 x microphone for onboard audio input|
| Ethernet port| 2 x GMAC (10/100/1000M)| | Ethernet| 2 x GMAC (10/100/1000M)|
| Wireless connectivity| SDIO port, supporting Wi-Fi 6 5G/2.5 GHz and Bluetooth 4.2| | Wireless connectivity| SDIO port, supporting Wi-Fi 6 5/2.5 GHz and Bluetooth 4.2|
| Camera port| MIPI-CSI2, 1 x 4-lane/2x2-lane\@2.5 Gbps/lane| | Camera| MIPI-CSI2, 1 x 4-lane/2x2-lane\@2.5 Gbps/lane|
| USB | -&nbsp;2 x USB 2.0 Host, Type-A<br>-&nbsp;1 x USB 3.0 Host, Type-A<br>-&nbsp;1×USB3.0&nbsp;OTG | | USB | - 2 x USB 2.0 Host, Type-A<br>- 1 x USB 3.0 Host, Type-A<br>- 1 x USB3.0 OTG |
| PCIe | 1 x 2-lane PCIe 3.0 Connector (RC mode)| | PCIe | 1 x 2-lane PCIe 3.0 Connector (RC mode)|
| SATA | 1×SATA3.0&nbsp;Connector | | SATA | 1 x SATA 3.0 Connector |
| SDMMC | 1×Micro&nbsp;SD&nbsp;Card3.0 | | SDMMC | 1 x memory card 3.0 |
| Keys| -&nbsp;1×Vol+/Recovery<br>-&nbsp;1×Reset<br>-&nbsp;1×Power<br>-&nbsp;1×Vol-<br>-&nbsp;Mute | | Keys| - 1 x Vol+/Recovery<br>- 1 x Reset<br>- 1 x Power<br>- 1 x Vol-<br>- 1 x Mute |
| Debugging port| 1 x Debugging serial port| | Debugging| 1 x Debugging serial port|
| RTC | 1 x RTC | | RTC | 1 x RTC |
| IR | 1 x IR | | IR | 1 x IR |
| Tri-color indicator| 3 x LED | | Tri-color indicator| 3 x LED |
| G-sensor | 1 x G-sensor | | G-sensor | 1 x G-sensor |
| Fan | 1 x fan | | Fan| 1 x fan|
| Expansion port| The 20-pin expansion ports include:<br>-&nbsp;2 x ADC<br>-&nbsp; 2 x I2C<br>-&nbsp;7 x GPIO (or 3 x GPIO + 4 x UART)<br>-&nbsp;3 x VCC power (12 V, 3.3 V, and 5 V)| | Expansion| The 20-pin expansion ports include:<br>- 2 x ADC<br>- 2 x I2C<br>- 7 x GPIO (or 3 x GPIO + 4 x UART)<br>- 3 x VCC power (12 V, 3.3 V, and 5 V)|
| Mother board dimensions| 180mm×130mm | | Mother board dimensions| 180 mm x 130 mm|
| PCB| 4-laminate| | PCB| 4-laminate|
# Overall Description of Compilation Form Factors
Products Supported for Compilation and Building (Click the links to learn about the specific product configurations and related differences.)
| Compilation Form Factor | Development Board | Main Chip | Kernel | System Type |
| ----------------------------- | --------------- | ----------- | ----------- | ----------- |
| [neptune100](https://gitee.com/openharmony/vendor_hihope/blob/master/neptune_iotlink_demo/config.json) | neptune100 | WinnerMicro | LiteOS-M | Mini |
| [rk3568](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/config.json) | rk3568 | Rockchip | Linux | Standard |
| [rk3568_mini_system](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568_mini_system/config.json) | rk3568 | Rockchip | Linux | Standard |
| [bearpi_hm_micro](https://gitee.com/openharmony/vendor_bearpi/blob/master/bearpi_hm_micro/config.json) | bearpi_hm_micro | STM32MP1xx | LiteOS-A | small |
| [bearpi_hm_nano](https://gitee.com/openharmony/vendor_bearpi/blob/master/bearpi_hm_nano/config.json) | bearpi_hm_nano | Hi3861 V100 | LiteOS-M | Mini |
| [wifiiot_hispark_pegasus](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_pegasus/config.json) | hispark_pegasus | Hi3861 V100 | LiteOS-M | Mini |
| [ipcamera_hispark_aries](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_aries/config.json) | hispark_aries | hi3518ev300 | LiteOS-A | Small |
| [ipcamera_hispark_taurus](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus/config.json) | hispark_taurus | Hi3516D V300 | LiteOS-A | Small |
| [ipcamera_hispark_taurus_linux](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_linux/config.json) | hispark_taurus | Hi3516D V300 | Linux | Small |
| [hispark_taurus_standard](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_standard/config.json) | hispark_taurus | Hi3516D V300 | Linux | Standard |
| [watchos](https://gitee.com/openharmony/vendor_hisilicon/blob/master/watchos/config.json) | hispark_taurus | Hi3516D V300 | Linux | Standard |
| [hispark_phoenix](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_phoenix/config.json) | hispark_phoenix | hi3751v350 | Linux | Standard |
| [hispark_taurus_mini_system](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_mini_system/config.json) | hispark_taurus | Hi3516D V300 | LiteOS-A | Mini |
| [hispark_pegasus_mini_system](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_pegasus_mini_system/config.json) | hispark_pegasus | Hi3861 V100 | LiteOS-M | Mini |
| [gr5515_sk_iotlink_demo](https://gitee.com/openharmony/vendor_goodix/blob/master/gr5515_sk_iotlink_demo/config.json) | gr5515_sk | GR551x | LiteOS-M | Mini |
| [gr5515_sk_xts_demo](https://gitee.com/openharmony/vendor_goodix/blob/master/gr5515_sk_xts_demo/config.json) | gr5515_sk | GR551x | LiteOS-M | Mini |
| [wifi_demo](https://gitee.com/openharmony/vendor_asrmicro/blob/master/wifi_demo/config.json) | dev_wifi_a | ASR582X | LiteOS-M | Mini |
| [xts_demo](https://gitee.com/openharmony/vendor_asrmicro/blob/master/xts_demo/config.json) | dev_wifi_a | ASR582X | LiteOS-M | Mini |
| [display_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/display_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [xts_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/xts_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [iotlink_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/iotlink_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [mini_distributed_music_player](https://gitee.com/openharmony/vendor_bestechnic/blob/master/mini_distributed_music_player/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [niobe407](https://gitee.com/openharmony/vendor_talkweb/blob/master/niobe407/config.json) | niobe407 | stm32f4xx | LiteOS-M | Mini |
| [qemu_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_mini_system_demo/config.json) | arm_mps2_an386 | QEMU | LiteOS-M | Mini |
| [qemu_cksy_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_csky_mini_system_demo/config.json) | SmartL_E802 | QEMU | LiteOS-M | Mini |
| [qemu_cm55_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_cm55_mini_system_demo/config.json) | arm_mps3_an547 | QEMU | LiteOS-M | Mini |
| [qemu_xtensa_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_xtensa_mini_system_demo/config.json) | esp32 | QEMU | LiteOS-M | Mini |
| [qemu_riscv_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_riscv32_mini_system_demo/config.json) | ricsv32_virt | QEMU | LiteOS-M | Mini |
| [qemu_ca7_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_ca7_mini_system_demo/config.json) | arm_virt | QEMU | LiteOS-A | Small |
| [qemu_small_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_small_system_demo/config.json) | arm_virt | QEMU | LiteOS-A | Small |
| [qemu_arm_linux_min](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_arm_linux_min/config.json) | qemu-arm-linux | QEMU | Linux | Standard |
| [qemu_arm_linux_headless](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_arm_linux_headless/config.json) | qemu-arm-linux | QEMU | Linux | Standard |
| [iotlink_demo](https://gitee.com/openharmony/vendor_chipsea/blob/master/iotlink_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini |
| [dsoftbus_demo](https://gitee.com/openharmony/vendor_chipsea/blob/master/dsoftbus_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini |
| [xts_demo](https://gitee.com/openharmony/vendor_chipsea/blob/master/xts_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini |
# Building Source Code
With DevEco Device Tool, you can easily build source code of the Hi3516DV300 development board, thanks to its productivity-boosting features, such as the compiler toolchain, detection of the build environment dependencies, and one-click installation of the dependencies.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> The build environment of Hi3516DV300 is Ubuntu.
1. Click **Project Settings** on the menu bar to access the Hi3516DV300 project configuration page.
![en-us_image_0000001274745038](figures/en-us_image_0000001274745038.png)
2. On the **Tool Chain** tab page, DevEco Device Tool automatically checks whether the dependent compiler toolchain is complete. If a message is displayed indicating that some tools are missing, click **Install** to automatically install the required tools.
![en-us_image_0000001307480750](figures/en-us_image_0000001307480750.png)
3. Install the toolchain related to Hi3516DV300. Certain tools may require the root access to install. In this case, enter the user password in the **TERMINAL** window.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> - If pip fails to be installed, [change the Python source](https://device.harmonyos.com/en/docs/documentation/guide/ide-set-python-source-0000001227639986) and try again.
> - If APT fails to be installed, [change the APT source](https://device.harmonyos.com/en/docs/documentation/guide/faq-toolchain-install-0000001301623822) and try again.
![en-us_image_0000001360080305](figures/en-us_image_0000001360080305.png)
After the toolchain is automatically installed, the figure below is displayed.
![en-us_image_0000001307320918](figures/en-us_image_0000001307320918.png)
4. On the **ipcamera_hispark_taurus** tab page, set **build_type**, whose default value is **debug**.
![en-us_image_0000001307160958](figures/en-us_image_0000001307160958.png)
5. Choose **PROJECT TASKS** > **ipcamera_hispark_taurus** > **Build** to start building.
![en-us_image_0000001360439881](figures/en-us_image_0000001360439881.png)
6. Wait until **SUCCESS** is displayed in the **TERMINAL** window, indicating that the build is complete.
![en-us_image_0000001307480754](figures/en-us_image_0000001307480754.png)
After the building is complete, go to the **out** directory of the project to view the generated files, which are needed for [burning an image](quickstart-ide-3516-burn.md).
# Burning # Burning an Image
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently. Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
Hi3516D V300 supports burning through the USB port, network port, and serial port. This document describes how to burn source code through the USB port in Windows. The images of Hi3516DV300 are burnt in the Windows environment. After burning is initiated, DevEco Device Tool copies the target program files generated in the Ubuntu environment to the specified Windows directory in remote mode, and then burns the program files to Hi3516DV300 using the Windows burning tool.
## Importing Source Code Hi3516D V300 supports burning for the small system through the USB port, network port, and serial port. This document describes how to burn source code through the USB port.
After the building is complete, ensure that you can [remotely access the Ubuntu environment from Windows](quickstart-lite-env-setup.md). Then, perform the following steps to import the source code before burning:
1. Open DevEco Device Tool, go to the home page, and click **Import Project** to open your project or source code. ## Prerequisites
![en-us_image_0000001278358765](figures/en-us_image_0000001278358765.png) - [Source code building](quickstart-ide-3516-build.md) has been completed.
2. Select the root directory of the OpenHarmony source code (in Ubuntu), select **Import OpenHarmony Source**, and click **Import**. - The serial port driver has been installed on Hi3516DV300. For details, see [Installing the Serial Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/hi3516_hi3518-drivers-0000001050743695).
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/> - The USB port driver has been installed on Hi3516DV300. For details, see [Installing the USB Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393).
> Make sure the selected directory does not contain Chinese characters or spaces.
![en-us_image_0000001271477045](figures/en-us_image_0000001271477045.png)
3. On the **Import Project** page, select a product, and the SoC, board, company, and kernel fields will be automatically populated. Then, select the OpenHarmony source code version for **Ohos Ver**. ## Procedure
![en-us_image_0000001279586409](figures/en-us_image_0000001279586409.png) 1. Connect the computer and the target development board through the serial port and USB port. For details, see [Hi3516 Development Board](quickstart-appendix-hi3516.md).
4. Click **Open** to open the project or source code. 2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
- If ![en-us_image_0000001326512673](figures/en-us_image_0000001326512673.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001275432904](figures/en-us_image_0000001275432904.png) is displayed, click the connect icon. During the connection, DevEco Device Tool will restart. Therefore, to avoid task interruptions, do not connect to DevEco Device Tool when downloading or building source code.
## Burning ![en-us_image_0000001285658392](figures/en-us_image_0000001285658392.png)
After the source code is imported, perform the following steps: 3. Click **Project Settings** on the menu bar to access the Hi3516DV300 project configuration page.
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516 Development Board](quickstart-lite-introduction-hi3516.md). ![en-us_image_0000001275752808](figures/en-us_image_0000001275752808.png)
2. If your computer does not have the USB port driver or USB-to-serial driver, install it by following the instructions in [Installing the Serial Port Driver on the Hi3516D V300 or Hi3751 V350 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/hi3516_hi3518-drivers-0000001050743695) or [Installing the USB Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393), depending on the missing driver. 4. On the **Tool Chain** tab page, set the Uploader burning tool. You can click **Install** on this page to install the tool online.
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment). ![Phoenix-upload](figures/Phoenix-upload.png)
- If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required. 5. On the **hi3516dv300** tab page, set the burning options. The settings are automatically saved.
- If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. During the connection, DevEco Device Tool will restart. Therefore, to avoid task interruptions, do not connect to DevEco Device Tool when downloading or building source code. - **upload_partitions**: Select the file to be burnt. By default, the **fastboot**, **kernel**, **rootfs**, and **userfs** files are burnt at the same time. Check the preset information of the files to be burnt and modify them when necessary. To modify the burning settings for a specific file, click ![en-us_image_0000001275592884](figures/en-us_image_0000001275592884.png) next to the file.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png)
4. Click **Project Settings** on the menu bar to access the Hi3516D V300 project configuration page.
![en-us_image_0000001198566364](figures/en-us_image_0000001198566364.png)
5. On the **Tool Chain** tab page, set the Uploader burning tool. You can click **Install** on this page to install the tool online.
![en-us_image_0000001198566365](figures/en-us_image_0000001198566365.png)
6. On the **hi3516dv300** tab page, set the burning options.
- **upload_partitions**: Select the file to be burnt. By default, the **fastboot**, **kernel**, **rootfs**, and **userfs** files are burnt at the same time. Check the preset information of the files to be burnt and modify them when necessary. To modify the burning settings for a specific file, click ![en-us_image_0000001275592884.png](figures/en-us_image_0000001275592884.png) next to the file.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> Set the start address and length of the partition based on the size of the files to be burnt. Make sure the size of the partition is greater than that of the files to be burnt and the partition addresses of the files to be burnt do not overlap. > Set the start address and length of the partition based on the size of the files to be burnt. Make sure the size of the partition is greater than that of the files to be burnt and the partition addresses of the files to be burnt do not overlap.
![en-us_image_0000001312778829](figures/en-us_image_0000001312778829.png) ![3516-small-partitions](figures/3516-small-partitions.png)
- **upload_protocol**: Select the burning protocol **hiburn-usb**. - **upload_protocol**: Select the burning protocol **hiburn-usb**.
- **upload_port**: Select the serial port number obtained. - **upload_port**: Select the serial port number obtained.
![en-us_image_0000001223190441](figures/en-us_image_0000001223190441.png) ![3516-small-usb](figures/3516-small-usb.png)
7. When you finish modifying, click **Save** on the top.
8. Choose **hi3516dv300** > **Upload** to transfer the files to be burnt from Ubuntu to Windows. 6. Choose **hi3516dv300** > **Upload** to transfer the files to be burnt from Ubuntu to Windows.
![en-us_image_0000001266887264](figures/en-us_image_0000001266887264.png) ![en-us_image_0000001326234609](figures/en-us_image_0000001326234609.png)
When the "Operation paused, Please press Enter key to continue" message is displayed, which indicates that the transfer is complete, press **Enter** to start burning. When the "Operation paused, Please press Enter key to continue" message is displayed, which indicates that the transfer is complete, press **Enter** to start burning.
![en-us_image_0000001114129426](figures/en-us_image_0000001114129426.png) ![en-us_image_0000001275835836](figures/en-us_image_0000001275835836.png)
9. When the following information is displayed in the **TERMINAL** window, press and hold the **Update** key within 15 seconds, remove and insert the USB cable, and then release the **Update** key to start burning. 7. When the following information is displayed in the **TERMINAL** window, press and hold the **Update** key within 15 seconds, remove and insert the USB cable, and then release the **Update** key to start burning.
![en-us_image_0000001326412233.png](figures/en-us_image_0000001326412233.png) ![en-us_image_0000001326412233](figures/en-us_image_0000001326412233.png)
When the "SUCCESS" message is displayed, it indicates that the burning is successful. When the "SUCCESS" message is displayed, it indicates that the burning is successful.
![en-us_image_0000001160649343](figures/en-us_image_0000001160649343.png) ![en-us_image_0000001276317464](figures/en-us_image_0000001276317464.png)
10. When the burning is successful, perform the operations in "Running" to start the system. 8. When the burning is successful, perform the operations in [Running](quickstart-ide-3516-running.md) to start the system.
# Writing a Hello World Program # Writing a Hello World Program
The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!" . The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!"
## Prerequisites
A project for the Hi3516 development board has been created as instructed in [Creating a Project and Obtaining Source Code](quickstart-ide-import-project.md).
## Example Directory ## Example Directory
...@@ -58,7 +63,11 @@ Perform the steps below in the source code directory: ...@@ -58,7 +63,11 @@ Perform the steps below in the source code directory:
3. Add a component. 3. Add a component.
Modify the **build/lite/components/communication.json** file and add the configuration of **hello_world_app**. The following code snippet is a snippet of the **communication.json** file: The configuration between \#\#start\#\# and \#\#end\#\# is new. (\#\#start\#\# and \#\#end\#\# are only used to identify the location. After the configuration is complete, delete these lines.) Modify the **build/lite/components/applications.json** file and add the configuration of **hello_world_app**. The following code snippet is a snippet of the **applications.json** file, where the configuration between **\#\#start\#\#** and **\#\#end\#\#** is the new entry. (The **\#\#start\#\#** and **\#\#end\#\#** lines are only used to identify the location. After the configuration is complete, delete these lines.)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> In this example, the OpenHarmony-v3.1-Release version is used, where the component configuration file is **build/lite/components/applications.json**. In OpenHarmony-v3.2-Beta2 and later versions, the component configuration file is **build/lite/components/communication.json**.
``` ```
...@@ -121,7 +130,7 @@ Perform the steps below in the source code directory: ...@@ -121,7 +130,7 @@ Perform the steps below in the source code directory:
4. Modify the board configuration file. 4. Modify the board configuration file.
Modify the **vendor/hisilicon/hispark_taurus/config.json** file and add an entry of the **hello_world_app** component. The following code snippet is the configuration of the **applications** subsystem, the configuration between \#\#start\#\# and \#\#end\#\# is new. (\#\#start\#\# and \#\#end\#\# are only used to identify the location. After the configuration is complete, delete these lines.) Modify the **vendor/hisilicon/hispark_taurus/config.json** file and add an entry for the **hello_world_app** component. The following code snippet is the configuration of the **applications** subsystem, where the configuration between **\#\#start\#\#** and **\#\#end\#\#** is the new entry. (The **\#\#start\#\#** and **\#\#end\#\#** lines are only used to identify the location. After the configuration is complete, delete these lines.)
``` ```
......
# Running # Running an Image
## Starting the System ## Starting the System
After burning is completed, you need to configure the bootloader to run the OpenHarmony system. After burning is completed, you must configure the bootloader to run the OpenHarmony system.
1. In the Hi3516D V300 task, click **Configure bootloader (Boot OS)** to configure the bootloader. 1. In the Hi3516D V300 task, click **Configure bootloader (Boot OS)** to configure the bootloader.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> The bootloader configuration in DevEco Device Tool has been adapted to Hi3516D V300. Therefore, no manual modification is needed. > The bootloader configuration in DevEco Device Tool has been adapted to Hi3516D V300. Therefore, no manual modification is needed.
![en-us_image_0000001226794644](figures/en-us_image_0000001226794644.png) ![bootloader](figures/bootloader.png)
2. When the message shown below is displayed, restart the development board. If "SUCCESS" is displayed, it indicates that the configuration is successful. 2. When the message shown below is displayed, restart the development board. If "SUCCESS" is displayed, it indicates that the configuration is successful.
![en-us_image_0000001227114584](figures/en-us_image_0000001227114584.png) ![reset_success](figures/reset_success.png)
3. Click **Monitor** on the taskbar to start the serial port tool. 3. Click **Monitor** on the taskbar to start the serial port tool.
![en-us_image_0000001271234705](figures/en-us_image_0000001271234705.png) ![monitor](figures/monitor.png)
4. When the command output is displayed, press **Enter** until **OHOS #** is displayed, indicating that the system is started successfully. 4. When the command output is displayed, press **Enter** until **OHOS \#** is displayed, indicating that the system is started successfully.
![en-us_image_0000001271594709](figures/en-us_image_0000001271594709.png) ![reboot-success](figures/reboot-success.png)
## Running a Hello World Program ## Running a Hello World Program
...@@ -31,21 +31,25 @@ After the system is started, perform the following steps to run the Hello World ...@@ -31,21 +31,25 @@ After the system is started, perform the following steps to run the Hello World
1. Go to the **bin** directory on the startup page. 1. Go to the **bin** directory on the startup page.
``` ```shell
cd bin cd bin
``` ```
2. Run the following command to run the **helloworld** program: 2. Run the following command to run the **helloworld** program:
``` ```shell
./helloworld ./helloworld
``` ```
If the message "Hello World!" is displayed, the program runs successfully. If the message "Hello World!" is displayed, the program runs successfully.
![en-us_image_0000001271354693](figures/en-us_image_0000001271354693.png) ![en-us_image_0000001360320977](figures/en-us_image_0000001360320977.png)
## Next ## Next
Congratulations! You have finished all steps! Proceed to [develop a sample camera with a screen](../guide/device-camera-control-overview.md) to better familiarize yourself with OpenHarmony development. Congratulations! You have finished all steps! Proceed to develop samples to better familiarize yourself with OpenHarmony development:
- [Screen and Camera Control](../guide/device-camera-control-overview.md)
- [Visual Application Development](../guide/device-camera-visual-overview.md)
# Building Source Code
With DevEco Device Tool, you can easily build source code of the Rockchip RK3568 development board, thanks to its productivity-boosting features, such as the compiler toolchain, detection of the build environment dependencies, and one-click installation of the dependencies.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> The build environment of RK3568 is Ubuntu.
1. Click **Project Settings** on the menu bar to access the RK3568 project configuration page.
![en-us_image_0000001327669509](figures/en-us_image_0000001327669509.png)
2. On the **Tool Chain** tab page, DevEco Device Tool automatically checks whether the dependent compiler toolchain is complete. If a message is displayed indicating that some tools are missing, click **Install** to automatically install the required tools.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> - If pip fails to be installed, [change the Python source](https://device.harmonyos.com/en/docs/documentation/guide/ide-set-python-source-0000001227639986) and try again.
> - If APT fails to be installed, [change the APT source](https://device.harmonyos.com/en/docs/documentation/guide/faq-toolchain-install-0000001301623822) and try again.
![en-us_image_0000001292531806](figures/en-us_image_0000001292531806.png)
Install the toolchain related to RK3568. Certain tools may require the root access to install. In this case, enter the user password in the **TERMINAL** window.
![en-us_image_0000001327429541](figures/en-us_image_0000001327429541.png)
After the toolchain is automatically installed, the figure below is displayed.
![en-us_image_0000001349388493](figures/en-us_image_0000001349388493.png)
3. On the **rk3568** tab page, set **build_type**, whose default value is **debug**.
![en-us_image_0000001276354454](figures/en-us_image_0000001276354454.png)
4. Choose **PROJECT TASKS** > **rk3568** > **Build** to start building.
![en-us_image_0000001265516901](figures/en-us_image_0000001265516901.png)
5. Wait until **SUCCESS** is displayed in the **TERMINAL** window, indicating that the build is complete.
![en-us_image_0000001307162054](figures/en-us_image_0000001307162054.png)
After the building is complete, go to the **out** directory of the project to view the generated files, which are needed for [burning an image](quickstart-ide-3568-burn.md).
# Burning an Image
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
The images of RK3568 are burnt in the Windows environment. After burning is initiated, DevEco Device Tool copies the target program files generated in the Ubuntu environment to the specified Windows directory in remote mode, and then burns the program files to RK3568 using the Windows burning tool.
## Prerequisites
[Download](https://gitee.com/hihope_iot/docs/blob/master/HiHope_DAYU200/%E7%83%A7%E5%86%99%E5%B7%A5%E5%85%B7%E5%8F%8A%E6%8C%87%E5%8D%97/windows/DriverAssitant_v5.1.1.zip) and install **DriverInstall.exe**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If the burning tool of an earlier version has been installed, uninstall it first.
## Procedure
1. Connect the computer and the target development board through the USB port. For details, see [RK3568 Development Board](quickstart-appendix-rk3568.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
- If ![en-us_image_0000001326512673](figures/en-us_image_0000001326512673.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001275432904](figures/en-us_image_0000001275432904.png) is displayed, click the connect icon. During the connection, DevEco Device Tool will restart. Therefore, to avoid task interruptions, do not connect to DevEco Device Tool when downloading or building source code.
![en-us_image_0000001285658392](figures/en-us_image_0000001285658392.png)
3. Click **Project Settings** on the menu bar to access the RK3568 project configuration page.
![en-us_image_0000001330777737](figures/en-us_image_0000001330777737.png)
4. On the **Tool Chain** tab page, set the Uploader burning tool. You can click **Install** on this page to install the tool online.
![3865-uploader](figures/3865-uploader.png)
5. On the **rk3568** tab page, set the burning options. The settings are automatically saved.
- **upload_partitions_profile**: Select the burning profile file, which specifies the files to be burnt, start address and length of the partition, and other burning settings. In addition, select **Enable to use upload_partitions_profile**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> In the burning profile file, you can change the start address and length of the partition based on the size of the files to be burnt. Make sure the size of the partition is greater than that of the files to be burnt and the partition addresses of the files do not overlap.
>
> If this is the first time you burn files to the development board, select **Enable to use upload_partitions_profile for upload** so that the upload_partitions file will be automatically generated. Afterward, select **Enable to use upload_partitions_profile for upload** only when you need to generate a new **upload_partitions** file.
- **upload_protocol**: Select the burning protocol **upgrade**.
![en-us_image_0000001338663697](figures/en-us_image_0000001338663697.png)
6. Choose **PROJECT TASKS** > **rk3568** > **Upload** to start burning.
![en-us_image_0000001280147358](figures/en-us_image_0000001280147358.png)
7. If the message "Operation paused, Please press Enter key to continue" is displayed, press **Enter**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If the message "The board is not in Loader mode. Please Hold on the VOL+key..." is displayed, place the development board in Loader mode as follows: Press and hold the Volume+ key for 3 seconds, press the RESET key, wait for 3 seconds, and then release the Volume+ key.
Wait until the burning is complete. If the following message is displayed, the burning is successful.
![en-us_image_0000001327549705](figures/en-us_image_0000001327549705.png)
...@@ -4,6 +4,11 @@ ...@@ -4,6 +4,11 @@
The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!" . The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!" .
## Prerequisites
A project for the RK3568 development board has been created as instructed in [Creating a Project and Obtaining Source Code](quickstart-ide-import-project.md).
## Example Directory ## Example Directory
The complete code directory is as follows: The complete code directory is as follows:
...@@ -19,9 +24,9 @@ applications/sample/hello ...@@ -19,9 +24,9 @@ applications/sample/hello
├── bundle.json ├── bundle.json
build build
└── subsystem_config.json └── subsystem_config.json
vendor/hisilicon productdefine/common
└── Hi3516DV300 └── products
└── config.json └── rk3568.json
``` ```
...@@ -29,7 +34,6 @@ vendor/hisilicon ...@@ -29,7 +34,6 @@ vendor/hisilicon
Perform the steps below in the source code directory: Perform the steps below in the source code directory:
1. Create a directory and write the service code. 1. Create a directory and write the service code.
Create the **applications/sample/hello/src/helloworld.c** directory and file whose code is shown in the following example. You can customize the content to be printed. For example, you can change **World** to **OHOS**. Declare the string printing function **HelloPrint** in the **helloworld.h** file. You can use either C or C++ to develop a program. Create the **applications/sample/hello/src/helloworld.c** directory and file whose code is shown in the following example. You can customize the content to be printed. For example, you can change **World** to **OHOS**. Declare the string printing function **HelloPrint** in the **helloworld.h** file. You can use either C or C++ to develop a program.
...@@ -76,7 +80,6 @@ Perform the steps below in the source code directory: ...@@ -76,7 +80,6 @@ Perform the steps below in the source code directory:
``` ```
2. Create a build file. 2. Create a build file.
1. Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows: 1. Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows:
``` ```
...@@ -85,7 +88,7 @@ Perform the steps below in the source code directory: ...@@ -85,7 +88,7 @@ Perform the steps below in the source code directory:
sources = [ # Source code of the module. sources = [ # Source code of the module.
"src/helloworld.c" "src/helloworld.c"
] ]
include_dirs = [ # Directory of header file on which the module depends. include_dirs = [ # Directory of header files on which the module depends.
"include" "include"
] ]
cflags = [] cflags = []
...@@ -135,7 +138,7 @@ Perform the steps below in the source code directory: ...@@ -135,7 +138,7 @@ Perform the steps below in the source code directory:
} }
``` ```
The **bundle.json** file consists of two parts. The first part describes the information about the subsystem to which the component belongs, and the second part defines the component building configuration. When adding a part, you need to specify the **sub_component** contained in the part. If there are interfaces provided for other components, describe them in **inner_kits**. If there are test cases, describe them in **test**. The **bundle.json** file consists of two parts. The first part describes the information about the subsystem to which the component belongs, and the second part defines the build configuration for the component. When adding a component, you must specify the **sub_component** of the component. If there are APIs provided for other components, add them in **inner_kits**. If there are test cases, add them in **test**.
3. Modify the subsystem configuration file. 3. Modify the subsystem configuration file.
...@@ -151,7 +154,10 @@ Perform the steps below in the source code directory: ...@@ -151,7 +154,10 @@ Perform the steps below in the source code directory:
4. Modify the product configuration file. 4. Modify the product configuration file.
In the vendor\hisilicon\Hi3516DV300\config.json file, add the hello part after the existing part. In the **productdefine/common/products/rk3568.json** file, add the **hello** part after the existing part.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> In this example, the OpenHarmony-v3.1-Release version is used, where the RK3568 configuration file is **productdefine/common/products/rk3568.json**. In a version later than OpenHarmony-v3.1-Release, the RK3568 configuration file is **vendor/hihope/rk3568/config.json**.
``` ```
......
# Running # Running an Image
## Starting the System ## Starting the System
...@@ -7,15 +7,15 @@ After the image is burnt and the development board is restarted, the system auto ...@@ -7,15 +7,15 @@ After the image is burnt and the development board is restarted, the system auto
**Figure 1** System startup effect **Figure 1** System startup effect
![en-us_image_0000001226762222](figures/en-us_image_0000001226762222.jpg) ![quickstart-pkg-3568-running-restart](figures/quickstart-pkg-3568-running-restart.png)
## Running a Hello World Program ## Running a Hello World Program
1. When the system is running, start the serial port tool (for example, PuTTY), set the baud rate to **1500000**, and connect to the device. 1. When the system is running, start the serial port tool (for example, PuTTY), set the baud rate to **1500000**, and connect to the device.
![en-us_image_0000001226602250](figures/en-us_image_0000001226602250.png) ![rk3568-run-configuration](figures/rk3568-run-configuration.png)
2. Enable the serial port, enter the **helloworld** command in any directory (for example, the root directory of the device) and press **Enter**. If the message "Hello World!" is displayed, the program runs successfully. 2. Enable the serial port, enter the **helloworld** command in any directory (for example, the root directory of the device) and press **Enter**. If the message "Hello World!" is displayed, the program runs successfully.
![en-us_image_0000001226922154](figures/en-us_image_0000001226922154.png) ![helloworld](figures/helloworld.png)
# Building Source Code
With DevEco Device Tool, you can easily build source code of the Hi3861V100 development board, thanks to its productivity-boosting features, such as the compiler toolchain, detection of the build environment dependencies, and one-click installation of the dependencies.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> The build environment of Hi3861V100 is Ubuntu.
1. Click **Project Settings** on the menu bar to access the Hi3861V100 project configuration page.
![en-us_image_0000001275483042](figures/en-us_image_0000001275483042.png)
2. On the **Tool Chain** tab page, DevEco Device Tool automatically checks whether the dependent compiler toolchain is complete. If a message is displayed indicating that some tools are missing, click **Install** to automatically install the required tools.
![en-us_image_0000001333256741](figures/en-us_image_0000001333256741.png)
3. Install the toolchain related to Hi3861V100. Certain tools may require the root access to install. In this case, enter the user password in the **TERMINAL** window.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> - If pip fails to be installed, [change the Python source](https://device.harmonyos.com/en/docs/documentation/guide/ide-set-python-source-0000001227639986) and try again.
> - If APT fails to be installed, [change the APT source](https://device.harmonyos.com/en/docs/documentation/guide/faq-toolchain-install-0000001301623822) and try again.
![en-us_image_0000001280938208](figures/en-us_image_0000001280938208.png)
After the toolchain is automatically installed, the figure below is displayed.
![en-us_image_0000001281378224](figures/en-us_image_0000001281378224.png)
4. On the **wifiiot_hispark_pegasus** tab page, set **build_type**, whose default value is **debug**.
![en-us_image_0000001333581089](figures/en-us_image_0000001333581089.png)
5. Choose **PROJECT TASKS** > **wifiiot_hispark_pegasus** > **Build** to start building.
![en-us_image_0000001281221352](figures/en-us_image_0000001281221352.png)
6. Wait until **SUCCESS** is displayed in the **TERMINAL** window, indicating that the build is complete.
![en-us_image_0000001405938781](figures/en-us_image_0000001405938781.png)
After the building is complete, go to the **out** directory of the project to view the generated files, which are needed for [burning an image](quickstart-ide-3861-burn.md).
# Burning an Image
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
The images of Hi3861V100 are burnt in the Windows environment. After burning is initiated, DevEco Device Tool copies the target program files generated in the Ubuntu environment to the specified Windows directory in remote mode, and then burns the program files to Hi3861V100 using the Windows burning tool.
## Prerequisites
- [Source code building](quickstart-ide-3861-build.md) has been completed.
- The USB-serial adapter driver has been installed. For details, see [Installing the USB-Serial Adapter Driver](https://device.harmonyos.com/en/docs/documentation/guide/hi3861-drivers-0000001058153433).
## Procedure
1. Connect the computer and the target development board through the USB port. For details, see [Hi3861 Development Board](quickstart-appendix-hi3861.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
- If ![en-us_image_0000001326512673](figures/en-us_image_0000001326512673.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001275432904](figures/en-us_image_0000001275432904.png) is displayed, click the connect icon. During the connection, DevEco Device Tool will restart. Therefore, to avoid task interruptions, do not connect to DevEco Device Tool when downloading or building source code.
![en-us_image_0000001285658392](figures/en-us_image_0000001285658392.png)
3. Click **Project Settings** on the menu bar to access the Hi3861 V100 project configuration page.
![en-us_image_0000001333802045](figures/en-us_image_0000001333802045.png)
4. On the **Tool Chain** tab page, set the Uploader burning tool. You can click **Install** on this page to install the tool online.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If a later version of Uploader is available or another burning tool is required, select it in **Uploader** > **Use Custom Burn Tool**.
![Phoenix-upload](figures/Phoenix-upload.png)
5. On the **hi3861** tab page, set the burning options. The settings are automatically saved.
- **upload_port**: Select the serial port number obtained.
- **upload_protocol**: Select the burning protocol **hiburn-serial**.
- **upload_partitions**: Select the file for burning. To modify the burning settings for a specific file, click ![en-us_image_0000001333642545](figures/en-us_image_0000001333642545.png) next to the file.
![en-us_image_0000001345770181](figures/en-us_image_0000001345770181.png)
6. Choose **PROJECT TASKS** > **hi3861** > **Upload** to start burning.
![en-us_image_0000001333322693](figures/en-us_image_0000001333322693.png)
7. When the following information is displayed, press the RST key on the development board within 15 seconds to restart it.
![hi3861-upload-restart](figures/hi3861-upload-restart.png)
Wait until the burning is complete. When the following message is displayed, the burning is successful.
![en-us_image_0000001281002722](figures/en-us_image_0000001281002722.png)
...@@ -4,11 +4,18 @@ ...@@ -4,11 +4,18 @@
The following exemplifies how to create a program by modifying the source code. The created program outputs the message "Hello world." Perform the steps below in the source code directory. The following exemplifies how to create a program by modifying the source code. The created program outputs the message "Hello world." Perform the steps below in the source code directory.
## Prerequisites
A project for the Hi3861 development board has been created as instructed in [Creating a Project and Obtaining Source Code](quickstart-ide-import-project.md).
## Procedure
1. Determine the directory structure. 1. Determine the directory structure.
Before compiling a service, you must create a directory (or a directory structure) in **./applications/sample/wifi-iot/app** to store source code files. Before writing service code, you must create a directory (or a directory structure) in **./applications/sample/wifi-iot/app** to store source code files.
For example, add the **my_first_app** service to the **app** directory, where **hello_world.c** is the service code and **BUILD.gn** is the compilation script. The directory structure is shown as follows: For example, to add the **my_first_app** service to the **app** directory, where the **hello_world.c** file stores the service code and **BUILD.gn** is the compilation script, the directory structure can be planned as follows:
``` ```
...@@ -24,7 +31,7 @@ The following exemplifies how to create a program by modifying the source code. ...@@ -24,7 +31,7 @@ The following exemplifies how to create a program by modifying the source code.
2. Write the service code. 2. Write the service code.
Create the **hello_world.c** file in **./applications/sample/wifi-iot/app/my_first_app**. Then, create the service entry function **HelloWorld** in **hello_world.c** and implement service logic. Call **SYS_RUN()** of OpenHarmony to start the service. (**SYS_RUN** is defined in the **ohos_init.h** file.) Create the **hello_world.c** file in **./applications/sample/wifi-iot/app/my_first_app**. Then, create the entry point function **HelloWorld** in **hello_world.c** and implement service logic. Call **SYS_RUN()** of OpenHarmony to start the service. (**SYS_RUN** is defined in the **ohos_init.h** file.)
``` ```
#include <stdio.h> #include <stdio.h>
...@@ -62,7 +69,11 @@ The following exemplifies how to create a program by modifying the source code. ...@@ -62,7 +69,11 @@ The following exemplifies how to create a program by modifying the source code.
4. Add a component. 4. Add a component.
Modify the **build/lite/components/communication.json** file and add the configuration of **hello_world_app**. The following code snippet is a snippet of the **communication.json** file: The configuration between \#\#start\#\# and \#\#end\#\# is new. (\#\#start\#\# and \#\#end\#\# are only used to identify the location. After the configuration is complete, delete these lines.) Modify the **build/lite/components/applications.json** file and add the configuration of **hello_world_app**. The following code snippet is a snippet of the **applications.json** file, where the configuration between **\#\#start\#\#** and **\#\#end\#\#** is the new entry. (The **\#\#start\#\#** and **\#\#end\#\#** lines are only used to identify the location. After the configuration is complete, delete these lines.)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> In this example, the OpenHarmony-v3.1-Release version is used, where the component configuration file is **build/lite/components/applications.json**. In OpenHarmony-v3.2-Beta2 and later versions, the component configuration file is **build/lite/components/communication.json**.
``` ```
...@@ -125,7 +136,7 @@ The following exemplifies how to create a program by modifying the source code. ...@@ -125,7 +136,7 @@ The following exemplifies how to create a program by modifying the source code.
5. Modify the board configuration file. 5. Modify the board configuration file.
Modify the **vendor/hisilicon/hispark_pegasus/config.json** file and add an entry of the **hello_world_app** component. The following code snippet is the configuration of the **applications** subsystem, the configuration between \#\#start\#\# and \#\#end\#\# is new. (\#\#start\#\# and \#\#end\#\# are only used to identify the location. After the configuration is complete, delete these lines.) Modify the **vendor/hisilicon/hispark_pegasus/config.json** file and add an entry for the **hello_world_app** component. The following code snippet is the configuration of the **applications** subsystem, where the configuration between **\#\#start\#\#** and **\#\#end\#\#** is the new entry. (The **\#\#start\#\#** and **\#\#end\#\#** lines are only used to identify the location. After the configuration is complete, delete these lines.)
``` ```
......
# Running an Image
## Networking Configuration
After you have completed building and burning, perform the following to connect the Hi3861 WLAN module to the Internet.
1. While the Windows workbench is connected to the Hi3861 WLAN module, choose **PROJECT TASKS** > **Monitor** to start the serial port terminal.
**Figure 1** Starting the serial port terminal
![quickstart-ide-3861-running-mirror](figures/quickstart-ide-3861-running-mirror.png)
2. Reset the Hi3861 WLAN module. The message **ready to OS start** is displayed on the **TERMINAL** panel, indicating that the WLAN module is started successfully.
**Figure 2** Successful resetting of the Hi3861 WLAN module
![quickstart-ide-3861-running-restart](figures/quickstart-ide-3861-running-restart.png)
3. Run the following AT commands in sequence via the serial port terminal to start the STA mode, connect to the specified AP, and enable Dynamic Host Configuration Protocol (DHCP).
```
AT+STARTSTA # Start the STA mode.
AT+SCAN # Scan for available APs.
AT+SCANRESULT # Display the scanning result.
AT+CONN="SSID",,2,"PASSWORD" # Connect to the specified AP. (SSID and PASSWORD represent the name and password of the hotspot to be connected, respectively.)
AT+STASTAT # View the connection result.
AT+DHCP=wlan0,1 # Request the IP address of wlan0 from the AP using DHCP.
```
4. Check whether the Hi3861 WLAN module is properly connected to the gateway, as shown in the following figure.
```
AT+IFCFG # View the IP address assigned to an interface of the module.
AT+PING=X.X.X.X # Check the connectivity between the module and the gateway. Replace X.X.X.X with the actual gateway address.
```
**Figure 3** Successful networking of the Hi3861 WLAN module
![quickstart-ide-3861-running-success](figures/quickstart-ide-3861-running-success.png)
## Verification
When the burning and networking are complete, you can use either of the following methods to debug and verify whether the source code has been burnt correctly:
1. Using printf to print logs
2. Using ASM files to locate issues
In simple use cases, as in this example, use the **printf** method. The following describes the two methods in detail.
### Using printf to Print Logs
Add the **printf** function to a key service path or where an exception occurs. The logs will be displayed through the serial port. The following is a code snippet of how to add **printf**:
```
void HelloWorld(void)
{
printf("[DEMO] Hello world.\n");
}
```
### Using ASM Files to Locate Issues
If the system exits abnormally, the call stack information about the abnormal exit is displayed on the serial port. Analyze the displayed information to troubleshoot and pinpoint issues.
```
=======KERNEL PANIC=======
**Call Stack*
Call Stack 0 -- 4860d8 addr:f784c
Call Stack 1 -- 47b2b2 addr:f788c
Call Stack 2 -- 3e562c addr:f789c
Call Stack 3 -- 4101de addr:f78ac
Call Stack 4 -- 3e5f32 addr:f78cc
Call Stack 5 -- 3f78c0 addr:f78ec
Call Stack 6 -- 3f5e24 addr:f78fc
Call Stack end***
```
To analyze the call stack information, the **Hi3861_wifiiot_app.asm** file is required. This file records the symbol addresses of the functions in the code in the flash memory and the disassembly information. The ASM file is built and output together with the version software package and is stored in the **./out/wifiiot/** directory.
1. (Optional) Save the call stack information to a TXT file for editing.
2. Open the ASM file, search for the function address in each call stack, and list the corresponding function. Generally, you only need to find the functions matching the first several stacks to locate issues.
```
Call Stack 0 -- 4860d8 addr:f784c -- WadRecvCB
Call Stack 1 -- 47b2b2 addr:f788c -- wal_sdp_process_rx_data
Call Stack 2 -- 3e562c addr:f789c
Call Stack 3 -- 4101de addr:f78ac
Call Stack 4 -- 3e5f32 addr:f78cc
Call Stack 5 -- 3f78c0 addr:f78ec
Call Stack 6 -- 3f5e24 addr:f78fc
```
3. Based on the above call stack information, it can be determined that an exception occurs in the **WadRecvCB** function.
![hi3861-test](figures/hi3861-test.png)
4. Check and modify the code.
## Execution Result Examination
After the sample code is compiled, burnt, run, and debugged, restart the development board. If the following messages are displayed, the image is running correctly:
```
ready to OS start
FileSystem mount ok.
wifi init success!
[DEMO] Hello world.
```
## Next
Congratulations! You have finished all steps! Proceed to develop samples to better familiarize yourself with OpenHarmony development:
- [LED Peripheral Control](https://gitee.com/openharmony/docs/blob/master/en/device-dev/guide/device-wlan-led-control.md)
- [Third-Party SDK Integration](https://gitee.com/openharmony/docs/blob/master/en/device-dev/guide/device-wlan-sdk.md)
# Setting Up the Windows Environment
In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, because the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu build environment.
In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional).
The following describes how to set up the Windows environment.
## System Requirements
- OS: 64-bit Windows 10
- DevEco Device Tool: 3.1 Beta1
## Procedure
1. Download the [DevEco Device Tool 3.1 Beta1](https://device.harmonyos.com/cn/ide#download) Windows edition.
2. Decompress the DevEco Device Tool package, double-click the installer, and then click **Next**.
3. Set the installation path for DevEco Device Tool and click **Next**. Make sure the path does not contain Chinese characters and is in a drive other than the C drive.
![en-us_image_0000001326386753](figures/en-us_image_0000001326386753.png)
4. When prompted, select the tools to be automatically installed.
1. On the **VSCode installation confirm** page, select **Install VS Code 1.62.2 automatically** and click **Next**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If Visual Studio Code 1.62 or later has been installed, this step will be skipped.
![en-us_image_0000001285965546](figures/en-us_image_0000001285965546.png)
2. Select the Visual Studio Code installation path and click Next.
![select-vscode-path](figures/select-vscode-path.png)
2. On the displayed **Python select page**, select **Download from Huawei mirror** and click **Next**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If Python 3.8 or 3.9 has been installed, select **Use one of compatible on your PC**.
![en-us_image_0000001285965778](figures/en-us_image_0000001285965778.png)
5. When the page shown below is displayed, click **Next**.
![en-us_image_0000001285806330](figures/en-us_image_0000001285806330.png)
6. On the page shown below, read the user agreement and privacy statement carefully and select **I accept the licenses** before proceeding to the next step.
![en-us_image_0000001275586896](figures/en-us_image_0000001275586896.png)
7. Wait for the DevEco Device Tool setup wizard to automatically install DevEco Device Tool. After the installation is complete, click **Finish** to close the setup wizard.
![en-us_image_0000001275267040](figures/en-us_image_0000001275267040.png)
8. From Visual Studio Code, access the DevEco Device Tool page. Now you can conduct your development in DevEco Device Tool.
![en-us_image_0000001338012765](figures/en-us_image_0000001338012765.png)
# Configuring the Environment for Remote Access
After the Windows and Ubuntu development environments have been set up, perform the following operations to enable Windows to remotely access Ubuntu, which is required to transfer images for burning.
## Installing the SSH Service and Obtaining the IP Address for Remote Access
1. In Ubuntu, open the Terminal tool and run the following command to install the SSH service:
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If the command fails to be executed and the system displays a message indicating that the openssh-server and openssh-client depend on different versions, install the openssh-client of the required version (for example, **sudo apt-get install openssh-client=1:8.2p1-4**) as prompted on the command-line interface (CLI) and run the command again to install the openssh-server.
```shell
sudo apt-get install openssh-server
```
2. Run the following command to start the SSH service:
```shell
sudo systemctl start ssh
```
3. Run the following command to obtain the IP address of the current user for remote access to the Ubuntu environment from Windows:
```shell
ifconfig
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If the message "command-not-found" is displayed after you run the **ifconfig** command, run the **sudo apt-get install net-tools** command to install **net-tools** and obtain the IP address again.
![en-us_image_0000001215737140](figures/en-us_image_0000001215737140.png)
## Installing Remote SSH
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
![en-us_image_0000001285647778](figures/en-us_image_0000001285647778.png)
2. Click **Install** next to **Remote-SSH** to install the tool. After the installation is successful, **Remote-SSH** is displayed on the **INSTALLED** list.
![en-us_image_0000001238880335](figures/en-us_image_0000001238880335.png)
## Remotely Connecting to the Ubuntu Environment
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001238760373](figures/en-us_image_0000001238760373.png), and click **+** under **SSH TARGETS**.
![en-us_image_0000001215878922](figures/en-us_image_0000001215878922.png)
2. In the **Enter SSH Connection Command** text box, enter **ssh _username_\@_ip_address_**, where *ip_address* indicates the IP address of the remote computer to be connected and *username* indicates the account name used for logging in to the remote computer.
![en-us_image_0000001215879750](figures/en-us_image_0000001215879750.png)
3. In the displayed dialog box, select the default first option as the SSH configuration file.
![en-us_image_0000001260519729](figures/en-us_image_0000001260519729.png)
4. Under **SSH TARGETS**, find the remote computer and click ![en-us_image_0000001194080414](figures/en-us_image_0000001194080414.png) to start it.
![en-us_image_0000001215720398](figures/en-us_image_0000001215720398.png)
5. In the displayed dialog box, select **Linux**, select **Continue**, and enter the password for logging in to the remote computer.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> To eliminate the need for frequently entering the password for logging in to the remote computer, [set an SSH public key](https://device.harmonyos.com/cn/docs/documentation/guide/ide-registering-public-key-0000001247162706).
![en-us_image_0000001215897530](figures/en-us_image_0000001215897530.png)
After the connection is successful, the plug-in is automatically installed in the **.vscode-server** folder of the user directory on the remote computer. After the installation is complete, reload Visual Studio Code in Windows as prompted. Then you can develop, compile, and burn source code in DevEco Device Tool on Windows.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If your computer has DevEco Device Tool 3.0 Release or an earlier version installed, the plug-in may fail to be installed, in which case the dialog box shown below stays in the lower right corner of Visual Studio Code. If this is the case, follow the instructions in [Fixing the DevEco Device Tool Installation Failure](https://device.harmonyos.com/en/docs/documentation/guide/faq-device-tool-install-failed-0000001437806813).
![install-fail](figures/install-fail.png)
The environment for remote access is now set up. As shown below, the IP address of the remotely connected computer is displayed in the lower left corner.
![en-us_image_0000001338102621](figures/en-us_image_0000001338102621.png)
# Setting Up the Ubuntu Environment
In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, because the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu build environment.
In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional).
The following describes how to set up the Ubuntu environment.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If the Ubuntu system has not been set up yet, set it up on a virtual machine running Windows. For details, see [Ubuntu Installation Guide](https://developer.huawei.com/consumer/cn/training/course/video/C101639987816176315). Then, [configure the Ubuntu basic environment](https://developer.huawei.com/consumer/cn/training/course/video/C101639988048536240).
## System Requirements
- Ubuntu: Ubuntu 18.04 to 21.10; version 20.04 with 16 GB or larger memory is recommended
- User name (Ubuntu): cannot contain Chinese characters
## Procedure
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
```shell
ls -l /bin/sh
```
![en-us_image_0000001226764302](figures/en-us_image_0000001226764302.png)
2. Start the command-line tool, run the following command, enter your password, and select **No** to set **Ubuntu shell** to **bash**.
```shell
sudo dpkg-reconfigure dash
```
![ubuntu-dash-to-bash](figures/ubuntu-dash-to-bash.png)
2. Download the [DevEco Device Tool 3.0 Release](https://device.harmonyos.com/cn/ide#download) Linux edition.
3. Decompress the DevEco Device Tool software package and assign permission on the folder obtained from the decompression.
1. Go to the directory where the DevEco Device Tool software package is stored and run the following command to decompress the software package. In the command, change **devicetool-linux-tool-3.1.0.300.zip** to the actual software package name.
```shell
unzip devicetool-linux-tool-3.1.0.300.zip
```
2. Open the folder of the decompressed software package and run the following command to grant the execute permission on the installation file. In the command, change **devicetool-linux-tool-3.1.0.300.sh** to the actual installation file name.
```shell
chmod u+x devicetool-linux-tool-3.1.0.300.sh
```
4. Run the following command to install DevEco Device Tool, where **devicetool-linux-tool-3.1.0.300.sh** indicates the installation file name.
```shell
sudo ./devicetool-linux-tool-3.1.0.300.sh
```
5. On the page for agreeing to the user agreement and privacy statement, read and agree to the user agreement and privacy statement. You can scroll through the options by pressing the up and down arrow keys on the keyboard.
![en-us_image_0000001340557741](figures/en-us_image_0000001340557741.png)
Wait until the "DevEco Device Tool successfully installed." message is displayed.
![en-us_image_0000001338201457](figures/en-us_image_0000001338201457.png)
6. Run the following **apt-get** command:
```shell
sudo apt-get update && sudo apt-get install binutils binutils-dev git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib gcc-arm-linux-gnueabi libc6-dev-i386 libc6-dev-amd64 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 genext2fs device-tree-compiler make libffi-dev e2fsprogs pkg-config perl openssl libssl-dev libelf-dev libdwarf-dev u-boot-tools mtd-utils cpio doxygen liblz4-tool openjdk-8-jre gcc g++ texinfo dosfstools mtools default-jre default-jdk libncurses5 apt-utils wget scons python3.8-distutils tar rsync git-core libxml2-dev lib32z-dev grsync xxd libglib2.0-dev libpixman-1-dev kmod jfsutils reiserfsprogs xfsprogs squashfs-tools pcmciautils quota ppp libtinfo-dev libtinfo5 libncurses5-dev libncursesw5 libstdc++6 gcc-arm-none-eabi vim ssh locales libxinerama-dev libxcursor-dev libxrandr-dev libxi-dev
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> The preceding command is applicable to Ubuntu 18.04. For other Ubuntu versions, modify the preceding installation command based on the installation package name.
>
> - Python 3.8 or a later version is required. In this example, Python 3.8 is used.
>
> - Java 8 or later is required. In this example, Java 8 is used.
# Creating a Project and Obtaining Source Code
When creating an OpenHarmony project, DevEco Device Tool automatically downloads the source code in one of the following types, depending on the use case: **OpenHarmony Stable Version**, **OpenHarmony Sample**, and **HarmonyOS Connect Solution**.
**OpenHarmony Stable Version** provides source code of an OpenHarmony stable version, which is acquired from a mirror site. The OpenHarmony-v1.1.4-LTS, OpenHarmony-v3.0.3-LTS, and OpenHarmony-v3.1-Release versions are supported.
The source code from a mirror site is generally what's available when the stable version is released. Therefore, it may be out of date. To acquire the latest source code of a version, follow the instructions in [Acquiring Source Code from the Gitee Code Repository](../get-code/sourcecode-acquire.md). After acquiring the source code, import it to DevEco Device Tool by following the instructions in [Importing OpenHarmony Source Code](https://device.harmonyos.com/en/docs/documentation/guide/open_project-0000001071680043).
The following describes how to download source code of the **OpenHarmony Stable Version** type. For details about how to download source code of the **OpenHarmony Sample** and **HarmonyOS Connect Solution** types, see [HUAWEI DevEco Device Tool User Guide](https://device.harmonyos.com/en/docs/documentation/guide/service_introduction-0000001050166905).
## Prerequisites
A remote connection from the Windows environment to the Ubuntu environment has been set up through Remote SSH. For details, see [Setting Up the Development Environment](quickstart-ide-env--win.md).
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If a remote connection from Windows to Ubuntu is not available, the **New Project** function is restricted to HiSilicon enterprise users.
## Procedure
Source code from a mirror site can be of the OpenHarmony-v1.1.4-LTS, OpenHarmony-v3.0.3-LTS, or OpenHarmony-v3.1-Release version.
1. Open DevEco Device Tool, go to the home page, and click **New Project**.
![en-us_image_0000001272258726](figures/en-us_image_0000001272258726.png)
2. On the project configuration wizard page, configure the project settings.
- **OpenHarmony Source Code**: OpenHarmony version of the source code to download. The available versions are OpenHarmony-v1.1.4-LTS, OpenHarmony-v3.0.3-LTS, or OpenHarmony-v3.1-Release. Select **OpenHarmony Stable Version** here.
- **Project Name**: project name.
- **Project Path**: path for storing the project files.
- **SOC**: supported SoC.
- **Board**: development board.
- **Product**: supported product.
![en-us_image_0000001338187673](figures/en-us_image_0000001338187673.png)
3. Click **Confirm** to save the settings. DevEco Device Tool automatically starts to download the OpenHarmony source code. Considering the large size of the source package, the download process may take some time.
![en-us_image_0000001338536201](figures/en-us_image_0000001338536201.png)
# Importing a Source Code Project
After [setting up the Windows+Ubuntu hybrid development environment](../quick-start/quickstart-ide-lite-env-setup-win-ubuntu.md) and [obtaining source code](../quick-start/quickstart-ide-lite-sourcecode-acquire.md), perform the following steps to create a source code project in Windows:
1. Open DevEco Device Tool, go to the home page, and click **Import Project** to open your project or source code.
![en-us_image_0000001171426014](figures/en-us_image_0000001171426014.png)
2. Select the source code directory to be imported and click **Import**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> Make sure the selected directory does not contain Chinese characters or spaces. Otherwise, the building may fail.
![en-us_image_0000001271477045](figures/en-us_image_0000001271477045.png)
3. If this is the first time you import a project, a message will be displayed indicating that the project is not a DevEco Device Tool project. Click **Import** to continue.
![en-us_image_0000001135394334](figures/en-us_image_0000001135394334.png)
4. On the **Select Project type** page, select **Import from OpenHarmony Source**.
![en-us_image_0000001215743910](figures/en-us_image_0000001215743910.png)
5. On the **Import Project** page, select a product, and the MCU, board, company, and kernel fields will be automatically populated. Then, select the OpenHarmony source code version for **ohosVersion**. The following figure uses **wifiiot_hispark_pegasus** as an example.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> - Set **Product** to **wifiiot_hispark_pegasus** for the Hi3861 development board.
>
> - Set **Product** to **ipcamera_hispark_taurus** for the Hi3516D V300 development board.
![en-us_image_0000001271237241](figures/en-us_image_0000001271237241.png)
6. Click **Open** to open the project or source code.
# Setting Up the Windows+Ubuntu Hybrid Development Environment
In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, as the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu development environment.
In the Windows+Ubuntu hybrid development environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional).
## System Requirements
- Windows: Windows 10 (64-bit)
- Ubuntu: Ubuntu 20.04 or later; recommended memory: 16 GB or higher
- User name (Ubuntu): cannot contain Chinese characters
- DevEco Device Tool: 3.0 Release
## Setting Up the Ubuntu Development Environment
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the Ubuntu system has not been set up yet, set it up on a virtual machine running Windows. Then, configure the Ubuntu basic environment.
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
```
ls -l /bin/sh
```
![en-us_image_0000001226764302](figures/en-us_image_0000001226764302.png)
2. Start the command-line tool, run the following command, enter your password, and select **No** to set **Ubuntu shell** to **bash**.
```
sudo dpkg-reconfigure dash
```
![en-us_image_0000001243641075](figures/en-us_image_0000001243641075.png)
2. Download the [DevEco Device Tool 3.0 Release Linux version](https://device.harmonyos.com/cn/ide#download).
3. Decompress the DevEco Device Tool software package and assign permission on the folder obtained from the decompression.
1. Go to the directory where the DevEco Device Tool software package is stored and run the following command to decompress the software package. In the command, change **devicetool-linux-tool-3.0.0.401.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.401.zip
```
2. Open the folder of the decompressed software package and run the following command to grant the execute permission on the installation file. In the command, change **devicetool-linux-tool-3.0.0.401.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.401.sh
```
4. Run the following command to install DevEco Device Tool, where **devicetool-linux-tool-3.0.0.401.sh** indicates the installation file name.
```
sudo ./devicetool-linux-tool-3.0.0.401.sh
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> During the installation, the setup wizard automatically checks whether Python 3.8 or 3.9 is installed. If Python 3.8 or 3.9 is not installed, the setup wizard displays the "Do you want to continue?" message; enter **Y** to allow the setup wizard to automatically install Python.
>
> During the installation, the page for agreeing to the user agreement and privacy statement is displayed. Read and agree to the user agreement and privacy statement.
>
> If this page is not displayed and the installation exits, run the apt-get install whiptail command, then the installation command.
Wait until the "Deveco Device Tool successfully installed." message is displayed.
![en-us_image_0000001198722374](figures/en-us_image_0000001198722374.png)
## Setting Up Windows Development Environment
To remotely access the Ubuntu environment through Windows and enjoy the benefits of DevEco Device Tool for Windows, you need to install DevEco Device Tool on Windows.
1. Download the [DevEco Device Tool 3.0 Release](https://device.harmonyos.com/cn/ide#download) Windows edition.
2. Decompress the DevEco Device Tool package, double-click the installer, and then click **Next**.
3. Set the installation path of DevEco Device Tool to a path that does not contain any Chinese characters, and then click **Next**. You are advised to install DevEco Device Tool in a non-system drive.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If you have installed DevEco Device Tool 3.0 Beta2 or earlier, the earlier version will be uninstalled before you install a new version. If the following error message is displayed during the uninstallation, click **Ignore** to continue the installation. This error does not affect the installation of the new version.
>
> ![en-us_image_0000001239275843](figures/en-us_image_0000001239275843.png)
![en-us_image_0000001270076961](figures/en-us_image_0000001270076961.png)
4. When prompted, select the tools to be automatically installed.
1. On the **VSCode installation confirm** page, select **Install VScode 1.62.2 automatically** and click **Next**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> If Visual Studio Code 1.62 or later has been installed, this step will be skipped.
![en-us_image_0000001237801283](figures/en-us_image_0000001237801283.png)
2. On the displayed **Python select page**, select **Download from Huawei mirror** and click **Next**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> If Python 3.8 or 3.9 has been installed, select **Use one of compatible on your PC**.
![en-us_image_0000001193983334](figures/en-us_image_0000001193983334.png)
5. In the dialog box shown below, click **Next**.
![en-us_image_0000001239634067](figures/en-us_image_0000001239634067.png)
6. Read the user agreement and privacy statement carefully, select I accept the licenses, and click **Next**.
![en-us_image_0000001307019009](figures/en-us_image_0000001307019009.png)
7. Wait for the DevEco Device Tool setup wizard to automatically install DevEco Device Tool. After the installation is complete, click **Finish** to close the setup wizard.
![en-us_image_0000001239650137](figures/en-us_image_0000001239650137.png)
7. From Visual Studio Code, access the DevEco Device Tool page. Now you can conduct your development in DevEco Device Tool.
![en-us_image_0000001225760456](figures/en-us_image_0000001225760456.png)
## Configuring Windows to Remotely Access the Ubuntu Development Environment
### Installing the SSH Service and Obtaining the IP Address for Remote Access
1. In Ubuntu, open the Terminal tool and run the following command to install the SSH service:
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> If the command fails to be executed and the system displays a message indicating that the openssh-server and openssh-client depend on different versions, install the openssh-client of the required version (for example, **sudo apt-get install openssh-client=1:8.2p1-4**) as prompted on the command-line interface (CLI) and run the command again to install the openssh-server.
```
sudo apt-get install openssh-server
```
2. Run the following command to start the SSH service:
```
sudo systemctl start ssh
```
3. Run the following command to obtain the IP address of the current user for remote access to the Ubuntu environment from Windows:
```
ifconfig
```
![en-us_image_0000001215737140](figures/en-us_image_0000001215737140.png)
### Installing Remote SSH
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
![en-us_image_0000001193920448](figures/en-us_image_0000001193920448.png)
2. Click **Install** to install Remote-SSH. After the installation is successful, **Remote-SSH** is displayed on the **INSTALLED** list.
![en-us_image_0000001238880335](figures/en-us_image_0000001238880335.png)
### Remotely Connecting to the Ubuntu Environment
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001238760373](figures/en-us_image_0000001238760373.png), and click + on the **REMOTE EXOPLORER** page.
![en-us_image_0000001215878922](figures/en-us_image_0000001215878922.png)
2. In the **Enter SSH Connection Command** text box, enter **ssh *username@ip_address***, where *ip_address* indicates the IP address of the remote computer to be connected and *username* indicates the account name used for logging in to the remote computer.
![en-us_image_0000001215879750](figures/en-us_image_0000001215879750.png)
3. In the displayed dialog box, select the default first option as the SSH configuration file.
![en-us_image_0000001260519729](figures/en-us_image_0000001260519729.png)
4. Under **SSH TARGETS**, find the remote computer and click ![en-us_image_0000001194080414](figures/en-us_image_0000001194080414.png) to start it.
![en-us_image_0000001215720398](figures/en-us_image_0000001215720398.png)
5. In the displayed dialog box, select **Linux**, select **Continue**, and enter the password for logging in to the remote computer.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> To eliminate the need for frequently entering the password for logging in to the remote computer, set an SSH public key.
![en-us_image_0000001215897530](figures/en-us_image_0000001215897530.png)
After the connection is successful, the plug-in is automatically installed in the .vscode-server folder on the remote computer. After the installation is complete, reload Visual Studio Code in Windows as prompted. Then you can develop, compile, and burn source code in DevEco Device Tool on Windows.
# Introduction to the Hi3516 Development Board
## Introduction
Hi3516D V300 is a next-generation system on chip (SoC) designed for the industry-dedicated smart HD IP camera. It introduces a next-generation image signal processor (ISP), the H.265 video compression encoder, and a high-performance NNIE engine, leading the industry in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption.
**Figure 1** Hi3516 front view
![en-us_image_0000001271234717](figures/en-us_image_0000001271234717.png)
## Development Board Specifications
**Table 1** Hi3516 specifications
| Item| Description|
| -------- | -------- |
| Processor and internal memory| -&nbsp;Hi3516D V300 chip<br>-&nbsp;DDR3&nbsp;1GB<br>-&nbsp;eMMC 4.5, 8 GB capacity|
| External components| -&nbsp;Ethernet port<br>-&nbsp;Audio and video<br>&nbsp;&nbsp;-&nbsp;1 voice input<br>&nbsp;&nbsp;-&nbsp;1 mono channel (AC_L) output, connected to a 3 W power amplifier (LM4871)<br>&nbsp;&nbsp;-&nbsp;MicroHDMI (1-channel HDMI 1.4)<br>-&nbsp;Camera<br>&nbsp;&nbsp;-&nbsp;Sensor IMX335<br>&nbsp;&nbsp;-&nbsp;M12 lens, 4 mm focal length, and 1.8 aperture<br>-&nbsp;Display<br>&nbsp;&nbsp;-&nbsp;LCD connector (2.35-inch)<br>&nbsp;&nbsp;-&nbsp;LCD connector (5.5-inch)<br>-&nbsp;External components and ports<br>&nbsp;&nbsp;-&nbsp;Memory card port<br>&nbsp;&nbsp;-&nbsp;JTAG/I2S port<br>&nbsp;&nbsp;-&nbsp;ADC port<br>&nbsp;&nbsp;-&nbsp;Steering gear port<br>&nbsp;&nbsp;-&nbsp;Grove connector<br>&nbsp;&nbsp;-&nbsp;USB 2.0 (Type-C)<br>&nbsp;&nbsp;-&nbsp;Three function keys, two user-defined keys, and one upgrade key<br>&nbsp;&nbsp;-&nbsp;LED indicator, green or red|
# Mini and Small System Overview
## Introduction
The OpenHarmony mini and small systems apply to devices with a reference memory greater than or equal to 128 KiB. This document helps you quickly get started with development of the OpenHarmony mini and small systems, from environment setup to "Hello World" program running.
To accommodate different developer habits, OpenHarmony provides two modes for getting started with the standard system:
- IDE mode: DevEco Device Tool is used for one-stop development, covering dependency installation, building, burning, and running.
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool.
OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
This document exemplifies how to use the IDE mode. For details about the installation package mode, see [Getting Started with Mini and Small Systems (Installation Package Mode)](../quick-start/quickstart-lite-overview.md).
## Development Environment
In the Windows+Ubuntu hybrid environment for OpenHarmony development:
- Windows: used for source code development and burning.
- Ubuntu: used for source code building.
This document describes how to develop OpenHarmony in the Windows+Ubuntu environment.
## Development Boards
In this document, two development board models are used as examples: Hi3861 and Hi3516D V300. For details about these development boards, see [Appendix](../quick-start/quickstart-ide-lite-introduction-hi3861.md). You can purchase the development board as required.
## Development Process
Below you can see the quick start process for the development of the mini and small systems.
**Figure 1** Quick start process for the development of the mini and small systems
![en-us_image_0000001226634676](figures/en-us_image_0000001226634676.png)
# Building
1. Click **Project Settings** on the menu bar to access the Hi3516D V300 project configuration page.
![en-us_image_0000001265492885](figures/en-us_image_0000001265492885.png)
2. On the **Tool Chain** tab page, DevEco Device Tool automatically checks whether the dependent compilation toolchain is complete. If a message is displayed indicating that some tools are missing, click **Install** to automatically install the required tools.
![en-us_image_0000001265652869](figures/en-us_image_0000001265652869.png)
3. Install the toolchain related to Hi3516D V300. Certain tools may require the root access to install. In this case, enter the user password in the **TERMINAL** window.
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> If the pip component fails to be installed, [change the Python source](https://device.harmonyos.com/en/docs/documentation/guide/ide-set-python-source-0000001227639986) and try again.
![en-us_image_0000001220852753](figures/en-us_image_0000001220852753.png)
After the toolchain is automatically installed, the figure below is displayed.
![en-us_image_0000001220852754](figures/en-us_image_0000001220852754.png)
4. On the **hi3516dv300** tab page, set **build_type**. The default value is **debug**. Click **Save** to save the settings.
![en-us_image_0000001221172711](figures/en-us_image_0000001221172711.png)
5. Choose **PROJECT TASKS** > **hi3516dv300** > **Build** to start building.
![en-us_image_0000001265772913](figures/en-us_image_0000001265772913.png)
6. Wait until **SUCCESS** is displayed in the **TERMINAL** window, indicating that the compilation is complete.
![en-us_image_0000001221012766](figures/en-us_image_0000001221012766.png)
After the building is complete, go to the **out** directory of the project to view the generated files, which are needed in [burning](quickstart-ide-lite-steps-hi3516-burn.md).
# Burning
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
Hi3516D V300 supports burning through the USB port, network port, and serial port. This document describes how to burn source code through the USB port. The operations are performed in Windows.
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](quickstart-lite-introduction-hi3516.md).
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> If you are using the remote access mode (Windows + Ubuntu on the local VM), disable the USB control of the VM as follows to ensure that the development board is connected to the USB port of the host:
>
> - VMware: Configure the device to connect to the host under **Preferences** > **USB** and remove the USB controller from the VM settings.
>
> - VirtualBox: Deselect **Enable USB Controller** in the USB device options under Ubuntu settings.
2. If your computer does not have the USB port driver or USB-to-serial driver, install it by following the instructions in [Installing the USB Port Driver on the Hi3516D V300 or Hi3518E V300 Development Board](Installing the USB Port Driver on the Hi3516D V300 or Hi3518E V300 Development Board) or [Installing the Serial Port Driver on the Hi3516D V300 or Hi3518E V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/hi3516_hi3518-drivers-0000001050743695), depending on the missing driver.
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
- If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon.
![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png)
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step.
4. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
![en-us_image_0000001216516128](figures/en-us_image_0000001216516128.png)
5. Choose **QUICK ACCESS** > **DevEco Home** > **Projects**, and then click **Settings**.
![en-us_image_0000001198566364](figures/en-us_image_0000001198566364.png)
6. On the **hi3516dv300** tab page, set the burning options.
- **upload_partitions**: Select the file to be burnt. By default, the **fastboot**, **kernel**, **rootfs**, and **userfs** files are burnt at the same time.
- **upload_port**: Select the serial port number obtained.
- **upload_protocol**: Select the burning protocol **hiburn-usb**.
![en-us_image_0000001223190441](figures/en-us_image_0000001223190441.png)
7. In **Partitions**, check the preset burning settings of the files to be burnt.
![en-us_image_0000001312778829](figures/en-us_image_0000001312778829.png)
To modify the burning settings for a specific file, click ![en-us_image_0000001312898911](figures/en-us_image_0000001312898911.png) next to the file.
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> Set the start address and length of the partition based on the size of the files to be burnt. Make sure the size of the partition is greater than that of the files to be burnt and the partition addresses of the files to be burnt do not overlap.
![en-us_image_0000001312780249](figures/en-us_image_0000001312780249.png)
8. When you finish modifying, click **Save** on the top.
9. Go to **hi3516dv300** > **Upload** to transfer the files to be burnt from Ubuntu to Windows. When the "Operation paused, Please press Enter key to continue" message is displayed, which indicates that the transfer is complete, press **Enter** to start burning.
![en-us_image_0000001266887264](figures/en-us_image_0000001266887264.png)
10. When the following information is displayed in the **TERMINAL** window, press and hold the reset button within 15 seconds, remove and insert the USB cable, and release the reset button to start burning.
![en-us_image_0000001114129426](figures/en-us_image_0000001114129426.png)
If the following message is displayed, it indicates that the burning is successful.
![en-us_image_0000001160649343](figures/en-us_image_0000001160649343.png)
11. When the burning is successful, perform the operations in Running to start the system.
# Building
1. In **Projects**, click **Settings**. The Hi3861 configuration page is displayed.
![en-us_image_0000001265785209](figures/en-us_image_0000001265785209.png)
2. On the **toolchain** tab page, DevEco Device Tool automatically checks whether the dependent compilation toolchain is complete. If a message is displayed indicating that some tools are missing, click **SetUp** to automatically install the required tools.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the pip component fails to be installed, [change the Python](https://device.harmonyos.com/en/docs/documentation/guide/ide-set-python-source-0000001227639986) source and try again.
![en-us_image_0000001221025048](figures/en-us_image_0000001221025048.png)
After the toolchain is automatically installed, the figure below is displayed.
![en-us_image_0000001221344980](figures/en-us_image_0000001221344980.png)
3. On the **hi3861** tab page, set **build_type**. The default value is **debug**. Click **Save** to save the settings.
![en-us_image_0000001265945173](figures/en-us_image_0000001265945173.png)
4. Choose **PROJECT TASKS** > **hi3861** > **Build** to start building.
![en-us_image_0000001265505181](figures/en-us_image_0000001265505181.png)
5. Wait until **SUCCESS** is displayed in the **TERMINAL** window, indicating that the compilation is complete.
![en-us_image_0000001265665157](figures/en-us_image_0000001265665157.png)
After the building is complete, go to the out directory of the project to view the generated files, which are needed in [burning](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3861-upload-0000001051668683).
# Burning
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
Hi3861 V100 supports burning through the serial port. To burn source code through the serial port in Windows, perform the following steps:
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3861 V100 Development Board](quickstart-lite-introduction-hi3861.md).
2. If your computer does not have the USB-to-serial driver, install it by following the instructions in [Installing the Serial Port Driver on Hi3861 V100](https://device.harmonyos.com/en/docs/documentation/guide/hi3861-drivers-0000001058153433).
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon.
![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
4. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
![en-us_image_0000001216274840](figures/en-us_image_0000001216274840.png)
5. Choose **QUICK ACCESS** > **DevEco Home** > **Projects**, and then click **Settings**.
![en-us_image_0000001198943768](figures/en-us_image_0000001198943768.png)
6. On the **hi3861** tab page, set the burning options.
- **upload_port**: Select the serial port number obtained.
- **upload_protocol**: Select the burning protocol **hiburn-serial**.
- **upload_partitions**: Select the files to be burnt. **hi3861_app** is selected by default.
![en-us_image_0000001243704061](figures/en-us_image_0000001243704061.png)
7. In **Partitions**, check the preset burning settings of the files to be burnt.
![en-us_image_000000131299335](figures/en-us_image_000000131299335.png)
To modify the burning settings for a specific file, click ![en-us_image_0000001312898911](figures/en-us_image_0000001312898911.png) next to the file.
![en-us_image_0000001312912501](figures/en-us_image_0000001312912501.png)
8. When you finish modifying, click **Save** on the top.
9. Click **Open** to open the project file. Then, choose **PROJECT TASKS** > **hi3861** > **Upload** to start burning.
![en-us_image_0000001216440138](figures/en-us_image_0000001216440138.png)
10. When the following information is displayed, press the RST button on the development board within 15 seconds to restart it.
![en-us_image_0000001198466090](figures/en-us_image_0000001198466090.png)
When the following message is displayed, the burning is successful.
![en-us_image_0000001216761476](figures/en-us_image_0000001216761476.png)
\ No newline at end of file
# Debugging and Verification
When the burning and networking are complete, you can use either of the following methods to debug and verify whether the source code has been burnt correctly:
1. Using printf to print logs
2. Using ASM files to locate panic issues
As the example used here is simple, we use the printf method. The following describes the two methods in detail.
## printf
Add the printf function to the code, which helps print data to the serial port. You can add log printing in key service paths or service exception locations, as shown in the following figure.
```
void HelloWorld(void)
{
printf("[DEMO] Hello world.\n");
}
```
## Using ASM Files to Locate Issues
When the system exits abnormally, the call stack information about the abnormal exit is displayed on the serial port. Analyze the displayed information to troubleshoot and pinpoint issues.
```
=======KERNEL PANIC=======
**Call Stack*
Call Stack 0 -- 4860d8 addr:f784c
Call Stack 1 -- 47b2b2 addr:f788c
Call Stack 2 -- 3e562c addr:f789c
Call Stack 3 -- 4101de addr:f78ac
Call Stack 4 -- 3e5f32 addr:f78cc
Call Stack 5 -- 3f78c0 addr:f78ec
Call Stack 6 -- 3f5e24 addr:f78fc
Call Stack end***
```
To analyze the call stack information, the **Hi3861_wifiiot_app.asm** file is required. This file records the symbol addresses of the functions in the code in the flash memory and the disassembly information. The ASM file is built and output together with the version software package and is stored in the **./out/wifiiot/** directory.
1. Save the CallStack information to a .txt file for editing. (Optional)
2. Open the asm file, search for the addresses in CallStack, and list the corresponding function names. Generally, you only need to find the functions matching the first several stacks to locate issues.
```
Call Stack 0 -- 4860d8 addr:f784c -- WadRecvCB
Call Stack 1 -- 47b2b2 addr:f788c -- wal_sdp_process_rx_data
Call Stack 2 -- 3e562c addr:f789c
Call Stack 3 -- 4101de addr:f78ac
Call Stack 4 -- 3e5f32 addr:f78cc
Call Stack 5 -- 3f78c0 addr:f78ec
Call Stack 6 -- 3f5e24 addr:f78fc
```
3. Based on the call stack information, we can conclude that an exception occurs in the **WadRecvCB** function.
![en-us_image_0000001226634668](figures/en-us_image_0000001226634668.png)
4. Check and modify the code.
# Networking
After completing compilation and burning, perform the following to connect the Hi3861 WLAN module to the Internet using AT commands.
1. Click the icon of **DevEco: Serial Monitor** at the bottom of DevEco Device Tool to keep the connection between the Windows workstation and the Hi3861 WLAN module.
**Figure 1** Opening the DevEco Device Tool serial port
![en-us_image_0000001226634700](figures/en-us_image_0000001226634700.png)
2. Reset the Hi3861 WLAN module. The message **ready to OS start** is displayed on the **TERMINAL** panel, indicating that the WLAN module is started successfully.
**Figure 2** Successful resetting of the Hi3861 WLAN module
![en-us_image_0000001271594733](figures/en-us_image_0000001271594733.png)
3. Run the following AT commands in sequence via the DevEco serial port terminal to start the STA mode, connect to the specified AP, and enable Dynamic Host Configuration Protocol (DHCP).
```
AT+STARTSTA # Start the STA mode.
AT+SCAN # Scan for available APs.
AT+SCANRESULT # Display the scanning result.
AT+CONN="SSID",,2,"PASSWORD" # Connect to the specified AP. (SSID and PASSWORD represent the name and password of the hotspot to be connected, respectively.)
AT+STASTAT # View the connection result.
AT+DHCP=wlan0,1 # Request the IP address of wlan0 from the AP using DHCP.
```
4. Check whether the Hi3861 WLAN module is properly connected to the gateway, as shown in the following figure.
```
AT+IFCFG # View the IP address assigned to an interface of the module.
AT+PING=X.X.X.X # Check the connectivity between the module and the gateway. Replace X.X.X.X with the actual gateway address.
```
**Figure 3** Successful networking of the Hi3861 WLAN module
![en-us_image_0000001227114612](figures/en-us_image_0000001227114612.png)
# Running
## Viewing Execution Result
After the sample code is compiled, burnt, run, and debugged, restart the development board. If the following messages are displayed, the image is running correctly:
```
ready to OS start
FileSystem mount ok.
wifi init success!
[DEMO] Hello world.
```
## Next
Congratulations! You have finished all steps! Proceed to [develop a sample WLAN product](../guide/device-wlan-led-control.md) to better familiarize yourself with OpenHarmony development.
# Introduction to the Hi3516 Development Board
## Overview
Hi3516D V300 is a next-generation system on chip (SoC) designed for industry-dedicated smart HD IP cameras. It introduces a next-generation image signal processor (ISP), the H.265 video compression encoder, and a high-performance NNIE engine, leading the industry in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption.
**Figure 1** Hi3516 front view
![en-us_image_0000001227082182](figures/en-us_image_0000001227082182.png)
## Development Board Specifications
**Table 1** Hi3516 specifications
| Item| Description|
| -------- | -------- |
| Processor and internal memory| -&nbsp;Hi3516D V300 chip<br>-&nbsp;DDR3&nbsp;1GB<br>-&nbsp;eMMC 4.5, 8 GB capacity|
| External components| -&nbsp;Ethernet port<br>-&nbsp;Audio and video<br>&nbsp;&nbsp;-&nbsp;1 voice input<br>&nbsp;&nbsp;-&nbsp;1 mono channel (AC_L) output, connected to a 3 W power amplifier (LM4871)<br>&nbsp;&nbsp;-&nbsp;MicroHDMI (1-channel HDMI 1.4)<br>-&nbsp;Camera<br>&nbsp;&nbsp;-&nbsp;Sensor IMX335<br>&nbsp;&nbsp;-&nbsp;M12 lens, 4 mm focal length, and 1.8 aperture<br>-&nbsp;Display<br>&nbsp;&nbsp;-&nbsp;LCD connector (2.35-inch)<br>&nbsp;&nbsp;-&nbsp;LCD connector (5.5-inch)<br>-&nbsp;External components and ports<br>&nbsp;&nbsp;-&nbsp;Memory card port<br>&nbsp;&nbsp;-&nbsp;JTAG/I2S port<br>&nbsp;&nbsp;-&nbsp;ADC port<br>&nbsp;&nbsp;-&nbsp;Steering gear port<br>&nbsp;&nbsp;-&nbsp;Grove connector<br>&nbsp;&nbsp;-&nbsp;USB 2.0 (Type-C)<br>&nbsp;&nbsp;-&nbsp;Three function keys, two user-defined keys, and one upgrade key<br>&nbsp;&nbsp;-&nbsp;LED indicator, green or red|
# Importing a Source Code Project
After [setting up the Windows+Ubuntu hybrid development environment](../quick-start/quickstart-ide-standard-env-setup-win-ubuntu.md) and [obtaining source code](../quick-start/quickstart-ide-standard-sourcecode-acquire.md), perform the following steps to create a source code project in Windows:
1. Open DevEco Device Tool, go to the home page, and click **Import Project** to open your project or source code.
![en-us_image_0000001171426014](figures/en-us_image_0000001171426014.png)
2. Select the source code directory to be imported and click **Import**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> Make sure the selected directory does not contain Chinese characters or spaces. Otherwise, the building may fail.
![en-us_image_0000001271562277](figures/en-us_image_0000001271562277.png)
3. If you select to open the OpenHarmony source code, a message will be displayed indicating that the project is not a DevEco Device Tool project. Click **Import** to continue.
![en-us_image_0000001135394334](figures/en-us_image_0000001135394334.png)
4. On the **Select Project type** page, select **Import from OpenHarmony Source**.
![en-us_image_0000001215743910](figures/en-us_image_0000001215743910.png)
5. On the **Import Project** page, select a product, and the MCU, board, company, and kernel fields will be automatically populated. Then, select the OpenHarmony source code version for **ohosVersion**. The following figure uses **Hi3516DV300** as an example.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> - Set **Product** to **Hi3516DV300** for the Hi3516D V300 development board.
>
> - Set **Product** to **rk3568** for the RK3568 development board.
![en-us_image_0000001271448821](figures/en-us_image_0000001271448821.png)
6. Click **Open** to open the project or source code.
# Setting Up the Windows+Ubuntu Hybrid Development Environment
In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, as the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu development environment.
In the Windows+Ubuntu hybrid development environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional).
## System Requirements
- Windows: Windows 10 (64-bit)
- Ubuntu: Ubuntu 20.04 or later; recommended memory: 16 GB or higher.
- User name: cannot contain Chinese characters
- DevEco Device Tool: 3.0 Release
## Setting Up the Ubuntu Development Environment
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
```
ls -l /bin/sh
```
![en-us_image_0000001226764302](figures/en-us_image_0000001226764302.png)
2. Start the command-line tool, run the following command, enter your password, and select **No** to set **Ubuntu shell** to **bash**.
```
sudo dpkg-reconfigure dash
```
![en-us_image_0000001243641075](figures/en-us_image_0000001243641075.png)
2. Download the [DevEco Device Tool 3.0 Release Linux version](https://device.harmonyos.com/cn/ide#download).
3. Decompress the DevEco Device Tool software package and assign permission on the folder obtained from the decompression.
1. Go to the directory where the DevEco Device Tool software package is stored and run the following command to decompress the software package. In the command, change **devicetool-linux-tool-3.0.0.401.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.401.zip
```
2. Open the folder of the decompressed software package and run the following command to grant the execute permission on the installation file. In the command, change **devicetool-linux-tool-3.0.0.401.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.401.sh
```
4. Run the following command to install DevEco Device Tool, where **devicetool-linux-tool-3.0.0.401.sh** indicates the installation file name.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> During the installation, the setup wizard automatically checks whether Python 3.8 or 3.9 is installed. If Python 3.8 or 3.9 is not installed, the setup wizard displays the "Do you want to continue?" message; enter **Y** to allow the setup wizard to automatically install Python.
```
sudo ./devicetool-linux-tool-3.0.0.401.sh
```
Wait until the "Deveco Device Tool successfully installed." message is displayed.
![en-us_image_0000001198722374](figures/en-us_image_0000001198722374.png)
## Setting Up Windows Development Environment
To remotely access the Ubuntu environment through Windows and enjoy the benefits of DevEco Device Tool for Windows, you need to install DevEco Device Tool on Windows.
1. Download the [DevEco Device Tool 3.0 Release](https://device.harmonyos.com/cn/ide#download) Windows edition.
2. Decompress the DevEco Device Tool package, double-click the installer, and then click **Next**.
3. Set the installation path of DevEco Device Tool and click **Next**. You are advised to install DevEco Device Tool in a non-system drive.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> If you have installed DevEco Device Tool 3.0 Beta2 or earlier, the earlier version will be uninstalled before you install a new version. If the following error message is displayed during the uninstallation, click **Ignore** to continue the installation. This error does not affect the installation of the new version.
>
> ![en-us_image_0000001239275843](figures/en-us_image_0000001239275843.png)
![en-us_image_0000001270076961](figures/en-us_image_0000001270076961.png)
4. When prompted, select the tools to be automatically installed.
1. On the **VSCode installation confirm** page, select **Install VScode 1.62.2 automatically** and click **Next**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If Visual Studio Code 1.62 or later has been installed, this step will be skipped.
![en-us_image_0000001237801283](figures/en-us_image_0000001237801283.png)
2. On the displayed **Python select page**, select **Download from Huawei mirror** and click **Next**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> If Python 3.8 or 3.9 has been installed, select **Use one of compatible on your PC**.
![en-us_image_0000001193983334](figures/en-us_image_0000001193983334.png)
5. In the dialog box shown below, click **Next** to download and install the tools..
![en-us_image_0000001239634067](figures/en-us_image_0000001239634067.png)
6. Wait for the DevEco Device Tool setup wizard to automatically install DevEco Device Tool. After the installation is complete, click **Finish** to close the setup wizard.
![en-us_image_0000001239650137](figures/en-us_image_0000001239650137.png)
7. From Visual Studio Code, access the DevEco Device Tool page. Now you can conduct your development in DevEco Device Tool.
![en-us_image_0000001225760456](figures/en-us_image_0000001225760456.png)
## Configuring Windows to Remotely Access the Ubuntu Development Environment
### Installing the SSH Service and Obtaining the IP Address for Remote Access
1. In Ubuntu, open the Terminal tool and run the following command to install the SSH service:
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> If the command fails to be executed and the system displays a message indicating that the openssh-server and openssh-client depend on different versions, install the openssh-client of the required version (for example, **sudo apt-get install openssh-client=1:8.2p1-4**) as prompted on the command-line interface (CLI) and run the command again to install the openssh-server.
```
sudo apt-get install openssh-server
```
2. Run the following command to start the SSH service:
```
sudo systemctl start ssh
```
3. Run the following command to obtain the IP address of the current user for remote access to the Ubuntu environment from Windows:
```
ifconfig
```
![en-us_image_0000001215737140](figures/en-us_image_0000001215737140.png)
### Installing Remote SSH
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
![en-us_image_0000001193920448](figures/en-us_image_0000001193920448.png)
2. Click **Install** to install Remote-SSH. After the installation is successful, **Remote-SSH** is displayed on the **INSTALLED** list.
![en-us_image_0000001238880335](figures/en-us_image_0000001238880335.png)
### Remotely Connecting to the Ubuntu Environment
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001238760373](figures/en-us_image_0000001238760373.png), and click + on the **REMOTE EXOPLORER** page.
![en-us_image_0000001215878922](figures/en-us_image_0000001215878922.png)
2. In the **Enter SSH Connection Command** text box, enter **ssh *username@ip_address***, where *ip_address* indicates the IP address of the remote computer to be connected and *username* indicates the account name used for logging in to the remote computer.
![en-us_image_0000001215879750](figures/en-us_image_0000001215879750.png)
3. In the displayed dialog box, select the default first option as the SSH configuration file.
![en-us_image_0000001260519729](figures/en-us_image_0000001260519729.png)
4. Under **SSH TARGETS**, find the remote computer and click ![en-us_image_0000001194080414](figures/en-us_image_0000001194080414.png) to start it.
![en-us_image_0000001215720398](figures/en-us_image_0000001215720398.png)
5. In the displayed dialog box, select **Linux**, select **Continue**, and enter the password for logging in to the remote computer.
![en-us_image_0000001215897530](figures/en-us_image_0000001215897530.png)
After the connection is successful, the plug-in is automatically installed in the .vscode-server folder on the remote computer. After the installation is complete, reload Visual Studio Code in Windows as prompted. Then you can develop, compile, and burn source code in DevEco Device Tool on Windows.
### Registering the Public Key for Accessing the Ubuntu Environment
After the preceding operations are complete, you can remotely connect to the Ubuntu environment through Windows for development. However, you need to frequently enter the remote connection password. To eliminate this need, you can use the SSH public key.
1. Open the Git bash CLI and run the following command to generate an SSH public key. During command execution, perform operations as prompted. Set **username** and **ip** to the user name and IP address you use for connecting to the Ubuntu system.
```
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub username@ip
```
![en-us_image_0000001271532317](figures/en-us_image_0000001271532317.png)
2. In Visual Studio Code, click the remote connection setting button and open the **config** file.
![en-us_image_0000001226034634](figures/en-us_image_0000001226034634.png)
3. In the **config** file, add the SSK key file information, as shown below. Then save the file.
![en-us_image_0000001270356233](figures/en-us_image_0000001270356233.png)
# Standard System Overview
## Introduction
The OpenHarmony standard system applies to devices with a reference memory greater than or equal to 128 MiB. This document helps you quickly get started for development of the OpenHarmony standard system, from environment setup to building, burning, and startup.
To accommodate different developer habits, OpenHarmony provides two modes for getting started with the standard system:
- IDE mode: DevEco Device Tool is used for one-stop development, covering dependency installation, building, burning, and running.
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool.
OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
This document exemplifies how to use the IDE mode. For details about the installation package mode, see [Getting Started with Standard System (Installation Package Mode)](quickstart-standard-overview.md).
## Development Environment
In the Windows+Ubuntu hybrid environment for OpenHarmony development:
- Windows: used for source code development and burning.
- Ubuntu: used for source code building.
This document describes how to develop OpenHarmony in the Windows+Ubuntu environment.
## Development Boards
In this document, two development board models are used as examples: Hi3516D V300 and RK3568. For details about these development boards, see [Appendix](../quick-start/quickstart-ide-standard-board-introduction-hi3516.md). You can purchase the development board as required.
## Development Process
Below you can see the quick start process for the development of the standard system.
**Figure 1** Quick start process for the development of the standard system
![en-us_image_0000001271562257](figures/en-us_image_0000001271562257.png)
# Building
1. In **Projects**, click **Settings**. The Hi3516D V300 configuration page is displayed.
![en-us_image_0000001265492885](figures/en-us_image_0000001265492885.png)
2. On the **toolchain** tab page, DevEco Device Tool automatically checks whether the dependent compilation toolchain is complete. If a message is displayed indicating that some tools are missing, click **SetUp** to automatically install the required tools.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the pip component fails to be installed, [change the Python](https://device.harmonyos.com/en/docs/documentation/guide/ide-set-python-source-0000001227639986) source and try again.
![en-us_image_0000001227277128](figures/en-us_image_0000001227277128.png)
After the toolchain is automatically installed, the figure below is displayed.
![en-us_image_0000001227757036](figures/en-us_image_0000001227757036.png)
3. On the **hi3516dv300** tab page, set **build_type**. The default value is **debug**. Click **Save** to save the settings.
![en-us_image_0000001221172710](figures/en-us_image_0000001221172710.png)
4. Choose **PROJECT TASKS** > **hi3516dv300** > **Build** to start building.
![en-us_image_0000001265772913](figures/en-us_image_0000001265772913.png)
5. Wait until **SUCCESS** is displayed in the **TERMINAL** window, indicating that the compilation is complete.
![en-us_image_0000001221012766](figures/en-us_image_0000001221012766.png)
After the building is complete, go to the out directory of the project to view the generated files, which are needed in [burning](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3516-upload-0000001052148681).
# Burning
To burn source code to Hi3516D V300 through the USB port in Windows, perform the following steps:
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](quickstart-lite-introduction-hi3516.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon.
![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
![en-us_image_0000001216516128](figures/en-us_image_0000001216516128.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the serial port number is not displayed correctly, follow the steps described in [Installing the Serial Port Driver on the Hi3516 or Hi3518 Series Development Boards](https://device.harmonyos.com/en/docs/documentation/guide/hi3516_hi3518-drivers-0000001050743695).
4. Choose **QUICK ACCESS** > **DevEco Home** > **Projects**, and then click **Settings**.
![en-us_image_0000001198566364](figures/en-us_image_0000001198566364.png)
5. On the **hi3516dv300** tab page, set the burning options.
- **upload_partitions**: Select the file to be burnt. By default, the **fastboot**, **kernel**, **rootfs**, and **userfs** files are burnt at the same time.
- **upload_port**: Select the serial port number obtained.
- **upload_protocol**: Select the burning protocol **hiburn-usb**.
![en-us_image_0000001223190441](figures/en-us_image_0000001223190441.png)
6. Check the preset information of the files to be burnt and modify them when necessary. The files to be burnt include **fastboot**, **kernel**, **rootfs**, and **userfs**.
1. On the **hi3516dv300_fastboot** tab, select the items to be modified in **New Option**, such as **partition_bin**, **partition_addr**, and **partition_length**.
![en-us_image_0000001198889702](figures/en-us_image_0000001198889702.png)
2. In **Partition Options**, modify the items selected in the preceding step.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> Set the start address and length of the partition based on the size of the files to be burnt. Make sure the size of the partition is greater than that of the files to be burnt and the partition addresses of the files to be burnt do not overlap.
![en-us_image_0000001243290907](figures/en-us_image_0000001243290907.png)
3. Follow the same procedure to modify the information about the **kernel**, **rootfs**, and **userfs** files.
7. When you finish modifying, click **Save** on the top.
8. Go to **hi3516dv300** > **Upload** to start burning.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If this is the first time you burn source code to the Hi3516D V300 or Hi3518E V300 board, the message "not find the Devices" may be displayed. In this case, follow the steps in [Installing the USB Port Driver on the Hi3516D V300 or Hi3518E V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393) and start burning again.
![en-us_image_0000001267231481](figures/en-us_image_0000001267231481.png)
9. When the following information is displayed in the Terminal window, press and hold the reset button, remove and insert the USB cable, and release the reset button to start burning.
![en-us_image_0000001114129426](figures/en-us_image_0000001114129426.png)
If the following message is displayed, it indicates that the burning is successful.
![en-us_image_0000001160649343](figures/en-us_image_0000001160649343.png)
10. When the burning is successful, perform the operations in Running an Image to start the system.
# Running
## Starting the System
After the burning is complete, perform the following steps to start the system:
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> This operation procedure is required only if this is the first time you burn an image for the standard system.
1. In DevEco Device Tool, click **Monitor** to open the serial port tool.
![en-us_image_0000001227082162](figures/en-us_image_0000001227082162.png)
2. Restart the development board. Before the autoboot countdown ends, press any key to enter the system.
![en-us_image_0000001271202289](figures/en-us_image_0000001271202289.gif)
3. Run the following commands to set system boot parameters:
```
setenv bootargs 'mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M clk_ignore_unused rootdelay=10 hardware=Hi3516DV300 init=/init root=/dev/ram0 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),2M(misc),3307M(system),256M(vendor),-(userdata)';
```
```
setenv bootcmd 'mmc read 0x0 0x82000000 0x800 0x4800; bootm 0x82000000'
```
![en-us_image_0000001271562269](figures/en-us_image_0000001271562269.png)
4. Save the parameter settings.
```
save
```
![en-us_image_0000001226762210](figures/en-us_image_0000001226762210.png)
5. Restart the development board to start the system.
```
reset
```
![en-us_image_0000001226602238](figures/en-us_image_0000001226602238.png)
## Running a Hello World Program
After the system is started, start the serial port tool, run the **helloworld** command in any directory, and press **Enter**. If the message "Hello World!" is displayed, the program runs successfully.
![en-us_image_0000001271322277](figures/en-us_image_0000001271322277.png)
## Next
Congratulations! You have finished all steps! Proceed to [develop a sample](../guide/device-clock-guide.md) to better familiarize yourself with OpenHarmony development.
# Building
1. In **Projects**, click **Settings**. The HH-SCDY200 configuration page is displayed.
![en-us_image_0000001221036768](figures/en-us_image_0000001221036768.png)
2. On the **toolchain** tab page, DevEco Device Tool automatically checks whether the dependent compilation toolchain is complete. If a message is displayed indicating that some tools are missing, click **SetUp** to automatically install the required tools.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the pip component fails to be installed, [change the Python](https://device.harmonyos.com/en/docs/documentation/guide/ide-set-python-source-0000001227639986) source and try again.
![en-us_image_0000001221356692](figures/en-us_image_0000001221356692.png)
After the toolchain is automatically installed, the figure below is displayed.
![en-us_image_0000001265676877](figures/en-us_image_0000001265676877.png)
3. On the **hh_scdy200** tab page, set **build_type**. The default value is **debug**. Click **Save** to save the settings.
![en-us_image_0000001265956897](figures/en-us_image_0000001265956897.png)
4. Choose **PROJECT TASKS** > **hi3861** > **Build** to start building.
![en-us_image_0000001265516901](figures/en-us_image_0000001265516901.png)
5. Wait until **SUCCESS** is displayed in the **TERMINAL** window, indicating that the compilation is complete.
![en-us_image_0000001222361042](figures/en-us_image_0000001222361042.png)
After the building is complete, go to the out directory of the project to view the generated files, which are needed in [burning](https://device.harmonyos.com/en/docs/documentation/guide/ide-rk3568-upload-0000001239220669).
# Burning
1. [Download](https://gitee.com/hihope_iot/docs/blob/master/HiHope_DAYU200/%E7%83%A7%E5%86%99%E5%B7%A5%E5%85%B7%E5%8F%8A%E6%8C%87%E5%8D%97/windows/DriverAssitant_v5.1.1.zip) **DriverInstall.exe**. Double-click **DriverInstall.exe** to open the installer. Then click the install button to install the USB driver as prompted.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> If the burning tool of an earlier version has been installed, uninstall it first.
2. Connect the computer to the target development board through the USB port.
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon.
![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
4. In DevEco Device Tool, choose QUICK ACCESS > DevEco Home > Projects, and then click Settings.
![en-us_image_0000001239661509](figures/en-us_image_0000001239661509.png)
5. On the **hh_scdy200** tab page, set the burning options.
- **upload_partitions**: Select the files to be burnt.
- **upload_protocol**: Select the burning protocol **upgrade**.
![en-us_image_0000001194504874](figures/en-us_image_0000001194504874.png)
6. Check the preset information of the files to be burnt and modify them when necessary. The files to be burnt include **loader**, **parameter**, **uboot**, **boot_linux**, **system**, **vendor**, and **userdata**.
1. On the **hh_scdy200_loader** tab, select the items to be modified in **New Option**, such as **partition_bin**, **partition_addr**, and **partition_length**.
![en-us_image_0000001224173270](figures/en-us_image_0000001224173270.png)
2. In **Partition Options**, modify the items selected in the preceding step.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> Set the start address and length of the partition based on the size of the files to be burnt. Make sure the size of the partition is greater than that of the files to be burnt and the partition addresses of the files to be burnt do not overlap.
![en-us_image_0000001268653461](figures/en-us_image_0000001268653461.png)
3. Follow the same procedure to modify the information about the **parameter**, **uboot**, **boot_linux**, **system**, **vendor**, and **userdata** files.
7. When you finish modifying, click **Save** on the top.
8. Click **Open** to open the project file. Click ![en-us_image_0000001239221905](figures/en-us_image_0000001239221905.png) to open DevEco Device Tool. Then, choose **PROJECT TASKS** > **hh_scdy200** > **Upload** to start burning.
![en-us_image_0000001194821710](figures/en-us_image_0000001194821710.png)
9. If the message "Operation paused, Please press Enter key to continue" is displayed, press **Enter**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> If the message "The board is not in Loader mode. Please Hold on the VOL+key..." is displayed, place the development board in Loader mode as follows: Press and hold the Volume+ key for 3 seconds, press the RESET key, wait for 3 seconds, and then release the Volume+ key.
10. Wait until the burning is complete. If the following message is displayed, the burning is successful.
![en-us_image_0000001194984912](figures/en-us_image_0000001194984912.png)
# Obtaining Source Code
In the Ubuntu environment, perform the following steps to obtain the OpenHarmony source code:
## Before You Start
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
3. Install the git client and git-lfs.
Update the software source:
```
sudo apt-get update
```
Run the following command to install the tools:
```
sudo apt-get install git git-lfs
```
4. Configure user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
```
5. Run the following commands to install the **repo** tool:
In this example, **~/bin** is used as an example installation directory. You can change the directory as needed.
```
mkdir ~/bin
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o ~/bin/repo
chmod a+x ~/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
6. Add the path of the **repo** tool to environment variables.
```
vim ~/.bashrc # Edit environment variables.
export PATH=~/bin:$PATH # Add the path of the **repo** tool to the end of environment variables.
source ~/.bashrc # Apply environment variables.
```
## Procedure
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities.
- **Obtaining OpenHarmony master code**
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
```
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
- **Obtaining OpenHarmony release code**
For details about how to obtain the source code of an OpenHarmony release, see the [Release-Notes](../../release-notes/Readme.md).
## Running prebuilts
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
```
bash build/prebuilts_download.sh
```
# Setting Up Environments for the Mini and Small Systems
## System Requirements
- Windows: Windows 10 (64-bit)
- Ubuntu: Ubuntu 18.04 to 21.10; recommended memory: 16 GB or larger.
- User name: cannot contain Chinese characters
- DevEco Device Tool: 3.0 Release
## Installing Necessary Libraries and Tools
To install the necessary libraries and tools, perform the following steps.
On Ubuntu:
1. Run the following **apt-get** command:
```
sudo apt-get update && sudo apt-get install binutils binutils-dev git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib gcc-arm-linux-gnueabi libc6-dev-i386 libc6-dev-amd64 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 genext2fs device-tree-compiler make libffi-dev e2fsprogs pkg-config perl openssl libssl-dev libelf-dev libdwarf-dev u-boot-tools mtd-utils cpio doxygen liblz4-tool openjdk-8-jre gcc g++ texinfo dosfstools mtools default-jre default-jdk libncurses5 apt-utils wget scons python3.8-distutils tar rsync git-core libxml2-dev lib32z-dev grsync xxd libglib2.0-dev libpixman-1-dev kmod jfsutils reiserfsprogs xfsprogs squashfs-tools pcmciautils quota ppp libtinfo-dev libtinfo5 libncurses5-dev libncursesw5 libstdc++6 gcc-arm-none-eabi vim ssh locales libxinerama-dev libxcursor-dev libxrandr-dev libxi-dev
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> The preceding command is applicable to Ubuntu 18.04. For other Ubuntu versions, modify the preceding installation command based on the installation package name. Where:
>
> - Python 3.8 or a later version is required. This section uses Python 3.8 as an example.
> - Java 8 or later is required. This section uses Java 8 as an example.
>
2. Set Python 3.8 as the default Python version.
Check the location of Python 3.8:
```
which python3.8
```
Change python and python3 to python3.8.
```
sudo update-alternatives --install /usr/bin/python python {python3.8 path} 1 #{Python3.8 path} is the location of Python 3.8 obtained in the previous step.
sudo update-alternatives --install /usr/bin/python3 python3 {python3.8 path} 1 #{Python3.8 path} is the location of Python 3.8 obtained in the previous step.
```
## Installing DevEco Device Tool
To remotely access the Ubuntu environment through Windows to perform operations such as burning, you need to install DevEco Device Tool on both Windows and Ubuntu.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> DevEco Device Tool is a one-stop integrated development environment (IDE) provided for developers of OpenHarmony-powered smart devices. It allows code editing, compiling, burning, and debugging. This document describes how to use DevEco Device Tool to remotely connect to the Ubuntu environment for burning and running.
### Installing DevEco Device Tool for Windows
1. Download the [DevEco Device Tool 3.0 Release](https://device.harmonyos.com/cn/ide#download) Windows edition.
2. Decompress the DevEco Device Tool package, double-click the installer, and then click **Next**.
3. Set the installation path of DevEco Device Tool to a path that does not contain any Chinese characters, and then click **Next**. You are advised to install DevEco Device Tool in a non-system drive.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If you have installed DevEco Device Tool 3.0 Beta2 or earlier, the earlier version will be uninstalled before you install a new version. If the following error message is displayed during the uninstallation, click **Ignore** to continue the installation. This error does not affect the installation of the new version.
>
> ![en-us_image_0000001239275843](figures/en-us_image_0000001239275843.png)
![en-us_image_0000001270076961](figures/en-us_image_0000001270076961.png)
4. When prompted, select the tools to be automatically installed.
1. On the **VSCode installation confirm** page, select **Install VScode 1.62.2 automatically** and click **Next**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If Visual Studio Code 1.62 or later has been installed, this step will be skipped.
![en-us_image_0000001237801283](figures/en-us_image_0000001237801283.png)
2. On the displayed **Python select page**, select **Download from Huawei mirror** and click **Next**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If Python 3.8 or 3.9 has been installed, select **Use one of compatible on your PC**.
![en-us_image_0000001193983334](figures/en-us_image_0000001193983334.png)
5. In the dialog box shown below, click **Next**.
![en-us_image_0000001259180828](figures/en-us_image_0000001259180828.png)
6. Read the user agreement and privacy statement carefully, select **I accept the licenses**, and click **Next**.
![en-us_image_0000001307019009](figures/en-us_image_0000001307019009.png)
7. Wait for the DevEco Device Tool setup wizard to automatically install DevEco Device Tool. After the installation is complete, click **Finish** to close the setup wizard.
![en-us_image_0000001239650137](figures/en-us_image_0000001239650137.png)
8. From Visual Studio Code, access the DevEco Device Tool page. Now you can conduct your development in DevEco Device Tool.
![en-us_image_0000001225760456](figures/en-us_image_0000001225760456.png)
### Installing DevEco Device Tool for Ubuntu
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> If the Ubuntu system has not been set up yet, set it up on a virtual machine running Windows. For details, see [Ubuntu Installation Guide](https://developer.huawei.com/consumer/cn/training/course/video/C101639987816176315). Then, [configure the Ubuntu basic environment](https://developer.huawei.com/consumer/cn/training/course/video/C101639988048536240).
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
```
ls -l /bin/sh
```
![en-us_image_0000001226764302](figures/en-us_image_0000001226764302.png)
2. Start the command-line tool, run the following command, enter your password, and select **No** to set **Ubuntu shell** to **bash**.
```
sudo dpkg-reconfigure dash
```
![en-us_image_0000001243641075](figures/en-us_image_0000001243641075.png)
2. Download the [DevEco Device Tool 3.0 Release](https://device.harmonyos.com/cn/ide#download) Linux edition.
3. Decompress the DevEco Device Tool software package and assign permission on the folder obtained from the decompression.
1. Go to the directory where the DevEco Device Tool software package is stored and run the following command to decompress the software package. In the command, change **devicetool-linux-tool-3.0.0.401.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.401.zip
```
2. Open the folder of the decompressed software package and run the following command to grant the execute permission on the installation file. In the command, change **devicetool-linux-tool-3.0.0.401.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.401.sh
```
4. Run the following command to install DevEco Device Tool, where **devicetool-linux-tool-3.0.0.401.sh** indicates the installation file name.
```
sudo ./devicetool-linux-tool-3.0.0.401.sh
```
5. On the page for agreeing to the user agreement and privacy statement, read and agree to the user agreement and privacy statement.
![en-us_image_0000001322167645](figures/en-us_image_0000001322167645.png)
Wait until the "DevEco Device Tool successfully installed." message is displayed.
![en-us_image_0000001198722374](figures/en-us_image_0000001198722374.png)
## Configuring Windows to Remotely Access the Ubuntu Build Environment
### Installing the SSH Service and Obtaining the IP Address for Remote Access
1. In Ubuntu, open the Terminal tool and run the following command to install the SSH service:
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If the command fails to be executed and the system displays a message indicating that the openssh-server and openssh-client depend on different versions, install the openssh-client of the required version (for example, **sudo apt-get install openssh-client=1:8.2p1-4**) as prompted on the command-line interface (CLI) and run the command again to install the openssh-server.
```
sudo apt-get install openssh-server
```
2. Run the following command to start the SSH service:
```
sudo systemctl start ssh
```
3. Run the following command to obtain the IP address of the current user for remote access to the Ubuntu environment from Windows:
```
ifconfig
```
![en-us_image_0000001215737140](figures/en-us_image_0000001215737140.png)
### Installing Remote SSH
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
![en-us_image_0000001193920448](figures/en-us_image_0000001193920448.png)
2. Click **Install** to install Remote-SSH. After the installation is successful, **Remote-SSH** is displayed on the **INSTALLED** list.
![en-us_image_0000001238880335](figures/en-us_image_0000001238880335.png)
### Remotely Connecting to the Ubuntu Environment
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001238760373](figures/en-us_image_0000001238760373.png), and click + on the **REMOTE EXOPLORER** page.
![en-us_image_0000001215878922](figures/en-us_image_0000001215878922.png)
2. In the **Enter SSH Connection Command** text box, enter **ssh *username*\@*ip_address***, where *ip_address* indicates the IP address of the remote computer to be connected and *username* indicates the account name used for logging in to the remote computer.
![en-us_image_0000001215879750](figures/en-us_image_0000001215879750.png)
3. In the displayed dialog box, select the default first option as the SSH configuration file.
![en-us_image_0000001260519729](figures/en-us_image_0000001260519729.png)
4. Under **SSH TARGETS**, find the remote computer and click ![en-us_image_0000001194080414](figures/en-us_image_0000001194080414.png) to start it.
![en-us_image_0000001215720398](figures/en-us_image_0000001215720398.png)
5. In the displayed dialog box, select **Linux**, select **Continue**, and enter the password for logging in to the remote computer.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> To eliminate the need for frequently entering the password for logging in to the remote computer, [set an SSH public key](https://device.harmonyos.com/cn/docs/documentation/guide/ide-registering-public-key-0000001247162706).
![en-us_image_0000001215897530](figures/en-us_image_0000001215897530.png)
After the connection is successful, the plug-in is automatically installed in the **.vscode-server** folder on the remote computer. After the installation is complete, reload Visual Studio Code in Windows as prompted. Then you can develop, compile, and burn source code in DevEco Device Tool on Windows.
## Obtaining Source Code
In the Ubuntu environment, perform the following steps to obtain the OpenHarmony source code:
### Preparations
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
3. Install the git client and git-lfs. (Skip this step if these tools have been installed in Installing Required Libraries and Tools. )
Update the software source:
```
sudo apt-get update
```
Run the following command to install the tools:
```
sudo apt-get install git git-lfs
```
4. Configure user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
```
5. Run the following commands to install the **repo** tool:
In this example, **~/bin** is used as an example installation directory. You can change the directory as needed.
```
mkdir ~/bin
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o ~/bin/repo
chmod a+x ~/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
6. Add the path of the **repo** tool to environment variables.
```
vim ~/.bashrc # Edit environment variables.
export PATH=~/bin:$PATH # Add the path of the **repo** tool to the end of environment variables.
source ~/.bashrc # Apply environment variables.
```
### How to Obtain
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities.
- **Obtaining OpenHarmony master code**
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
```
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
- **Obtaining OpenHarmony release code**
For details about how to obtain the source code of an OpenHarmony release, see the [Release-Notes](../../release-notes/Readme.md).
### Running prebuilts
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
```
bash build/prebuilts_download.sh
```
## Installing the Compilation Tools
For details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
Perform the following steps in Ubuntu:
### Installing hb
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> To install a proxy, see [Configuring the Proxy](../quick-start/quickstart-lite-reference.md#configuring-the-proxy).
1. Run the following command to install hb and update it to the latest version:
```
pip3 install --user build/lite
```
2. Set the environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
export PATH=~/.local/bin:$PATH
```
Update the environment variable.
```
source ~/.bashrc
```
3. Run the **hb -h** command in the source code directory. If the following information is displayed, the installation is successful:
```
usage: hb
OHOS build system
positional arguments:
{build,set,env,clean}
build Build source code
set OHOS build settings
env Show OHOS build env
clean Clean output
optional arguments:
-h, --help show this help message and exit
```
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**<br>
> - Run the following command to uninstall hb:
>
> ```
> pip3 uninstall ohos-build
> ```
>
> - If any issue occurs during the hb installation, see [FAQs](../quick-start/quickstart-lite-faq-hb.md) to troubleshoot.
### Installing LLVM (Only Required for OpenHarmony_v1.x)
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**<br>
>
> When downloading source code under the OpenHarmony_v1.x branches or tags, perform the operation procedure described in this section to install LLVM 12.0.1.
>
> When downloading source code under the Master or non-OpenHarmony_v1.x branches or tags, skip this section. hb will automatically download the latest version of LLVM.
1. Start a Linux server.
2. [Download LLVM](https://repo.huaweicloud.com/openharmony/compiler/clang/12.0.1-530132/linux/clang-530132-linux-x86_64.tar.bz2).
3. Decompress the LLVM installation package to **~/llvm**.
```
tar -jxvf clang.tar.bz2 -C ~/
mv ~/clang-530132/ ~/llvm
```
4. Set an environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
export PATH=~/llvm/bin:$PATH
```
5. Validate the environment variable.
```
source ~/.bashrc
```
## Getting Started with Mini and Small Systems (IDE Mode)
- [Mini and Small System Overview](quickstart-ide-lite-overview.md)
- Setting Up Environments for the Mini and Small Systems
- [Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-lite-env-setup-win-ubuntu.md)
- [Obtaining Source Code](quickstart-ide-lite-sourcecode-acquire.md)
- [Creating a Source Code Project](quickstart-ide-lite-create-project.md)
- Running a Hello World Program
- Hi3861 Development Board
- [Writing a Hello World Program](quickstart-ide-lite-steps-hi3861-helloworld.md)
- [Building](quickstart-ide-lite-steps-hi3861-building.md)
- [Burning](quickstart-ide-lite-steps-hi3861-burn.md)
- [Networking](quickstart-ide-lite-steps-hi3861-netconfig.md)
- [Debugging and Verification](quickstart-ide-lite-steps-hi3861-debug.md)
- [Running](quickstart-ide-lite-steps-hi3861-running.md)
- Hi3516 Development Board
- [Writing a Hello World Program](quickstart-ide-lite-steps-hi3516-helloworld.md)
- [Building](quickstart-ide-lite-steps-hi3516-building.md)
- [Burning](quickstart-ide-lite-steps-hi3516-burn.md)
- [Running](quickstart-ide-lite-steps-hi3516-running.md)
- Appendix
- Introduction to Development Boards
- [Introduction to the Hi3861 Development Board](quickstart-ide-lite-introduction-hi3861.md)
- [Introduction to the Hi3516 Development Board](quickstart-ide-lite-introduction-hi3516.md)
# Introduction to the Hi3516 Development Board
## Overview
Hi3516D V300 is a next-generation system on chip (SoC) designed for the industry-dedicated smart HD IP camera. It introduces a next-generation image signal processor (ISP), the H.265 video compression encoder, and a high-performance NNIE engine, leading the industry in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption.
**Figure 1** Hi3516 front view
![en-us_image_0000001227082182](figures/en-us_image_0000001227082182.png)
## Development Board Specifications
**Table 1** Hi3516 specifications
| Item| Description|
| -------- | -------- |
| Processor and internal memory| -&nbsp;Hi3516D V300 chip<br>-&nbsp;DDR3&nbsp;1GB<br>-&nbsp;eMMC 4.5, 8 GB capacity|
| External components| -&nbsp;Ethernet port<br>-&nbsp;Audio and video<br>&nbsp;&nbsp;-&nbsp;1 voice input<br>&nbsp;&nbsp;-&nbsp;1 mono channel (AC_L) output, connected to a 3 W power amplifier (LM4871)<br>&nbsp;&nbsp;-&nbsp;MicroHDMI (1-channel HDMI 1.4)<br>-&nbsp;Camera<br>&nbsp;&nbsp;-&nbsp;Sensor IMX335<br>&nbsp;&nbsp;-&nbsp;M12 lens, 4 mm focal length, and 1.8 aperture<br>-&nbsp;Display<br>&nbsp;&nbsp;-&nbsp;LCD connector (2.35-inch)<br>&nbsp;&nbsp;-&nbsp;LCD connector (5.5-inch)<br>-&nbsp;External components and ports<br>&nbsp;&nbsp;-&nbsp;Memory card port<br>&nbsp;&nbsp;-&nbsp;JTAG/I2S port<br>&nbsp;&nbsp;-&nbsp;ADC port<br>&nbsp;&nbsp;-&nbsp;Steering gear port<br>&nbsp;&nbsp;-&nbsp;Grove connector<br>&nbsp;&nbsp;-&nbsp;USB 2.0 (Type-C)<br>&nbsp;&nbsp;-&nbsp;Three function keys, two user-defined keys, and one upgrade key<br>&nbsp;&nbsp;-&nbsp;LED indicator, green or red|
# Introduction to the Hi3861 Development Board
## Overview
Hi3861 is a 2 x 5 cm development board. It is a 2.4 GHz WLAN SoC chip that highly integrates the IEEE 802.11b/g/n baseband and radio frequency (RF) circuit. It supports OpenHarmony and provides an open and easy-to-use development and debugging environment.
**Figure 1** Hi3861 development board
![en-us_image_0000001226634692](figures/en-us_image_0000001226634692.png)
The Hi3861 development board can also be connected to the Hi3861 mother board to expand its peripheral capabilities. The following figure shows the Hi3861 mother board.
**Figure 2** Hi3861 mother board
![en-us_image_0000001226794660](figures/en-us_image_0000001226794660.png)
- The RF circuit includes modules such as the power amplifier (PA), low noise amplifier (LNA), RF Balun, antenna switch, and power management. It supports a standard bandwidth of 20 MHz and a narrow bandwidth of 5 MHz or 10 MHz, and provides a maximum rate of 72.2 Mbit/s at the physical layer.
- The Hi3861 WLAN baseband supports the orthogonal frequency division multiplexing (OFDM) technology and is backward compatible with the direct sequence spread spectrum (DSSS) and complementary code keying (CCK) technologies. In addition, the Hi3861 WLAN baseband supports various data rates specified in the IEEE 802.11 b/g/n protocol.
- The Hi3861 chip integrates the high-performance 32-bit microprocessor, hardware security engine, and various peripheral interfaces. The peripheral interfaces include the Synchronous Peripheral Interface (SPI), Universal Asynchronous Receiver & Transmitter (UART), the Inter-Integrated Circuit (I2C), Pulse Width Modulation (PWM), General Purpose Input/Output (GPIO) interface, and Analog to Digital Converter (ADC). The Hi3861 chip also supports the high-speed Secure Digital Input/Output (SDIO) 2.0 interface, with a maximum clock frequency of 50 MHz. This chip has a built-in static random access memory (SRAM) and flash memory, so that programs can run independently or run from a flash drive.
- The Hi3861 chip applies to Internet of Things (IoT) devices such as smart home appliances.
**Figure 3** Functional block diagram of Hi3861
![en-us_image_0000001226794688](figures/en-us_image_0000001226794688.png)
## Resources and Constraints
The resources of the Hi3861 development board are limited. The entire board has a 2 MB flash memory and 352 KB RAM. When writing service code, pay attention to the resource usage efficiency.
## Development Board Specifications
**Table 1** Hi3861 specifications
| Item| Description|
| -------- | -------- |
| General specifications| -&nbsp;1 x 1 2.4 GHz frequency band (ch1–ch14)<br>-&nbsp;PHY supports IEEE 802.11b/g/n.<br>-&nbsp;MAC supports IEEE802.11d/e/h/i/k/v/w.<br>-&nbsp;Built-in PA and LNA; integrated TX/RX switch and Balun<br>-&nbsp;Support for STA and AP modes. When functioning as an AP, it supports a maximum of 6 STAs.<br>-&nbsp;Support for WFA WPA/WPA2 personal and WPS2.0.<br>-&nbsp;2/3/4-line PTA solution that coexists with BT/BLE chips.<br>-&nbsp;Input voltage range: 2.3 V to 3.6 V<br>-&nbsp;I/O power voltage: 1.8 V or 3.3 V.<br>-&nbsp;RF self-calibration<br>-&nbsp;Low power consumption:<br>&nbsp;&nbsp;-&nbsp;Ultra Deep Sleep mode: 5 μA@3.3 V<br>&nbsp;&nbsp;-&nbsp;DTIM1: 1.5 mA \@3.3V<br>&nbsp;&nbsp;-&nbsp;DTIM3: 0.8 mA \@3.3V|
| PHY features| -&nbsp;Supports all data rates of the IEEE802.11b/g/n single antenna.<br>-&nbsp;Supported maximum rate: 72.2 Mbps\@HT20&nbsp;MCS7<br>-&nbsp;20 MHz standard bandwidth and 5 MHz/10 MHz narrow bandwidth.<br>-&nbsp; STBC.<br>-&nbsp;Short-GI.|
| MAC features| -&nbsp;A-MPDU and A-MSDU.<br>-&nbsp;Blk-ACK.<br>-&nbsp;QoS to meet the quality requirements of different services.|
| CPU subsystem| - &nbsp;High-performance 32-bit microprocessor with a maximum working frequency of 160 MHz.<br>-&nbsp;Embedded SRAM of 352 KB; ROM of 288 KB<br>-&nbsp;Embedded 2 MB flash memory|
| Peripheral ports| -&nbsp;One SDIO interface, two SPI interfaces, two I2C interfaces, three UART interfaces, 15 GPIO interfaces, seven ADC inputs, six PWM interfaces, and one I2S interface (Note: These interfaces are all multiplexed.)<br>-&nbsp;Frequency of the external main crystal: 40 MHz or 24 MHz|
| Others| -&nbsp;Package: QFN-32, 5 mm x 5 mm<br>-&nbsp;Working temperature: -40°C to +85°C|
## OpenHarmony Key Features
OpenHarmony provides a wide array of available capabilities based on the Hi3861 platform. The following table describes the available key components.
**Table 2** Key components of OpenHarmony
| Component| Capability|
| -------- | -------- |
| WLAN| Provides the WLAN service capability. For example, connecting to or disconnecting from a station or hotspot, and querying the status of a station or hotspot.|
| IoT controller| Provides the capability of operating peripherals, including the I2C, I2S, ADC, UART, SPI, SDIO, GPIO, PWM and flash memory.|
| DSoftBus| Provides the capabilities of device discovery and data transmission in the distributed network.|
| hichainsdk| Provides the capability of securely transferring data between devices when they are interconnected.|
| huks| Provides capabilities of key management, encryption, and decryption.|
| System service management| Provides a unified OpenHarmony service development framework based on the service-oriented architecture.|
| Boot| Provides the entry identifier for starting a system service. When the system service management is started, the function identified by bootstrap is called to start a system service.|
| System attribute| Provides capabilities of obtaining and setting system attributes.|
| Base library| Provides the common basic library capability, including file operations and KV storage management.|
| DFX | Provides the DFX capability, such as logging and printing.|
| XTS | Provides a set of OpenHarmony certification test suites.|
# Mini and Small System Overview
## Introduction
The OpenHarmony mini and small systems apply to devices with a reference memory greater than or equal to 128 KiB. This document helps you quickly get started for development of the OpenHarmony standard system, from environment setup to building, burning, and startup.
To accommodate different developer habits, OpenHarmony provides two modes for getting started with the standard system:
- IDE mode: DevEco Device Tool is used for one-stop development, covering dependency installation, building, burning, and running.
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool. OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
This document exemplifies how to use the installation package mode. For details about the IDE mode, see [Getting Started with Mini and Small Systems (IDE Mode)](../quick-start/quickstart-ide-lite-overview.md).
## Development Environment
In the Windows+Ubuntu hybrid environment for OpenHarmony development:
- Windows: used for source code development and burning.
- Ubuntu: used for source code building.
This document describes how to develop OpenHarmony in the Windows+Ubuntu environment.
## Development Boards
In this document, two development board models are used as examples: Hi3861 and Hi3516D V300. For details about these development boards, see [Appendix](../quick-start/quickstart-lite-introduction-hi3861.md). You can purchase the development board as required.
## Development Process
Below you can see the quick start process for the development of the mini and small systems.
**Figure 1** Quick start process for the development of the mini and small systems
![en-us_image_0000001271562257](figures/en-us_image_0000001271562257.png)
## Getting Started with Mini and Small Systems (Installation Package Mode)
- [Mini and Small System Overview](quickstart-lite-overview.md)
- [Setting Up Environments for the Mini and Small Systems](quickstart-lite-env-setup.md)
- Running a Hello World Program
- Hi3861 Development Board
- [Setting Up the Hi3861 Development Board Environment](quickstart-lite-steps-hi3861-setting.md)
- [Writing a Hello World Program](quickstart-lite-steps-hi3861-helloworld.md)
- [Building](quickstart-lite-steps-hi3861-building.md)
- [Burning](quickstart-lite-steps-hi3861-burn.md)
- [Networking](quickstart-lite-steps-hi3861-netconfig.md)
- [Debugging and Verification](quickstart-lite-steps-hi3861-debug.md)
- [Running](quickstart-lite-steps-hi3861-running.md)
- Hi3516 Development Board
- [Setting Up the Hi3516 Development Board Environment](quickstart-lite-steps-hi3516-setting.md)
- [Writing a Hello World Program](quickstart-lite-steps-hi3516-helloworld.md)
- [Building](quickstart-lite-steps-hi3516-building.md)
- [Burning](quickstart-lite-steps-hi3516-burn.md)
- [Running](quickstart-lite-steps-hi3516-running.md)
- FAQs
- [Fixing hb Installation Issues](quickstart-lite-faq-hb.md)
- [Fixing Compilation Issues](quickstart-lite-faq-compose.md)
- [Fixing Burning Issues](quickstart-lite-faq-burning.md)
- Appendix
- Introduction to Development Boards
- [Introduction to the Hi3861 Development Board](quickstart-lite-introduction-hi3861.md)
- [Introduction to the Hi3516 Development Board](quickstart-lite-introduction-hi3516.md)
- [Reference](quickstart-lite-reference.md)
- [Burning Code by Using HiTool](quickstart-lite-hitool.md)
# Running
## Starting the System
After burning is completed, you need to configure the bootloader to run the OpenHarmony system.
1. In the Hi3516D V300 task, click **Configure bootloader (Boot OS)** to configure the bootloader.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The bootloader configuration in DevEco Device Tool has been adapted to Hi3516D V300. Therefore, no manual modification is needed.
![en-us_image_0000001209906547](figures/en-us_image_0000001209906547.png)
2. When the message shown below is displayed, restart the development board. If "SUCCESS" is displayed, it indicates that the configuration is successful.
![en-us_image_0000001210385161](figures/en-us_image_0000001210385161.png)
3. Click **Monitor** on the taskbar to start the serial port tool.
![en-us_image_0000001164506870](figures/en-us_image_0000001164506870.png)
4. When the command output is displayed, press **Enter** until **OHOS #** is displayed, indicating that the system is started successfully.
![en-us_image_0000001198626874](figures/en-us_image_0000001198626874.png)
## Running a Hello World Program
After the system is started, copy the executable file **helloworld** in the **out** directory of the source code to the **bin** directory, and run the Hello World program as follows:
1. Go to the **bin** directory on the startup page.
```
cd bin
```
2. Run the following command to run the **helloworld** program:
```
./helloworld
```
If the message "Hello World!" is displayed, the program runs successfully.
![en-us_image_0000001271234769](figures/en-us_image_0000001271234769.png)
## Next
Congratulations! You have finished all steps! Proceed to [develop a sample camera with a screen](../guide/device-camera-control-overview.md) to better familiarize yourself with OpenHarmony development.
# Setting Up the Hi3516 Development Board Environment
## Environment Requirements
### Hardware
- Hi3516D V300 IoT camera development board
- USB-to-serial cable and network cable (The Linux workstation is connected to the Hi3516D V300 development board through the USB-to-serial cable and network cable.)
### Software
The following table describes the tools required for setting up the general environment for a Linux server of the Hi3516D V300 development board.
**Table 1** Linux server development tools and functions
| Development Tool| Description|
| -------- | -------- |
| dosfstools, mtools, and mtd-utils| Pack files.|
| Java virtual machine (JVM)| Compiles, debugs, and runs Java programs.|
## Installing Linux Build Tools
Hi3516D V300 depends on the following tools: dosfstools, mtools, mtd-utils, Java Runtime Environment (JRE), and Java SDK.
These tools have been installed in [Installing Necessary Libraries and Tools](../quick-start/quickstart-lite-env-setup.md#installing-necessary-libraries-and-tools).
# Burning
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
Hi3861 V100 supports burning through the serial port. To burn source code through the serial port in Windows, perform the following steps:
## Importing Source Code
After the building is complete, ensure that you can [remotely access the Ubuntu environment from Windows](quickstart-lite-env-setup.md). Then, perform the following steps to import the source code before burning:
1. Open DevEco Device Tool, go to the home page, and click **Import Project** to open your project or source code.
![en-us_image_0000001278358765](figures/en-us_image_0000001278358765.png)
2. Select the root directory of the OpenHarmony source code (in Ubuntu), select **Import OpenHarmony Source**, and click **Import**.
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> Make sure the selected directory does not contain Chinese characters or spaces.
![en-us_image_0000001271477045](figures/en-us_image_0000001271477045.png)
3. On the **Import Project** page, select a product, and the SoC, board, company, and kernel fields will be automatically populated. Then, select the OpenHarmony source code version for **Ohos Ver**.
![en-us_image_0000001279425450](figures/en-us_image_0000001279425450.png)
4. Click **Open** to open the project or source code.
## Burning
After the source code is imported, perform the following steps:
1. Connect the computer and the target development board through the USB port. For details, see [Introduction to the Hi3861 Development Board](quickstart-lite-introduction-hi3861.md).
2. If your computer does not have the USB-to-serial adapter driver, install it by following the instructions in [Installing the USB-Serial Adapter Driver](https://device.harmonyos.com/en/docs/documentation/guide/hi3861-drivers-0000001058153433).
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
- If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. During the connection, DevEco Device Tool will restart. Therefore, to avoid task interruptions, do not connect to DevEco Device Tool when downloading or building source code.
![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png)
4. Click **Project Settings** on the menu bar to access the Hi3861 V100 project configuration page.
![en-us_image_0000001333802045.png](figures/en-us_image_0000001333802045.png)
5. On the **Tool Chain** tab page, set the Uploader burning tool. You can click **Install** on this page to install the tool online.
![en-us_image_0000001198943768](figures/en-us_image_0000001198943768.png)
6. On the **hi3861** tab page, set the burning options.
- **upload_port**: Select the serial port number obtained.
- **upload_protocol**: Select the burning protocol **hiburn-serial**.
- **upload_partitions**: Select the file for burning. To modify the burning settings for a specific file, click ![en-us_image_0000001265361888](figures/en-us_image_0000001265361888.png) next to the file.
![en-us_image_0000001243704061](figures/en-us_image_0000001243704061.png)
7. When you finish modifying, click **Save** on the top.
8. Click **Open** to open the project file. Then, choose **PROJECT TASKS** > **hi3861** > **Upload** to start burning.
![en-us_image_0000001216440138](figures/en-us_image_0000001216440138.png)
9. When the following information is displayed, press the RST key on the development board within 15 seconds to restart it.
![en-us_image_0000001198466090](figures/en-us_image_0000001198466090.png)
Wait until the burning is complete. When the following message is displayed, the burning is successful.
![en-us_image_0000001216761476](figures/en-us_image_0000001216761476.png)
# Networking
After completing compilation and burning, perform the following to connect the Hi3861 WLAN module to the Internet using AT commands.
1. Click the icon of **DevEco: Serial Monitor** at the bottom of DevEco Device Tool to keep the connection between the Windows workstation and the WLAN module.
**Figure 1** Opening the DevEco Device Tool serial port
![en-us_image_0000001227114644](figures/en-us_image_0000001227114644.png)
2. Reset the Hi3861 WLAN module. The message **ready to OS start** is displayed on the **TERMINAL** panel, indicating that the WLAN module is started successfully.
**Figure 2** Successful resetting of the Hi3861 WLAN module
![en-us_image_0000001226794704](figures/en-us_image_0000001226794704.png)
3. Run the following AT commands in sequence via the serial terminal to start the STA mode, connect to the specified AP, and enable Dynamic Host Configuration Protocol (DHCP).
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> After the development board is started, the serial port prints the test case information. Run the AT command after the test case information is printed. Otherwise, the AT command will be overwritten by the test case information.
```
AT+STARTSTA # Start the STA mode.
AT+SCAN # Scan for available APs.
AT+SCANRESULT # Display the scanning result.
AT+CONN="SSID",,2,"PASSWORD" # Connect to the specified AP. (SSID and PASSWORD represent the name and password of the hotspot to be connected, respectively.)
AT+STASTAT # View the connection result.
AT+DHCP=wlan0,1 # Request the IP address of wlan0 from the AP using DHCP.
```
4. Check whether the Hi3861 WLAN module is properly connected to the gateway, as shown in the following figure.
```
AT+IFCFG # View the IP address assigned to an interface of the module.
AT+PING=X.X.X.X # Check the connectivity between the module and the gateway. Replace X.X.X.X with the actual gateway address.
```
**Figure 3** Successful networking of the Hi3861 WLAN module
![en-us_image_0000001226954648](figures/en-us_image_0000001226954648.png)
# Running
## Viewing Execution Result
After the sample code is compiled, burnt, run, and debugged, restart the development board. If the following messages are displayed, the image is running correctly:
```
ready to OS start
FileSystem mount ok.
wifi init success!
[DEMO] Hello world.
```
## Next
Congratulations! You have finished all steps! Proceed to [develop a sample WLAN product](../guide/device-wlan-led-control.md) to better familiarize yourself with OpenHarmony development.
# Quick Start Overview
OpenHarmony is an open-source distributed operating system for all scenarios. It uses a component-based design to better suit devices with 128 KiB to GiB-level of RAM. You can integrate a flexible combination of system components based on the hardware capabilities of devices.
OpenHarmony defines three basic system types. You only need to select a suitable system type and configure the mandatory component set, thereby developing a system for your device at the minimum workload. The definitions of the basic system types are provided as follows for your reference:
**Table 1** Basic system types
| System Type| Processor| Minimum Memory| Competence|
| -------- | -------- | -------- | -------- |
| Mini system| MCU processors, such as Arm Cortex-M and 32-bit RISC-V| 128 KiB | Provides a variety of lightweight network protocols, a lightweight graphics framework, and a wide range of read/write components with the Internet of Things (IoT) bus. Applicable products include connection modules, sensors, and wearables for smart home.|
| Small system| Application processors, such as Arm Cortex-A| 1 MiB | Provides higher security capabilities, a standard graphics framework, and video encoding and decoding capabilities. Applicable products include smart home products such as IP cameras, peephole cameras, and routers as well as smart travel products such as event data recorders (EDRs).|
| Standard system| Application processors, such as Arm Cortex-A| 128 MiB | Provides a complete application framework supporting enhanced interactions, 3D GPU, hardware composer, diverse components, and rich animations. Applicable products include high-end refrigerator displays.|
This document helps you quickly get started with OpenHarmony device development, from environment setup to "Hello World" program running.
## Operations
To accommodate different developer habits, OpenHarmony provides two modes for getting started with OpenHarmony device development:
**Table 2** Modes for getting started
| Mode| Tool| Description| Target Audience|
| -------- | -------- | -------- | -------- |
| [IDE mode](quickstart-ide-env--win.md) | DevEco Device Tool| DevEco Device Tool, an integrated development environment (IDE), is used for one-stop development, covering dependency installation, building, burning, and running.<br>DevEco Device Tool works in the Windows+Ubuntu hybrid development environment.<br>- Windows: code development, debugging, and image burning<br>- Ubuntu: source code compilation<br>DevEco Device Tool provides an intuitive GUI to accelerate your development.| - Developers who are unfamiliar with the command line<br>- Developers who are accustomed to GUI-based operations|
| [CLI mode](quickstart-pkg-prepare.md)| Command line tools| The command-line interface (CLI) is used to download and install the compilation tools. In Linux, commands are used to build source code. In Windows, the tools provided by the development board vendors are used to burn an image.<br>The CLI mode allows you to install the required toolchain easily in a centralized manner.| Developers who are familiar with the command line|
## Development Boards
This document describes the system development with three typical development boards. Purchase the development board as needed.
**Table 3** Mapping between development boards and system types
| Development Board| System Type| Description|
| -------- | -------- | -------- |
| Hi3861 WLAN module| Mini| [Hi3861 Development Board](quickstart-appendix-hi3861.md)|
| Hi3516DV300 | Small| [Hi3516 Development Board](quickstart-appendix-hi3516.md)|
| RK3568 | Standard| [RK3568 Development Board](quickstart-appendix-rk3568.md)|
## How to Develop
Below you can see the quick start process.
**Figure 1** Quick start process
![quickstart-overview-process](figures/quickstart-overview-process.png)
# Building # Building Source Code
You can build source code with hb or the **build.sh** script. This section exemplifies how to build source code with hb. For details about how to build with the **build.sh** script, see [Building Source Code Using the build.sh Script](../quick-start/quickstart-lite-reference.md). You can build source code with hb or the **build.sh** script. This topic describes how to build source code with hb. For details about how to use the **build.sh** script, see [Building Source Code Using the build.sh Script](quickstart-pkg-common-build.md).
Go to the root directory of the source code and run the build command. For details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
## Prerequisites
- The [required libraries and tools](quickstart-pkg-install_package.md) have been installed.
- The [compilation tools](quickstart-pkg-install_tool.md) have been installed.
- The Hello World program is ready for use.
- The access to the Ubuntu environment is normal.
## Procedure
Go to the root directory of the source code and run the build command.
1. Set the build path. 1. Set the build path.
...@@ -20,11 +35,17 @@ Go to the root directory of the source code and run the build command. ...@@ -20,11 +35,17 @@ Go to the root directory of the source code and run the build command.
``` ```
3. Select **ipcamera_hispark_taurus** under **hisilicon** and press **Enter**. 3. Select **ipcamera_hispark_taurus** under **hisilicon** and press **Enter**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> When adapting the development board to a specific use case, select an appropriate build form factor, that is, **product** settings. For details, see [Build Form Factors](quickstart-appendix-compiledform.md).
4. Start building. **Figure 1** Hi3516 build settings
![quickstart-lite-3516-build](figures/quickstart-lite-3516-build.png)
4. Start building.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> - To build a component (for example, **hello**), run the **hb build -T _ Target name _** command. > - To build a component (for example, **hello**), run the **hb build -T *targetName*** command.
> >
> - To build a product incrementally, run the **hb build** command. > - To build a product incrementally, run the **hb build** command.
> >
...@@ -37,13 +58,9 @@ Go to the root directory of the source code and run the build command. ...@@ -37,13 +58,9 @@ Go to the root directory of the source code and run the build command.
hb build -f hb build -f
``` ```
**Figure 1** Hi3516 build settings
![en-us_image_0000001271594749](figures/en-us_image_0000001271594749.png)
5. Check the build result. If "build success" is displayed, the building is successful. 5. Check the build result. If "build success" is displayed, the building is successful.
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE** > ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
>
> Paths to burning-related files: > Paths to burning-related files:
> >
> - Build result and log files: **out/hispark_taurus/ipcamera_hispark_taurus** > - Build result and log files: **out/hispark_taurus/ipcamera_hispark_taurus**
......
# Burning Code by Using HiTool # Burning an Image
To burn code to the Hi3516D V300 development board, you can use HiTool in addition to DevEco Device Tool. The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You can also do so using DevEco Device Tool, by following instructions in [Burning an Image](quickstart-appendix-hi3516-ide.md#burning-an-image).
## Prerequisites ## **Prerequisites**
- The source code of the development board has been compiled into files for burning. - The source code of the development board has been compiled into files for burning.
- [HiTool](http://www.hihope.org/download/download.aspx) has been installed on the client platform (for example, a Windows-based computer). - [HiTool](http://www.hihope.org/download/download.aspx) has been installed on the client platform (for example, a Windows-based computer).
- The USB driver has been installed on the client platform. For details, see [Installing the USB Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393). - The USB port driver has been installed on the client platform. For details, see [Installing the USB Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393).
- A serial port terminal tool, such as IPOP, has been installed on the client platform. - A serial port terminal tool, such as IPOP, has been installed on the client platform.
...@@ -20,16 +20,12 @@ To burn code to the Hi3516D V300 development board, you can use HiTool in additi ...@@ -20,16 +20,12 @@ To burn code to the Hi3516D V300 development board, you can use HiTool in additi
## Procedure ## Procedure
1. Prepare the files to be burnt. 1. Prepare the files to be burnt.
1. On the client platform, create a folder for storing the files to be burnt, for example, **D:\liteos** or **D:\linux**. 1. On the client platform, create a folder for storing the files to be burnt, for example, **D:\liteos** or **D:\linux**.
2. Save the burning configuration file and boot file to the new folder. 2. Save the burning configuration file and boot file to the new folder.
- For L1_LiteOS, the burning configuration file is **L1_3516_liteos.xml**, and the boot file is **[u-boot-hi3516dv300.bin](https://gitee.com/openharmony/device_board_hisilicon/tree/master/hispark_taurus/uboot/out/boot)**.
- For the small system using the LiteOS kernel, the burning configuration file is **L1_3516_liteos.xml**, and the boot file is [u-boot-hi3516dv300.bin](https://gitee.com/openharmony/device_board_hisilicon/tree/master/hispark_taurus/uboot/out/boot).
You need to prepare the **L1_3516_liteos.xml** file on your own by applying the template below: You need to prepare the **L1_3516_liteos.xml** file on your own by applying the template below:
``` ```
<?xml version="1.0" encoding="GB2312" ?> <?xml version="1.0" encoding="GB2312" ?>
<Partition_Info ProgrammerFile=""> <Partition_Info ProgrammerFile="">
...@@ -39,8 +35,7 @@ To burn code to the Hi3516D V300 development board, you can use HiTool in additi ...@@ -39,8 +35,7 @@ To burn code to the Hi3516D V300 development board, you can use HiTool in additi
<Part Sel="1" PartitionName="" FlashType="emmc" FileSystem="none" Start="60M" Length="50M" SelectFile="D:\liteos\userfs_vfat.img"/> <Part Sel="1" PartitionName="" FlashType="emmc" FileSystem="none" Start="60M" Length="50M" SelectFile="D:\liteos\userfs_vfat.img"/>
</Partition_Info> </Partition_Info>
``` ```
- For L1_Linux, the burning configuration file is **L1_3516_linux.xml**, and the boot file is **[u-boot-hi3516dv300.bin](https://gitee.com/openharmony/device_board_hisilicon/tree/master/hispark_taurus/uboot/out/boot)**.
- For the small system using the Linux kernel, the burning configuration file is **L1_3516_linux.xml**, and the boot file is [u-boot-hi3516dv300.bin](https://gitee.com/openharmony/device_board_hisilicon/tree/master/hispark_taurus/uboot/out/boot).
You need to prepare the **L1_3516_linux.xml** file on your own by applying the template below: You need to prepare the **L1_3516_linux.xml** file on your own by applying the template below:
...@@ -56,48 +51,41 @@ To burn code to the Hi3516D V300 development board, you can use HiTool in additi ...@@ -56,48 +51,41 @@ To burn code to the Hi3516D V300 development board, you can use HiTool in additi
``` ```
3. Download the compiled source package to the client platform, decompress the package, and copy the files required for burning to the folder created in step 1. 3. Download the compiled source package to the client platform, decompress the package, and copy the files required for burning to the folder created in step 1.
For the Hi3516 development board, the files required for burning of the small system are as follows: For the Hi3516 development board, the files required for burning of the mini system are as follows:
- LiteOS: **OHOS_Image.bin**, **rootfs_vfat.img**, and **userfs_vfat.img** - L1_LiteOS: **OHOS_Image.bin**, **rootfs_vfat.img**, and **userfs_vfat.img**
- Linux: **uImage_hi3516dv300_smp**, **rootfs_ext4.img**, **userfs_ext4.img**, and **userdata_ext4.img** - 1_Linux: **uImage_hi3516dv300_smp**, **rootfs_ext4.img**, **userfs_ext4.img**, and **userdata_ext4.img**
2. Burn the image files using HiTool. 2. Burn the image files using HiTool.
1. Open HiTool. 1. Open HiTool.
2. Set up HiTool. 2. Set up HiTool.
Set the transfer mode to USB and burning mode to eMMC (the storage medium of the development board is eMMC). Set the transfer mode to USB and burning mode to eMMC (the storage medium of the development board is eMMC).
3. Click **Browse** and select the burning configuration file (for example, **L1_3516_linux.xml**) from the folder created in step 1. 3. Click **Browse** and select the burning configuration file (for example, **L1_3516_linux.xml**) from the folder created in step 1.
![en-us_image_0000001249937195](figures/en-us_image_0000001249937195.png)
4. After clicking the **Burn** button, press and hold the **Update** key next to the serial port on the development board, and remove and insert the USB cable. 4. After clicking the **Burn** button, press and hold the **Update** key next to the serial port on the development board, and remove and insert the USB cable.
After the burning starts, logs are displayed in the console area at the bottom of HiTool. After the burning starts, logs are displayed in the console area at the bottom of HiTool.
When the burning is complete, HiTool displays a dialog box indicating that the burning is successful. When the burning is complete, HiTool displays a dialog box indicating that the burning is successful.
5. Click **OK**. 5. Click **OK**.
3. Import startup parameters. 3. Import startup parameters.
1. Use the terminal tool to enable the serial port. 1. Use the terminal tool to enable the serial port.
2. Restart the development board by removing and inserting its power supply. Press **Enter** in the serial port terminal tool within 3 seconds. 2. Restart the development board by removing and inserting its power supply. Press **Enter** in the serial port terminal tool within 3 seconds.
If **hisilicon \#** is displayed on the terminal tool page, the serial port of the development board is connected. If **hisilicon \#** is displayed on the terminal tool page, the serial port of the development board is connected.
3. Copy the following startup parameters in the serial port terminal tool and press **Enter** to complete the setup. 3. Copy the following startup parameters in the serial port terminal tool and press **Enter** to complete the setup.
- Startup parameters corresponding to L1_LiteOS:
- The startup parameters for the small system using the LiteOS kernel are as follows:
``` ```
setenv bootcmd "mmc read 0x0 0x80000000 0x800 0x4800;go 0x80000000"; setenv bootcmd "mmc read 0x0 0x80000000 0x800 0x4800;go 0x80000000";
setenv bootargs "console=ttyAMA0,115200n8 root=emmc fstype=vfat rootaddr=10M rootsize=50M rw"; setenv bootargs "console=ttyAMA0,115200n8 root=emmc fstype=vfat rootaddr=10M rootsize=50M rw";
saveenv saveenv
reset sa;reset
``` ```
- The startup parameters for the small system using the Linux kernel are as follows: - Startup parameters corresponding to L1_Linux:
``` ```
setenv bootargs "mem=128M console=ttyAMA0,115200 root=/dev/mmcblk0p3 rw rootfstype=ext4 rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),50M(rootfs),50M(userfs),1024M(userdata)" setenv bootargs "mem=128M console=ttyAMA0,115200 root=/dev/mmcblk0p3 rw rootfstype=ext4 rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),50M(rootfs),50M(userfs),1024M(userdata)"
......
# Writing a Hello World Program # Writing a Hello World Program
The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!" . The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!"
## Example Directory ## Example Directory
...@@ -58,7 +58,7 @@ Perform the steps below in the source code directory: ...@@ -58,7 +58,7 @@ Perform the steps below in the source code directory:
3. Add a component. 3. Add a component.
Modify the **build/lite/components/communication.json** file and add the configuration of **hello_world_app**. The following code snippet is a snippet of the **communication.json** file: The configuration between \#\#start\#\# and \#\#end\#\# is new. (\#\#start\#\# and \#\#end\#\# are only used to identify the location. After the configuration is complete, delete these lines.) Modify the **build/lite/components/communication.json** file and add the configuration of **hello_world_app**. The following code snippet is a snippet of the **communication.json** file, where the configuration between **\#\#start\#\#** and **\#\#end\#\#** is the new entry. (The **\#\#start\#\#** and **\#\#end\#\#** lines are only used to identify the location. After the configuration is complete, delete these lines.)
``` ```
...@@ -121,7 +121,7 @@ Perform the steps below in the source code directory: ...@@ -121,7 +121,7 @@ Perform the steps below in the source code directory:
4. Modify the board configuration file. 4. Modify the board configuration file.
Modify the **vendor/hisilicon/hispark_taurus/config.json** file and add an entry of the **hello_world_app** component. The following code snippet is the configuration of the **applications** subsystem, the configuration between \#\#start\#\# and \#\#end\#\# is new. (\#\#start\#\# and \#\#end\#\# are only used to identify the location. After the configuration is complete, delete these lines.) Modify the **vendor/hisilicon/hispark_taurus/config.json** file and add an entry for the **hello_world_app** component. The following code snippet is the configuration of the **applications** subsystem, where the configuration between **\#\#start\#\#** and **\#\#end\#\#** is the new entry. (The **\#\#start\#\#** and **\#\#end\#\#** lines are only used to identify the location. After the configuration is complete, delete these lines.)
``` ```
......
# Running an Image
After the system is started, copy the executable file **helloworld** in the **out** directory of the source code to the **bin** directory, and run the Hello World program as follows:
## Procedure
1. Go to the **bin** directory on the startup page.
```
cd bin
```
2. Run the following command to run the **helloworld** program:
```
./helloworld
```
If the message "Hello World!" is displayed, the program runs successfully.
![quickstart-pkg-3516-running](figures/quickstart-pkg-3516-running.png)
## Next
Congratulations! You have finished all steps! Proceed to develop samples to better familiarize yourself with OpenHarmony development:
- [Screen and Camera Control](../guide/device-camera-control-overview.md)
- [Visual Application Development](../guide/device-camera-visual-overview.md)
# Building # Building Source Code
You can build source code with hb or the **build.sh** script. This section exemplifies how to build source code with hb. For details about how to build with the **build.sh** script, see [Building Source Code Using the build.sh Script](../quick-start/quickstart-standard-reference.md). You can build source code with hb or the **build.sh** script. This topic describes how to build source code with hb. For details about how to use the **build.sh** script, see [Building Source Code Using the build.sh Script](quickstart-pkg-common-build.md).
Go to the root directory of the source code in the Ubuntu environment and perform the following steps: For details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
## Prerequisites
- The [required libraries and tools](quickstart-pkg-install_package.md) have been installed.
- The [compilation tools](quickstart-pkg-install_tool.md) have been installed.
- The Hello World program is ready for use.
- The access to the Ubuntu environment is normal.
## Procedure
Go to the root directory of the source code in the Ubuntu environment and perform the following steps:
1. Set the build path. 1. Set the build path.
``` ```
...@@ -19,12 +34,27 @@ Go to the root directory of the source code in the Ubuntu environment and perfor ...@@ -19,12 +34,27 @@ Go to the root directory of the source code in the Ubuntu environment and perfor
. .
``` ```
3. Select **rk3568** under **built-in** and press **Enter**. 3. Select **rk3568** under **hihope** and press **Enter**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> When adapting the development board to a specific use case, select an appropriate build form factor, that is, **product** settings. For details, see [Build Form Factors](quickstart-appendix-compiledform.md).
**Figure 1** RK3568 build settings
![quickstart-standard-rk3568-build](figures/quickstart-standard-rk3568-build.png)
4. If you are building the source code into a 32-bit system, skip this step.
If you are building the source code into a 64-bit system, run the following command:
4. Start building.
```
hb build --target-cpu arm64
```
5. Start building.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> - To build a component (for example, **hello**), run the **hb build -T _ Target name _** command. > - To build a component (for example, **hello**), run the **hb build -T *targetName*** command.
> >
> - To build a product incrementally, run the **hb build** command. > - To build a product incrementally, run the **hb build** command.
> >
...@@ -37,12 +67,7 @@ Go to the root directory of the source code in the Ubuntu environment and perfor ...@@ -37,12 +67,7 @@ Go to the root directory of the source code in the Ubuntu environment and perfor
hb build -f hb build -f
``` ```
6. Check the build result. If "rk3568 build success" is displayed, the building is successful.
**Figure 1** RK3568 build settings
![en-us_image_0000001226922302](figures/en-us_image_0000001226922302.png)
5. Check the build result. If "rk3568 build success" is displayed, the building is successful.
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE** > ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
>
> The build result and log files are stored in **out/rk3568**. > The build result and log files are stored in **out/rk3568**.
# Burning an Image
The following exemplifies how to burn an image to RK3568 using RKDevTool. You can also do so using DevEco Device Tool, by following instructions in [Burning an Image](quickstart-ide-3568-burn.md).
## **Prerequisites**
- The source code of the development board has been compiled into files for burning.
- [RKDevTool and the USB port driver](https://gitee.com/hihope_iot/docs/tree/master/HiHope_DAYU200/%E7%83%A7%E5%86%99%E5%B7%A5%E5%85%B7%E5%8F%8A%E6%8C%87%E5%8D%97/windows) have been installed on the client platform (for example, a Windows-based computer).
## Procedure
Follow the instructions in [HiHope_DAYU200 Burning Guide](https://gitee.com/hihope_iot/docs/blob/master/HiHope_DAYU200/docs/%E7%83%A7%E5%BD%95%E6%8C%87%E5%AF%BC%E6%96%87%E6%A1%A3.md).
# Writing a Hello World Program # Writing a Hello World Program
The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!" . The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!"
## Example Directory ## Example Directory
...@@ -75,7 +75,6 @@ Perform the steps below in the source code directory: ...@@ -75,7 +75,6 @@ Perform the steps below in the source code directory:
``` ```
2. Create a build file. 2. Create a build file.
1. Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows: 1. Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows:
``` ```
...@@ -84,7 +83,7 @@ Perform the steps below in the source code directory: ...@@ -84,7 +83,7 @@ Perform the steps below in the source code directory:
sources = [ # Source code of the module. sources = [ # Source code of the module.
"src/helloworld.c" "src/helloworld.c"
] ]
include_dirs = [ # Directory of header file on which the module depends. include_dirs = [ # Directory of header files on which the module depends.
"include" "include"
] ]
cflags = [] cflags = []
...@@ -134,7 +133,7 @@ Perform the steps below in the source code directory: ...@@ -134,7 +133,7 @@ Perform the steps below in the source code directory:
} }
``` ```
The **bundle.json** file consists of two parts. The first part describes the information about the subsystem to which the component belongs, and the second part defines the component building configuration. When adding a part, you need to specify the **sub_component** contained in the part. If there are interfaces provided for other components, describe them in **inner_kits**. If there are test cases, describe them in **test**. The **bundle.json** file consists of two parts. The first part describes the information about the subsystem to which the component belongs, and the second part defines the build configuration for the component. When adding a component, you must specify the **sub_component** of the component. If there are APIs provided for other components, add them in **inner_kits**. If there are test cases, add them in **test**.
3. Modify the subsystem configuration file. 3. Modify the subsystem configuration file.
...@@ -150,7 +149,7 @@ Perform the steps below in the source code directory: ...@@ -150,7 +149,7 @@ Perform the steps below in the source code directory:
4. Modify the product configuration file. 4. Modify the product configuration file.
In the vendor\hihope\rk3568\config.json file, add the hello part after the existing part. In the **vendor/hihope/rk3568/config.json** file, add the **hello** part after the existing part.
``` ```
"usb:usb_manager_native":{}, "usb:usb_manager_native":{},
......
# Running # Running an Image
## Starting the System ## Starting the System
After the image is burnt and the development board is restarted, the system automatically starts. If the following page is displayed on the screen of the development board, the system is running properly. After the image is burnt and the development board is restarted, the system automatically starts. If the following page is displayed on the screen of the development board, the system is running properly.
**Figure 1** System startup effect **Figure 1** System startup effect
![en-us_image_0000001226602406](figures/en-us_image_0000001226602406.jpg) ![quickstart-pkg-3568-running-restart](figures/quickstart-pkg-3568-running-restart.png)
## Running a Hello World Program ## Running a Hello World Program
1. When the system is running, start the serial port tool (for example, PuTTY), set the baud rate to **1500000**, and connect to the device. 1. When the system is running, start the serial port tool (for example, PuTTY), set the baud rate to **1500000**, and connect to the device.
![en-us_image_0000001226922310](figures/en-us_image_0000001226922310.png) ![rk3568-run-configuration](figures/rk3568-run-configuration.png)
2. Enable the serial port, enter the **helloworld** command in any directory (for example, the root directory of the device) and press **Enter**. If the message "Hello World!" is displayed, the program runs successfully. 2. Enable the serial port, enter the **helloworld** command in any directory (for example, the root directory of the device) and press **Enter**. If the message "Hello World!" is displayed, the program runs successfully.
![en-us_image_0000001271202465](figures/en-us_image_0000001271202465.png) ![helloworld](figures/helloworld.png)
# Building # Building Source Code
You can build source code with hb or the **build.sh** script. This section exemplifies how to build source code with hb. For details about how to build with the **build.sh** script, see [Building Source Code Using the build.sh Script](../quick-start/quickstart-lite-reference.md). You can build source code with hb or the **build.sh** script. This topic describes how to build source code with hb. For details about how to use the **build.sh** script, see [Building Source Code Using the build.sh Script](quickstart-pkg-common-build.md).
Go to the root directory of the source code in the Ubuntu environment and perform the following steps: For details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
## Prerequisites
- The [required libraries and tools](quickstart-pkg-install_package.md) have been installed.
- The [compilation tools](quickstart-pkg-install_tool.md) have been installed.
- The [tools specially required by Hi3861](quickstart-pkg-3861-tool.md) have been installed.
- The Hello World program is ready for use.
- The access to the Ubuntu environment is normal.
## Procedure
Go to the root directory of the source code in the Ubuntu environment and perform the following steps:
1. Set the build path. 1. Set the build path.
...@@ -20,11 +37,17 @@ Go to the root directory of the source code in the Ubuntu environment and perfor ...@@ -20,11 +37,17 @@ Go to the root directory of the source code in the Ubuntu environment and perfor
``` ```
3. Select **wifiiot_hispark_pegasus** under **hisilicon** and press **Enter**. 3. Select **wifiiot_hispark_pegasus** under **hisilicon** and press **Enter**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> When adapting the development board to a specific use case, select an appropriate build form factor, that is, **product** settings. For details, see [Build Form Factors](quickstart-appendix-compiledform.md).
4. Start building. **Figure 1** Hi3861 build settings
![quickstart-lite-3861-build](figures/quickstart-lite-3861-build.png)
4. Start building.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> - To build a component (for example, **hello**), run the **hb build -T _ Target name _** command. > - To build a component (for example, **hello**), run the **hb build -T *targetName*** command.
> >
> - To build a product incrementally, run the **hb build** command. > - To build a product incrementally, run the **hb build** command.
> >
...@@ -37,12 +60,8 @@ Go to the root directory of the source code in the Ubuntu environment and perfor ...@@ -37,12 +60,8 @@ Go to the root directory of the source code in the Ubuntu environment and perfor
hb build -f hb build -f
``` ```
**Figure 1** Hi3861 build settings 5. Check the build result. If "build success" is displayed, the building is successful.
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
![en-us_image_0000001226634716](figures/en-us_image_0000001226634716.png)
5. Check the build result. If "build success" is displayed, the build is successful.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> >
> The build result and log files are stored in **out/hispark_pegasus/wifiiot_hispark_pegasus**. > The build result and log files are stored in **out/hispark_pegasus/wifiiot_hispark_pegasus**.
# Burning an Image
The following exemplifies how to burn an image to Hi3861 using Hi3861. You can also do so using DevEco Device Tool, by following instructions in [Burning an Image](quickstart-ide-3861-burn.md).
## Prerequisites
- The source code of the development board has been compiled into files for burning.
- [HiBurn](https://gitee.com/hihope_iot/docs/tree/master/HiSpark_WiFi_IoT/Software/tools) has been installed on the client platform (for example, a Windows-based computer).
- The USB-serial adapter driver has been installed on the client platform. For details, see [Installing the USB-Serial Adapter Driver](https://device.harmonyos.com/en/docs/documentation/guide/hi3861-drivers-0000001058153433).
- A serial port terminal tool, such as IPOP, has been installed on the client platform.
- The client platform is connected to the development board through a USB cable.
## Procedure
1. Prepare the files to be burnt.
1. On the client platform, create a folder for storing the files to be burnt, for example, **D:\hi3861**.
2. Download the compiled source package to the client platform, decompress the package, and copy the files required for burning to the folder created in step 1.
Specifically, the files required for burning are **Hi3861_wifiiot_app_allinone.bin** and **Hi3861_loader_signed.bin**.
2. Burn the files using HiBurn.
1. Open HiBurn.
2. In the HiBurn window, select a COM port and enable **Select all** and **Auto burn**.
**Figure 1** HiBurn window
![quickstart-pkg-3861-burn-hiburn](figures/quickstart-pkg-3861-burn-hiburn.png)
3. Click **Select file** and select the **Hi3861_wifiiot_app_allinone.bin** file in the folder created in step 1.
**Figure 2** File selected
![quickstart-pkg-3861-burn-selectfile](figures/quickstart-pkg-3861-burn-selectfile.png)
4. Verify the COM port settings and click **Connect**. Then press the Reset button next to the serial port on the development board to start burning.
After the burning starts, logs are displayed in the console area at the bottom of HiBurn.
After the burning is complete, the message "Execution Successful" is displayed in the console area.
**Figure 3** Connect clicked
![quickstart-pkg-3861-burn-connect](figures/quickstart-pkg-3861-burn-connect.png)
**Figure 4** Burning in process after the Reset button is pressed on the development board
![quickstart-pkg-3861-burn-burning](figures/quickstart-pkg-3861-burn-burning.png)
**Figure 5** Burning completed
![quickstart-pkg-3861-burn-end](figures/quickstart-pkg-3861-burn-end.png)
5. Click **Disconnect**.
...@@ -6,7 +6,7 @@ The following exemplifies how to create a program by modifying the source code. ...@@ -6,7 +6,7 @@ The following exemplifies how to create a program by modifying the source code.
1. Determine the directory structure. 1. Determine the directory structure.
Before compiling a service, you must create a directory (or a directory structure) in **./applications/sample/wifi-iot/app** to store source code files. Before writing service code, you must create a directory (or a directory structure) in **./applications/sample/wifi-iot/app** to store source code files.
For example, add the **my_first_app** service to the **app** directory, where **hello_world.c** is the service code and **BUILD.gn** is the compilation script. The directory structure is shown as follows: For example, add the **my_first_app** service to the **app** directory, where **hello_world.c** is the service code and **BUILD.gn** is the compilation script. The directory structure is shown as follows:
...@@ -62,7 +62,7 @@ The following exemplifies how to create a program by modifying the source code. ...@@ -62,7 +62,7 @@ The following exemplifies how to create a program by modifying the source code.
4. Add a component. 4. Add a component.
Modify the **build/lite/components/communication.json** file and add the configuration of **hello_world_app**. The following code snippet is a snippet of the **communication.json** file: The configuration between \#\#start\#\# and \#\#end\#\# is new. (\#\#start\#\# and \#\#end\#\# are only used to identify the location. After the configuration is complete, delete these lines.) Modify the **build/lite/components/communication.json** file and add the configuration of **hello_world_app**. The following code snippet is a snippet of the **communication.json** file, where the configuration between **\#\#start\#\#** and **\#\#end\#\#** is the new entry. (The **\#\#start\#\#** and **\#\#end\#\#** lines are only used to identify the location. After the configuration is complete, delete these lines.)
``` ```
...@@ -125,7 +125,7 @@ The following exemplifies how to create a program by modifying the source code. ...@@ -125,7 +125,7 @@ The following exemplifies how to create a program by modifying the source code.
5. Modify the board configuration file. 5. Modify the board configuration file.
Modify the **vendor/hisilicon/hispark_pegasus/config.json** file and add an entry of the **hello_world_app** component. The following code snippet is the configuration of the **applications** subsystem, the configuration between \#\#start\#\# and \#\#end\#\# is new. (\#\#start\#\# and \#\#end\#\# are only used to identify the location. After the configuration is complete, delete these lines.) Modify the **vendor/hisilicon/hispark_pegasus/config.json** file and add an entry for the **hello_world_app** component. The following code snippet is the configuration of the **applications** subsystem, where the configuration between **\#\#start\#\#** and **\#\#end\#\#** is the new entry. (The **\#\#start\#\#** and **\#\#end\#\#** lines are only used to identify the location. After the configuration is complete, delete these lines.)
``` ```
......
# Debugging and Verification # Running an Image
When the burning and networking are complete, you can use either of the following methods to debug and verify whether the source code has been burnt correctly: ## Networking Configuration
After you have completed building and burning, perform the following to connect the Hi3861 WLAN module to the Internet.
1. While the Windows workbench is connected to the Hi3861 WLAN module, ensure that the serial port terminal is displayed properly.
2. Reset the Hi3861 WLAN module. The message **ready to OS start** is displayed on the **TERMINAL** panel, indicating that the WLAN module is started successfully.
**Figure 1** Successful resetting of the Hi3861 WLAN module
![quickstart-pkg-3861-running-restart](figures/quickstart-pkg-3861-running-restart.png)
3. Run the following AT commands in sequence to enable the STA mode, connect to the specified AP, and enable the DHCP function:
```
AT+STARTSTA # Start the STA mode.
AT+SCAN # Scan for available APs.
AT+SCANRESULT # Display the scanning result.
AT+CONN="SSID",,2,"PASSWORD" # Connect to the specified AP. (SSID and PASSWORD represent the name and password of the hotspot to be connected, respectively.)
AT+STASTAT # View the connection result.
AT+DHCP=wlan0,1 # Request the IP address of wlan0 from the AP using DHCP.
```
4. Check whether the Hi3861 WLAN module is properly connected to the gateway, as shown in the following figure.
```
AT+IFCFG # View the IP address assigned to an interface of the module.
AT+PING=X.X.X.X # Check the connectivity between the module and the gateway. Replace X.X.X.X with the actual gateway address.
```
**Figure 2** Successful networking of the Hi3861 WLAN module
![quickstart-pkg-3861-running-success](figures/quickstart-pkg-3861-running-success.png)
## Verification
When the burning and networking are complete, you can use either of the following methods to debug and verify whether the source code has been burnt correctly:
1. Using printf to print logs 1. Using printf to print logs
2. Using ASM files to locate panic issues 2. Using ASM files to locate panic issues
As the example used here is simple, we use the printf method. The following describes the two methods in detail. As the example used here is simple, we use the printf method. The following describes the two methods in detail.
## printf ### Using printf to Print Logs
Add the printf function to the code, which helps print data to the serial port. You can add log printing in key service paths or service exception locations, as shown in the following figure. Add the printf function to the code, which helps print data to the serial port. You can add log printing in key service paths or service exception locations, as shown in the following figure.
...@@ -25,9 +59,9 @@ void HelloWorld(void) ...@@ -25,9 +59,9 @@ void HelloWorld(void)
``` ```
## Using ASM Files to Locate Issues ### Using ASM Files to Locate Issues
When the system exits abnormally, the call stack information about the abnormal exit is displayed on the serial port. Analyze the displayed information to troubleshoot and pinpoint issues. If the system exits abnormally, the call stack information about the abnormal exit is displayed on the serial port. Analyze the displayed information to troubleshoot and pinpoint issues.
``` ```
=======KERNEL PANIC======= =======KERNEL PANIC=======
...@@ -46,7 +80,7 @@ To analyze the call stack information, the **Hi3861_wifiiot_app.asm** file is re ...@@ -46,7 +80,7 @@ To analyze the call stack information, the **Hi3861_wifiiot_app.asm** file is re
1. (Optional) Save the call stack information to a TXT file for editing. 1. (Optional) Save the call stack information to a TXT file for editing.
2. Open the asm file, search for the addresses in CallStack, and list the corresponding function names. Generally, you only need to find the functions matching the first several stacks to locate issues. 2. Open the ASM file, search for the function address in each call stack, and list the corresponding function. Generally, you only need to find the functions matching the first several stacks to locate issues.
``` ```
Call Stack 0 -- 4860d8 addr:f784c -- WadRecvCB Call Stack 0 -- 4860d8 addr:f784c -- WadRecvCB
...@@ -58,8 +92,29 @@ To analyze the call stack information, the **Hi3861_wifiiot_app.asm** file is re ...@@ -58,8 +92,29 @@ To analyze the call stack information, the **Hi3861_wifiiot_app.asm** file is re
Call Stack 6 -- 3f5e24 addr:f78fc Call Stack 6 -- 3f5e24 addr:f78fc
``` ```
3. Based on the call stack information, we can conclude that an exception occurs in the **WadRecvCB** function. 3. Based on the above call stack information, it can be determined that an exception occurs in the **WadRecvCB** function.
![en-us_image_0000001271354733](figures/en-us_image_0000001271354733.png) ![hi3861-test](figures/hi3861-test.png)
4. Check and modify the code. 4. Check and modify the code.
## Execution Result Examination
After the sample code is compiled, burnt, run, and debugged, restart the development board. If the following messages are displayed, the image is running correctly:
```
ready to OS start
FileSystem mount ok.
wifi init success!
[DEMO] Hello world.
```
Next
Congratulations! You have finished all steps! Proceed to develop samples to better familiarize yourself with OpenHarmony development:
- [LED Peripheral Control](guide/device-wlan-led-control.md)
- [Third-Party SDK Integration](guide/device-wlan-sdk.md)
# Setting Up the Hi3861 Development Board Environment # Installing Tools Specially Required by the Hi3861 Development Board
## Environment Requirements In addition to the general [libraries and tools](quickstart-pkg-install_package.md) and [compilation tools](quickstart-pkg-install_tool.md), the Hi3861 development board requires the tools listed in this topic for source code building.
### Hardware ## Required Tools
- Linux workstation **Table 1** Tools required by the Hi3861 WLAN module
- Hi3861 WLAN module | Tool| Function|
- USB Type-C cable used to connect the Linux workstation to Hi3861 development board
### Software
The following table lists the tools required by the Hi3861 WLAN module.
**Table 1 Tools required by the Hi3861 WLAN module
| Development Tool| Description|
| -------- | -------- | | -------- | -------- |
| SCons3.0.4+ | Executes script compilation.| | SCons3.0.4+ | Executes script compilation.|
| Python modules: setuptools, Kconfiglib, PyCryptodome, six, and ecdsa| Executes script compilation.| | Python modules: setuptools, Kconfiglib, PyCryptodome, six, and ecdsa| Executes script compilation.|
| gcc&nbsp;riscv32 | Executes script compilation.| | gcc riscv32 | Executes script compilation.|
## Installing the Compilation Tools ## Procedure
Perform the following steps to install the necessary tools: Perform the following steps in Ubuntu.
### Installing Scons ### Installing Scons
...@@ -41,7 +28,7 @@ Perform the following steps to install the necessary tools: ...@@ -41,7 +28,7 @@ Perform the following steps to install the necessary tools:
python3 -m pip install scons python3 -m pip install scons
``` ```
2. Run the following command to check whether SCons is successfully installed. If the installation is successful, the query result as shown in Figure 1 is displayed. 2. Run the following command to check whether SCons is successfully installed. If the installation is successful, the query result as shown below is displayed.
``` ```
scons -v scons -v
...@@ -49,7 +36,7 @@ Perform the following steps to install the necessary tools: ...@@ -49,7 +36,7 @@ Perform the following steps to install the necessary tools:
**Figure 1** Successful SCons installation (the version must be 3.0.4 or later) **Figure 1** Successful SCons installation (the version must be 3.0.4 or later)
![en-us_image_0000001271234749](figures/en-us_image_0000001271234749.png) ![hi3861-scons-install-success](figures/hi3861-scons-install-success.png)
### Installing Python Modules ### Installing Python Modules
...@@ -62,18 +49,14 @@ Perform the following steps to install the necessary tools: ...@@ -62,18 +49,14 @@ Perform the following steps to install the necessary tools:
2. Install the GUI menuconfig tool (Kconfiglib). You are advised to install Kconfiglib 13.2.0 or later. 2. Install the GUI menuconfig tool (Kconfiglib). You are advised to install Kconfiglib 13.2.0 or later.
- Command line: - **Command line:**
``` ```
sudo pip3 install kconfiglib sudo pip3 install kconfiglib
``` ```
- **Installation package:**
- Installation package:
1. Download the .whl file, for example, **kconfiglib-13.2.0-py2.py3-none-any.whl**. 1. Download the .whl file, for example, **kconfiglib-13.2.0-py2.py3-none-any.whl**.
Download path: [https://pypi.org/project/kconfiglib#files](https://pypi.org/project/kconfiglib#files) Download path: [https://pypi.org/project/kconfiglib#files](https://pypi.org/project/kconfiglib#files)
2. Install the .whl file. 2. Install the .whl file.
``` ```
...@@ -83,19 +66,15 @@ Perform the following steps to install the necessary tools: ...@@ -83,19 +66,15 @@ Perform the following steps to install the necessary tools:
3. Install PyCryptodome using either of the following methods: 3. Install PyCryptodome using either of the following methods:
Install the Python component packages on which the file signature depends, including **PyCryptodome**, **six**, and **ecdsa**. As the installation of **ecdsa** depends on that of **six**, install **six** first. Install the Python component packages on which the file signature depends, including **PyCryptodome**, **six**, and **ecdsa**. As the installation of **ecdsa** depends on that of **six**, install **six** first.
- **Command line:**
- Command line:
``` ```
sudo pip3 install pycryptodome sudo pip3 install pycryptodome
``` ```
- Installation package: - **Installation package:**
1. Download the .whl file, for example, **pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl**.
1. Download the .whl file , for example, **pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl**.
Download path: [https://pypi.org/project/pycryptodome/#files](https://pypi.org/project/pycryptodome/#files) Download path: [https://pypi.org/project/pycryptodome/#files](https://pypi.org/project/pycryptodome/#files)
2. Install the .whl file. 2. Install the .whl file.
``` ```
...@@ -103,19 +82,14 @@ Perform the following steps to install the necessary tools: ...@@ -103,19 +82,14 @@ Perform the following steps to install the necessary tools:
``` ```
4. Install **six** using either of the following methods: 4. Install **six** using either of the following methods:
- **Command line:**
- Command line:
``` ```
sudo pip3 install six --upgrade --ignore-installed six sudo pip3 install six --upgrade --ignore-installed six
``` ```
- **Installation package:**
- Installation package:
1. Download the .whl file, for example, **six-1.12.0-py2.py3-none-any.whl**. 1. Download the .whl file, for example, **six-1.12.0-py2.py3-none-any.whl**.
Download path: [https://pypi.org/project/six/#files](https://pypi.org/project/six/#files) Download path: [https://pypi.org/project/six/#files](https://pypi.org/project/six/#files)
2. Install the .whl file. 2. Install the .whl file.
``` ```
...@@ -123,19 +97,14 @@ Perform the following steps to install the necessary tools: ...@@ -123,19 +97,14 @@ Perform the following steps to install the necessary tools:
``` ```
5. Install **ecdsa** using either of the following methods: 5. Install **ecdsa** using either of the following methods:
- **Command line:**
- Command line:
``` ```
sudo pip3 install ecdsa sudo pip3 install ecdsa
``` ```
- **Installation package:**
- Installation package:
1. Download the .whl file, for example, **ecdsa-0.14.1-py2.py3-none-any.whl**. 1. Download the .whl file, for example, **ecdsa-0.14.1-py2.py3-none-any.whl**.
Download path: [https://pypi.org/project/ecdsa/#files](https://pypi.org/project/ecdsa/#files) Download path: [https://pypi.org/project/ecdsa/#files](https://pypi.org/project/ecdsa/#files)
2. Install the .whl file. 2. Install the .whl file.
``` ```
...@@ -143,14 +112,14 @@ Perform the following steps to install the necessary tools: ...@@ -143,14 +112,14 @@ Perform the following steps to install the necessary tools:
``` ```
### Installing gcc_riscv32 (Compilation Toolchain for the WLAN Module) ### Installing gcc_riscv32 (Compiler Toolchain for the WLAN Module)
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE** > ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
> - The Hi3861 platform supports only the static link of the libgcc library. The dynamic link is not recommended because version 3 of the GNU General Public License (GPLv3) will be polluted during commercial distribution. > - Hi3861 supports only the static link of the libgcc library. The dynamic link is not recommended because version 3 of the GNU General Public License (GPLv3) will be polluted during commercial distribution.
> >
> - Steps 2 to 14 of the following procedure are used to build the **gcc_riscv32** image. You can simply [download the image](https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz) and skip these steps. > - Steps 2 to 14 of the following procedure are used to build the **gcc_riscv32** image. You can directly [download the image](https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz) and skip these steps.
1. Start a Linux server. 1. Start the Linux server.
2. Download the **RISC-V GNU** toolchain. 2. Download the **RISC-V GNU** toolchain.
...@@ -184,7 +153,7 @@ Perform the following steps to install the necessary tools: ...@@ -184,7 +153,7 @@ Perform the following steps to install the necessary tools:
7. Add the RISC-V GCC 7.3.0 patch. 7. Add the RISC-V GCC 7.3.0 patch.
Visit the GCC official patch links [89411](https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=026216a753ef0a757a9e368a59fa667ea422cf09;hp=2a23a1c39fb33df0277abd4486a3da64ae5e62c2) and [86724](https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/graphite.h;h=be0a22b38942850d88feb159603bb846a8607539;hp=4e0e58c60ab83f1b8acf576e83330466775fac17;hb=b1761565882ed6a171136c2c89e597bc4dd5b6bf;hpb=fbd5f023a03f9f60c6ae36133703af5a711842a3), and manually add the changes to the .c and .h files based on the requirements in the patch links. Note that the number of rows may not match because of different versions of the patch and GCC. You need to search for the keyword in the patch to locate the corresponding row. Visit the GCC official patch links [89411](https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=026216a753ef0a757a9e368a59fa667ea422cf09;hp=2a23a1c39fb33df0277abd4486a3da64ae5e62c2) and [86724](https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/graphite.h;h=be0a22b38942850d88feb159603bb846a8607539;hp=4e0e58c60ab83f1b8acf576e83330466775fac17;hb=b1761565882ed6a171136c2c89e597bc4dd5b6bf;hpb=fbd5f023a03f9f60c6ae36133703af5a711842a3), and manually add the changes to the .c and .h files based on the requirements in the patch links. Note that the number of rows may not match because of the differences in the patch and GCC versions. If this is the case, search for the keyword in the patch to locate the corresponding row.
8. Download, decompress, and install [GMP 6.1.2](https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2). 8. Download, decompress, and install [GMP 6.1.2](https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2).
...@@ -192,7 +161,7 @@ Perform the following steps to install the necessary tools: ...@@ -192,7 +161,7 @@ Perform the following steps to install the necessary tools:
tar -xvf gmp-6.1.2.tar.bz2 && mkdir build_gmp && cd build_gmp && ../gmp-6.1.2/configure --prefix=/usr/local/gmp-6.1.2 --disable-shared --enable-cxx && make && make install tar -xvf gmp-6.1.2.tar.bz2 && mkdir build_gmp && cd build_gmp && ../gmp-6.1.2/configure --prefix=/usr/local/gmp-6.1.2 --disable-shared --enable-cxx && make && make install
``` ```
9. Download, decompress, and install [mpfr-4.0.2 ](https://www.mpfr.org/mpfr-4.0.2/mpfr-4.0.2.tar.gz). 9. Download, decompress, and install [mpfr-4.0.2](https://www.mpfr.org/mpfr-4.0.2/mpfr-4.0.2.tar.gz).
``` ```
tar -xvf mpfr-4.0.2.tar.gz && mkdir build_mpfr && cd build_mpfr && ../mpfr-4.0.2/configure --prefix=/usr/local/mpfr-4.0.2 --with-gmp=/usr/local/gmp-6.1.2 --disable-shared && make && make install tar -xvf mpfr-4.0.2.tar.gz && mkdir build_mpfr && cd build_mpfr && ../mpfr-4.0.2/configure --prefix=/usr/local/mpfr-4.0.2 --with-gmp=/usr/local/gmp-6.1.2 --disable-shared && make && make install
...@@ -210,7 +179,7 @@ Perform the following steps to install the necessary tools: ...@@ -210,7 +179,7 @@ Perform the following steps to install the necessary tools:
cd /opt && mkdir gcc_riscv32 cd /opt && mkdir gcc_riscv32
``` ```
12. Compile binutils. 12. Build Binutils.
``` ```
mkdir build_binutils && cd build_binutils && ../riscv-binutils-gdb/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" CFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" --bindir=/opt/gcc_riscv32/bin --libexecdir=/opt/gcc_riscv32/riscv32 --libdir=/opt/gcc_riscv32 --includedir=/opt/gcc_riscv32 && make -j16 && make install && cd .. mkdir build_binutils && cd build_binutils && ../riscv-binutils-gdb/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" CFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" --bindir=/opt/gcc_riscv32/bin --libexecdir=/opt/gcc_riscv32/riscv32 --libdir=/opt/gcc_riscv32 --includedir=/opt/gcc_riscv32 && make -j16 && make install && cd ..
...@@ -228,9 +197,9 @@ Perform the following steps to install the necessary tools: ...@@ -228,9 +197,9 @@ Perform the following steps to install the necessary tools:
mkdir build_gcc && cd build_gcc && ../riscv-gcc/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" LDFLAGS="-Wl,-z,relro,-z,now,-z,noexecstack" CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" CFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" --with-headers="/opt/gcc-riscv32/riscv32-unknown-elf/include" --with-mpc=/usr/local/mpc-1.1.0 --with-gmp=/usr/local/gmp-6.1.2 --with-mpfr=/usr/local/mpfr-4.0.2 && make -j16 && make install mkdir build_gcc && cd build_gcc && ../riscv-gcc/configure --prefix=/opt/gcc_riscv32 --target=riscv32-unknown-elf --with-arch=rv32imc --with-abi=ilp32 --disable-__cxa_atexit --disable-libgomp --disable-libmudflap --enable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-multilib --enable-poison-system-directories --enable-languages=c,c++ --with-gnu-as --with-gnu-ld --with-newlib --with-system-zlib CFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" CXXFLAGS="-fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wl,-z,relro,-z,now,-z,noexecstack -fPIE" LDFLAGS="-Wl,-z,relro,-z,now,-z,noexecstack" CXXFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" CFLAGS_FOR_TARGET="-Os -mcmodel=medlow -Wall -fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -Wtrampolines -fno-short-enums -fno-short-wchar" --with-headers="/opt/gcc-riscv32/riscv32-unknown-elf/include" --with-mpc=/usr/local/mpc-1.1.0 --with-gmp=/usr/local/gmp-6.1.2 --with-mpfr=/usr/local/mpfr-4.0.2 && make -j16 && make install
``` ```
15. Set the environment variable. 15. Set an environment variable.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If you are using the riscv32 gcc package, run the following command to decompress the package to the root directory: > If you are using the riscv32 gcc package, run the following command to decompress the package to the root directory:
> >
> ``` > ```
...@@ -238,7 +207,7 @@ Perform the following steps to install the necessary tools: ...@@ -238,7 +207,7 @@ Perform the following steps to install the necessary tools:
> ``` > ```
``` ```
vim ~/.bashrc vim ~/.bashrc
``` ```
......
# Reference # Building Source Code Using the build.sh Script
## Using the build.sh Script to Build Source Code
1. Go to the root directory of the source code and run the build command. 1. Go to the root directory of the source code and run the build command.
``` ```
...@@ -11,9 +9,9 @@ ...@@ -11,9 +9,9 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> >
> *name* indicates the product name, for example, **Hi3516DV300** and **rk3568**. > In the preceding command, *name* indicates the product name, for example, **Hi3516DV300** and **rk3568**.
2. Check the build result. After the build is complete, the following information is displayed in the log: 2. Check the build result. If the build is successful, the following information is displayed in the log:
``` ```
post_process post_process
...@@ -24,47 +22,3 @@ ...@@ -24,47 +22,3 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> >
> For details about other modular compilation operations, see [Compilation and Building Guide](../subsystems/subsys-build-all.md). > For details about other modular compilation operations, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
## Configuring the Proxy
### Setting Up the Python Proxy
1. Create a proxy configuration file.
```
mkdir ~/.pipvim ~/.pip/pip.conf
```
2. Add the following proxy information to the file, save the file, and exit:
```
[global]
index-url = http:// Proxy URL
trusted-host = Trusted image path
timeout = 120
```
### Setting Up the npm Proxy
1. Create a proxy configuration file.
```
vim ~/.npmrc
```
2. Add the following proxy information to the file, save the file, and exit:
```
Registry=http:// Proxy URL
strict-ssl=false
```
3. Add the following content to the **.bashrc** file, save the file, and exit:
```
export NPM_REGISTRY=http:// Proxy URL
source .bashrc
```
# Fixing Compilation Issues # Fixing Compilation and Building Errors
## What should I do if the message "ImportError: No module named apt_pkg" is displayed during the execution of an unidentifiable command? ## "ImportError: No module named apt_pkg" is displayed during the execution of an unidentifiable command
- **Symptom** - **Symptom**
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
``` ```
## What should I do if the message indicating Python cannot be found is displayed during compilation and building? ## The message indicating Python cannot be found is displayed during the build process
- **Symptom** - **Symptom**
The following error occurs during compilation and building: The following information is displayed during the build process:
``` ```
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
- **Possible Cause 2** - **Possible Cause 2**
The soft link that points to the Python does not exist in the **usr/bin** directory. The soft link to Python does not exist in the **usr/bin** directory.
![en-us_image_0000001271354745](figures/en-us_image_0000001271354745.png) ![faq-python-error](figures/faq-python-error.png)
- **Solution** - **Solution**
Run the following commands to add a soft link: Run the following commands to add the soft link to Python:
``` ```
...@@ -66,14 +66,14 @@ ...@@ -66,14 +66,14 @@
Example: Example:
![en-us_image_0000001227114636](figures/en-us_image_0000001227114636.png) ![faq-python-add-soft-link](figures/faq-python-add-soft-link.png)
## What should I do if the message indicating Python 3 cannot be found is displayed during compilation and building? ## The message indicating Python 3 cannot be found is displayed during the build process
- **Symptom** - **Symptom**
![en-us_image_0000001227114640](figures/en-us_image_0000001227114640.png) ![faq-python3-not-found](figures/faq-python3-not-found.png)
- **Possible Causes** - **Possible Causes**
...@@ -89,11 +89,11 @@ ...@@ -89,11 +89,11 @@
``` ```
## What should I do if the message "configure: error: no acceptable C compiler found in $PATH" is displayed during Python 3 installation? ## "configure: error: no acceptable C compiler found in $PATH" is displayed during Python 3 installation
- **Symptom** - **Symptom**
The following error occurs during Python 3 installation: The following information is displayed during the Python 3 installation process:
``` ```
...@@ -102,19 +102,18 @@ ...@@ -102,19 +102,18 @@
- **Possible Causes** - **Possible Causes**
**gcc** is not installed. GCC is not installed.
- **Solution** - **Solution**
1. Run the **apt-get install gcc** command to install **gcc** online. 1. Run the **apt-get install gcc** command to install **gcc** online.
2. After the installation, reinstall Python 3. 2. Install Python 3.
## What should I do if the message "-bash: make: command not found is displayed" during Python 3 installation? ## "-bash: make: command not found" is displayed during Python 3 installation
- **Symptom** - **Symptom**
The following error occurs during Python 3 installation: The following information is displayed during the Python 3 installation process:
``` ```
...@@ -123,19 +122,18 @@ ...@@ -123,19 +122,18 @@
- **Possible Causes** - **Possible Causes**
Make is not installed. make is not installed.
- **Solution** - **Solution**
1. Run the **apt-get install make** command to install make online.
1. Run the **apt-get install make** command to install Make online. 2. Install Python 3.
2. After the installation, reinstall Python 3.
## What should I do if the message "No module named '_ctypes'" is displayed during Python 3 installation? ## "No module named '_ctypes'" is displayed during Python 3 installation
- **Symptom** - **Symptom**
The following error occurs during Python 3 installation: The following information is displayed during the Python 3 installation process:
``` ```
...@@ -144,19 +142,18 @@ ...@@ -144,19 +142,18 @@
- **Possible Causes** - **Possible Causes**
**libffi** and **libffi-devel** are not installed. libffi and libffi-devel are not installed.
- **Solution** - **Solution**
1. Run the **apt-get install libffi* -y** command to install libffi and libffi-devel online.
2. Install Python 3.
1. Run the **apt-get install libffi* -y** command to install **libffi** and **libffi-devel** online.
2. After the installation, reinstall Python 3.
## "No module named 'Crypto'" is displayed during the build process
## What should I do if the message "No module named 'Crypto'" is displayed during the build process?
- **Symptom** - **Symptom**
The following error occurs during compilation and building: The following information is displayed during the build process:
``` ```
...@@ -168,25 +165,24 @@ ...@@ -168,25 +165,24 @@
**Crypto** is not installed. **Crypto** is not installed.
- **Solution** - **Solution**
Method 1: Run the **pip3 install Crypto** command to install **Crypto** online.
Solution 1: Run the **pip3 install Crypto** command to install **Crypto** online. Method 2: Install **Crypto** offline.
Method 2: Offline installation
Download the source code from [PyPI](https://pypi.org/project/pycrypto/#files). Download the source code from [PyPI](https://pypi.org/project/pycrypto/#files).
![en-us_image_0000001226794696](figures/en-us_image_0000001226794696.png) ![faq-download-pycrypto](figures/faq-download-pycrypto.png)
Save the source package to the Linux server, decompress the package, and run the **python3 setup.py install** command to install Crypto. Save the source package to the Linux server, decompress the package, and run the **python3 setup.py install** command to install **Crypto**.
After the preceding installation is complete, rebuild an environment. Start the build again.
## What should I do if the message "No module named 'ecdsa'" is displayed during the build process? (Hi3861) ## (Hi3861) "No module named 'ecdsa'" is displayed during the build process
- **Symptom** - **Symptom**
The following error occurs during compilation and building: The following information is displayed during the build process:
``` ```
...@@ -198,25 +194,24 @@ ...@@ -198,25 +194,24 @@
**ecdsa** is not installed. **ecdsa** is not installed.
- **Solution** - **Solution**
Method 1: Run the **pip3 install ecdsa** command to install **ecdsa** online.
Solution 1: Run the **pip3 install ecdsa** command to install **ecdsa** online.
Method 2: Offline installation Method 2: Offline installation
Download the installation package from [PyPI](https://pypi.org/project/ecdsa/#files). Download the installation package from [PyPI](https://pypi.org/project/ecdsa/#files).
![en-us_image_0000001271594753](figures/en-us_image_0000001271594753.png) ![faq-download-ecdsa](figures/faq-download-ecdsa.png)
Save the installation package to the Linux server and run the **pip3 install ecdsa-0.15-py2.py3-none-any.whl** command to install ecdsa. Save the installation package to the Linux server and run the **pip3 install ecdsa-0.15-py2.py3-none-any.whl** command to install ecdsa.
After the preceding installation is complete, rebuild an environment. Start the build again.
## What should I do if the message "Could not find a version that satisfies the requirement six>=1.9.0" is displayed during the build process? (Hi3861) ## (Hi3861)" Could not find a version that satisfies the requirement six>=1.9.0" is displayed during the build process
- **Symptom** - **Symptom**
The following error occurs during compilation and building: The following information is displayed during the build process:
``` ```
...@@ -228,25 +223,24 @@ ...@@ -228,25 +223,24 @@
**six** is not installed. **six** is not installed.
- **Solution** - **Solution**
Method 1: Run the **pip3 install six** command to install **six** online.
Solution 1: Run the **pip3 install six** command to install **six** online. Method 2: Install **six** offline.
Method 2: Offline installation
Download the installation package from [PyPI](https://pypi.org/project/six/#files). Download the installation package from [PyPI](https://pypi.org/project/six/#files).
![en-us_image_0000001271474573](figures/en-us_image_0000001271474573.png) ![faq-download-six](figures/faq-download-six.png)
Save the source code to the Linux server and run the **pip3 install six-1.14.0-py2.py3-none-any.whl** command to install **six**. Save the source code to the Linux server and run the **pip3 install six-1.14.0-py2.py3-none-any.whl** command to install **six**.
After the preceding installation is complete, rebuild an environment. Start the build again.
## What should I do if the message "cannot find -lgcc" is displayed during the build process? (Hi3861) ## (Hi3861) "cannot find -lgcc" is displayed during the build process
- **Symptom** - **Symptom**
The following error occurs during compilation and building: The following information is displayed during the build process:
``` ```
...@@ -255,7 +249,7 @@ ...@@ -255,7 +249,7 @@
- **Possible Causes** - **Possible Causes**
The PATH is incorrectly written by **gcc_riscv32**. There is an extra slash (/). The gcc_riscv32 path is incorrectly set as follows. There is an extra slash (/) after **bin**.
``` ```
...@@ -264,7 +258,7 @@ ...@@ -264,7 +258,7 @@
- **Solution** - **Solution**
Modify the PATH by deleting the slash (/). Modify the gcc_riscv32 path as follows:
``` ```
...@@ -272,11 +266,11 @@ ...@@ -272,11 +266,11 @@
``` ```
## What should I do if an lsb_release error occurs during kconfiglib installation? (Hi3861) ## (Hi3861) An lsb_release error occurs during kconfiglib installation
- **Symptom** - **Symptom**
The following error occurs during **kconfiglib** installation: The following information is displayed during the **kconfiglib** installation process:
``` ```
......
# Fixing Burning Issues # Fixing Image Burning Errors
## What should I do if Error: Opening COMxx: Access denied is displayed when I start burning ## "Error: Opening COMxx: Access denied" is displayed when I start image burning
- **Symptom** - **Symptom**
Error: Opening COMxx: Access denied is displayed after clicking Burn and selecting a serial port. "Error: Opening COMxx: Access denied" is displayed after a serial port is selected to start image burning.
**Figure 1** Failed to open the serial port **Figure 1** Failed to open the serial port
![en-us_image_0000001226634728](figures/en-us_image_0000001226634728.png) ![hi3516-faq-serial-access-denied](figures/hi3516-faq-serial-access-denied.png)
- **Possible Causes** - **Possible Causes**
...@@ -21,34 +21,34 @@ ...@@ -21,34 +21,34 @@
**Figure 2** Checking whether the serial port is in use **Figure 2** Checking whether the serial port is in use
![en-us_image_0000001226954644](figures/en-us_image_0000001226954644.png) ![hi3516-faq-serial-check](figures/hi3516-faq-serial-check.png)
2. Click the dustbin icon as shown below to disable the terminal using the serial port. 2. Click the dustbin icon as shown below to disable the terminal using the serial port.
**Figure 3** Disabling the terminal using the serial port **Figure 3** Disabling the terminal using the serial port
![en-us_image_0000001271234761](figures/en-us_image_0000001271234761.png) ![hi3516-faq-serial-close-terminal](figures/hi3516-faq-serial-close-terminal.png)
3. Click **Burn**, select the serial port, and start burning images again. 3. Click **Burn**, select the serial port, and start burning images again.
**Figure 4** Restarting the burning task **Figure 4** Restarting the burning task
![en-us_image_0000001271594765](figures/en-us_image_0000001271594765.png) ![hi3516-faq-serial-reburn](figures/hi3516-faq-serial-reburn.png)
## What should I do when Windows-based PC failed to be connected to the board? ## The development board failed to connect to the PC
- **Symptom** - **Symptom**
The file image cannot be obtained after clicking Burn and selecting a serial port. The file image cannot be obtained after a serial port is selected to start image burning.
**Figure 5** Failed to obtain the file image due to network disconnection **Figure 5** Failed to obtain the file image due to network disconnection
![en-us_image_0000001271234757](figures/en-us_image_0000001271234757.png) ![hi3516-faq-network-fail](figures/hi3516-faq-network-fail.png)
- **Possible Causes** - **Possible Causes**
The board is disconnected from the Windows-based PC. The development board is disconnected from the PC.
Windows Firewall does not allow Visual Studio Code to access the network. Windows Firewall does not allow Visual Studio Code to access the network.
...@@ -60,47 +60,32 @@ ...@@ -60,47 +60,32 @@
**Figure 6** Network and firewall settings **Figure 6** Network and firewall settings
![en-us_image_0000001226634732](figures/en-us_image_0000001226634732.png) ![hi3516-faq-firewall-setting](figures/hi3516-faq-firewall-setting.png)
3. Click **Firewall & network protection**, and on the displayed page, click **Allow an app through the firewall**. 3. Click **Firewall & network protection**, and on the displayed page, click **Allow applications to communicate through Windows Firewall**.
**Figure 7** Firewall & network protection **Figure 7** Firewall and network protection
![en-us_image_0000001271354749](figures/en-us_image_0000001271354749.png) ![hi3516-faq-firewall-setting-allow](figures/hi3516-faq-firewall-setting-allow.png)
4. Select Visual Studio Code. 4. Select Visual Studio Code.
**Figure 8** Selecting Visual Studio Code **Figure 8** Selecting Visual Studio Code
![en-us_image_0000001271234765](figures/en-us_image_0000001271234765.png) ![hi3516-faq-firewall-find-vscode](figures/hi3516-faq-firewall-find-vscode.png)
5. Select the **Private** and **Public** network access rights for Visual Studio Code. 5. Select the **Private** and **Public** network access rights for Visual Studio Code.
**Figure 9** Allowing Visual Studio Code to access the network **Figure 9** Allowing Visual Studio Code to access the network
![en-us_image_0000001271474585](figures/en-us_image_0000001271474585.png) ![hi3516-faq-firewall-vscode-allow-network](figures/hi3516-faq-firewall-vscode-allow-network.png)
## What should I do when the image failed to be burnt? ## (Hi3516) No information is displayed through the serial port
- **Symptom** - **Symptom**
The burning status is not displayed after clicking Burn and selecting a serial port. The serial port shows that the connection has been established. However, no information is displayed through the serial port after the board is restarted and **Enter** is pressed.
- **Possible Causes**
The IDE is not restarted after the DevEco plug-in is installed.
- **Solution**
Restart the IDE.
## What should I do if no information is displayed through the serial port? (Hi3516)
- **Symptom**
The serial port shows that the connection has been established. After the board is restarted, nothing is displayed when you press **Enter**.
- **Possible Cause 1** - **Possible Cause 1**
...@@ -110,7 +95,7 @@ ...@@ -110,7 +95,7 @@
Change the serial port number. Change the serial port number.
Open Device Manager to check whether the serial port connected to the board is the same as the serial port connected to the terminal. If they are different, change the serial port number by following the instructions provided in " Error: Opening COMxx: Access denied". Start **Device Manager** to check whether the serial port connected to the board is the same as that connected to the terminal device. If the serial ports are different, correct the serial port number by following instructions in ["Error: Opening COMxx: Access denied" is displayed when I start image burning](#error-opening-comxx-access-denied-is-displayed-when-i-start-image-burning).
- **Possible Cause 2** - **Possible Cause 2**
...@@ -123,20 +108,16 @@ ...@@ -123,20 +108,16 @@
If the fault persists after you perform the preceding operations, the U-Boot of the board may be damaged. You can burn the U-Boot by performing the following steps: If the fault persists after you perform the preceding operations, the U-Boot of the board may be damaged. You can burn the U-Boot by performing the following steps:
1. Obtain the U-Boot file. 1. Obtain the U-Boot file.
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE** > ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
> The U-Boot file of the two boards can be obtained from the following paths, respectively.
>
> Hi3516D V300: device\hisilicon\hispark_taurus\sdk_liteos\uboot\out\boot\u-boot-hi3516dv300.bin
> >
> Hi3518E V300: device\hisilicon\hispark_aries\sdk_liteos\uboot\out\boot\u-boot-hi3518ev300.bin > You can download the U-Boot file from the [open-source package](device\hisilicon\hispark_taurus\sdk_liteos\uboot\out\boot\u-boot-hi3516dv300.bin).
2. Burn the U-Boot file by following the procedures for burning a U-Boot file over USB. 2. Burn the U-Boot file.
Select the U-Boot files of corresponding development boards for burning by referring to [Burning to Hi3516D V300](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3516-upload-0000001052148681)/[Burning to Hi3518E V300](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3518-upload-0000001057313128#section93591711580). Follow the instructions in [Burning Through the USB Port](https://device.harmonyos.com/en/docs/documentation/guide/upload_hi3516_small_system-0000001326267405).
3. Log in to the serial port after the burning is complete. 3. Log in to the serial port after the burning is complete.
**Figure 10** Information displayed through the serial port after the U-Boot file is burnt **Figure 10** Information displayed through the serial port after the U-Boot is burnt
![en-us_image_0000001271234753](figures/en-us_image_0000001271234753.png) ![hi3516-faq-burn-uboot-success](figures/hi3516-faq-burn-uboot-success.png)
# Fixing hb Installation Issues # Fixing hb Installation Errors
## What should I do if garbled characters and segmentation faults occur during hb installation? ## Garbled characters and segmentation faults occur during hb installation
- **Symptom** - **Symptom**
Garbled characters and segmentation faults occur during the execution of the **python3 -m pip install --user ohos-build** command.
During the execution of **python3 -m pip install --user ohos-build**, garbled characters and segmentation faults occur..
- **Possible Causes** - **Possible Causes**
pip is of an early version.
The pip version does not meet requirements.
- **Solution** - **Solution**
Upgrade pip.
Run the following command to upgrade pip:
``` ```
...@@ -18,16 +21,19 @@ ...@@ -18,16 +21,19 @@
``` ```
## What should I do if the message "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation? ## "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation
- **Symptom** - **Symptom**
The message "cannot import 'sysconfig' from 'distutils'" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
During the execution of **python3 -m pip install --user ohos-build**, the following information is displayed:<br>cannot import 'sysconfig' from 'distutils'
- **Possible Causes** - **Possible Causes**
The **distutils** module is unavailable. The **distutils** module is unavailable.
- **Solution** - **Solution**
Install distutils.
Run the following command to install **distutils**:
``` ```
...@@ -35,15 +41,18 @@ ...@@ -35,15 +41,18 @@
``` ```
## What should I do if the message "module 'platform' has no attribute 'linux_distribution'" is displayed during hb installation? ## "module 'platform' has no attribute 'linux_distribution'" is displayed during hb installation
- **Symptom** - **Symptom**
The message "module 'platform' has no attribute 'linux_distribution'" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
During the execution of **python3 -m pip install --user ohos-build**, the following information is displayed:<br>module 'platform' has no attribute 'linux_distribution'
- **Possible Causes** - **Possible Causes**
There is a compatibility issue of python3-pip. There is a compatibility issue of python3-pip.
- **Solution** - **Solution**
Reinstall pip. Reinstall pip.
...@@ -54,17 +63,19 @@ ...@@ -54,17 +63,19 @@
``` ```
## What should I do if the message "Could not find a version that satisfies the requirement ohos-build" is displayed during hb installation? ## "Could not find a version that satisfies the requirement ohos-build" is displayed during hb installation
- **Symptom** - **Symptom**
The message "Could not find a version that satisfies the requirement ohos-build" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
During the execution of **python3 -m pip install --user ohos-build**, the following information is displayed:<br>Could not find a version that satisfies the requirement ohos-build
- **Possible Causes** - **Possible Causes**
The installation fails due to poor network connectivity. The installation fails due to poor network connectivity.
- **Solution** - **Solution**
1. Ensure that your computer has a good network connection. If the network connection is unstable, rectify the network fault and reinstall hb. 1. Ensure that your computer has a good network connection. If the network connection is unstable, rectify the network fault and reinstall hb.
2. If the network is functional, run the following commands to install hb by specifying a temporary PyPI source: 2. If the network is functional, run the following command to install hb by specifying a temporary PyPI source:
``` ```
python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ohos-build python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ohos-build
......
# Reference # Configuring the Proxy
## Using the build.sh Script to Build Source Code ### Configuring the Python Proxy
1. Go to the root directory of the source code and run the build command.
```
./build.sh --product-name name --ccache
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> *name* indicates the product name, for example, **Hi3516DV300** and **rk3568**.
2. Check the build result. After the build is complete, the following information is displayed in the log:
```
post_process
=====build name successful.
```
Files generated during the build are stored in the **out/{*device_name*}/** directory, and the generated image is stored in the **out/{*device_name*}/packages/phone/images/** directory.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> For details about other modular compilation operations, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
## Configuring the Proxy
### Setting Up the Python Proxy
1. Create a proxy configuration file. 1. Create a proxy configuration file.
...@@ -41,13 +13,13 @@ ...@@ -41,13 +13,13 @@
``` ```
[global] [global]
index-url = http:// Proxy URL index-url = http://Proxy URL
trusted-host = Trusted image path trusted-host = Trusted image path
timeout = 120 timeout = 120
``` ```
### Setting Up the npm Proxy ### Configuring the npm Proxy
1. Create a proxy configuration file. 1. Create a proxy configuration file.
...@@ -58,13 +30,13 @@ ...@@ -58,13 +30,13 @@
2. Add the following proxy information to the file, save the file, and exit: 2. Add the following proxy information to the file, save the file, and exit:
``` ```
Registry=http:// Proxy URL Registry=http://Proxy URL
strict-ssl=false strict-ssl=false
``` ```
3. Add the following content to the **.bashrc** file, save the file, and exit: 3. Add the following content to the **.bashrc** file, save the file, and exit:
``` ```
export NPM_REGISTRY=http:// Proxy URL export NPM_REGISTRY=http://Proxy URL
source .bashrc source .bashrc
``` ```
# Installing Libraries and Tools
Before using the CLI for device development, perform the following steps on Ubuntu to install the required libraries and tools.
On Ubuntu:
1. Run the following **apt-get** command:
```
sudo apt-get update && sudo apt-get install binutils binutils-dev git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib gcc-arm-linux-gnueabi libc6-dev-i386 libc6-dev-amd64 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 genext2fs device-tree-compiler make libffi-dev e2fsprogs pkg-config perl openssl libssl-dev libelf-dev libdwarf-dev u-boot-tools mtd-utils cpio doxygen liblz4-tool openjdk-8-jre gcc g++ texinfo dosfstools mtools default-jre default-jdk libncurses5 apt-utils wget scons python3.8-distutils tar rsync git-core libxml2-dev lib32z-dev grsync xxd libglib2.0-dev libpixman-1-dev kmod jfsutils reiserfsprogs xfsprogs squashfs-tools pcmciautils quota ppp libtinfo-dev libtinfo5 libncurses5-dev libncursesw5 libstdc++6 gcc-arm-none-eabi vim ssh locales libxinerama-dev libxcursor-dev libxrandr-dev libxi-dev
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> The preceding command is applicable to Ubuntu 18.04. For other Ubuntu versions, modify the preceding installation command based on the installation package name. The details are as follows:
>
> - Python 3.8 or a later version is required. This section uses Python 3.8 as an example.
>
> - Java 8 or later is required. This section uses Java 8 as an example.
2. Set Python 3.8 as the default Python version.
Check the location of Python 3.8.
```
which python3.8
```
Switch Python and Python3 to Python 3.8.
```
sudo update-alternatives --install /usr/bin/python python {Python 3.8 path} 1 #{Python 3.8 path} is the location of Python 3.8 obtained in the previous step.
sudo update-alternatives --install /usr/bin/python3 python3 {Python 3.8 path} 1 #{Python 3.8 path} is the location of Python 3.8 obtained in the previous step.
```
# Installing the Compilation Tools
For details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
Perform the following steps on Ubuntu.
## hb Installation
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> For details about how to install the proxy, see [Configuring the Proxy](quickstart-pkg-common-proxy.md).
1. Run the following command to install hb and update it to the latest version:
```
pip3 install --user build/lite
```
2. Set an environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
export PATH=~/.local/bin:$PATH
```
Update the environment variable.
```
source ~/.bashrc
```
3. Run the **hb -h** command in the source code directory. If the following information is displayed, the installation is successful:
```
usage: hb
OHOS build system
positional arguments:
{build,set,env,clean}
build Build source code
set OHOS build settings
env Show OHOS build env
clean Clean output
optional arguments:
-h, --help show this help message and exit
```
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
> - To uninstall hb, run the following command:
>
> ```
> pip3 uninstall ohos-build
> ```
>
> - If any issue occurs during the hb installation, see [FAQs](quickstart-pkg-common-hberr.md).
## Installing LLVM (Only Required for OpenHarmony_v1.x)
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
>
> When downloading source code under the OpenHarmony_v1.x branches or tags, perform the procedure described in this section to install LLVM 9.0.0.
>
> When downloading source code under the Master or non-OpenHarmony_v1.x branches or tags, skip this section. hb will automatically download the latest version of LLVM.
1. Start the Linux server.
2. [Download LLVM](https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar).
3. Decompress the LLVM installation package to **~/llvm**.
```
tar -zxvf llvm.tar -C ~/
```
4. Set an environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
export PATH=~/llvm/bin:$PATH
```
5. Validate the environment variable.
```
source ~/.bashrc
```
# Setting Up the Development Environment
In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, because the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu build environment. Therefore, for these development boards, you need Ubuntu to build source code and Windows to burn images.
Set up the Windows and Ubuntu development environments that meet the [Windows Requirements](#windows-requirements) and [Ubuntu Requirements](#ubuntu-requirements), respectively. Then enable Windows to remotely access Ubuntu. No specific requirements are placed on the development devices.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> OpenHarmony also provides the [Docker environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the command line.
## Windows Requirements
64-bit Windows 10
## Ubuntu Requirements
- OS: Ubuntu 18.04 or later. The recommended memory is 16 GB or higher.
- User name: cannot contain Chinese characters
## Preparing for Remote Access
When burning images in Windows, you need to remotely access the source code and image files in Ubuntu. To achieve this, use a file transfer or sharing tool.
In this example the Samba server is used.
### Configuring the Samba Server
Perform the following operations in Ubuntu:
1. Install the Samba software package.
```
sudo apt-get install samba samba-common
```
2. Configure the sharing information in the Samba configuration file.
Open the **smb.conf** file.
```
sudo gedit /etc/samba/smb.conf
```
Append the following information to the configuration file:
```
[Share] # Name of the root folder mapped in Windows (Share is used as an example)
comment = Shared Folder # Information about the sharing
path = /home/share # Shared directory
valid users = username # User who can access the shared directory (user name in Ubuntu)
directory mask = 0775 # Default directory permissions
create mask = 0775 # Default file permissions
public = yes # Whether to enable public access
writable = yes # Whether to enable write access
available = yes # Whether the directory is available
browseable = yes # Whether the directory is browseable
```
3. Add the user name and password for accessing the Samba server.
```
sudo smbpasswd -a username # Enter the Ubuntu user name. Then set the password as prompted.
```
4. Run the following command to restart the Samba service:
```
sudo service smbd restart
```
### Mapping a Network Drive in Windows
Perform the following operations in Windows:
1. Right-click **This PC** and choose **Map network drive** from the shortcut menu. In the **Drive** list, select a drive letter. In the **Folder** field, enter the path in the format of *\\Ubuntu device IP address\Ubuntu shared folder*.
![quickstart-pkg-prepare-networkdriver](figures/quickstart-pkg-prepare-networkdriver.png)
2. Enter the user name and password for accessing the Samba server, which has been set up in [Configuring the Samba Server](#configuring-the-samba-server).
![quickstart-pkg-prepare-setsamba](figures/quickstart-pkg-prepare-setsamba.png)
3. The shared directory is displayed in Windows and available for access.
...@@ -10,7 +10,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ...@@ -10,7 +10,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
2. Register an SSH public key for access to Gitee. 2. Register an SSH public key for access to Gitee.
3. Install the git client and git-lfs if they are unavailable. 3. (Skip this step if the tools have been installed.) Install the git client and git-lfs.
Update the software source: Update the software source:
...@@ -42,6 +42,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ...@@ -42,6 +42,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
chmod a+x ~/bin/repo chmod a+x ~/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
``` ```
6. Add the path of the **repo** tool to environment variables. 6. Add the path of the **repo** tool to environment variables.
``` ```
...@@ -50,14 +51,21 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ...@@ -50,14 +51,21 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
source ~/.bashrc # Apply environment variables. source ~/.bashrc # Apply environment variables.
``` ```
## Procedure
## How to Obtain
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities. >
> Download the release code, which is more stable, if you want to develop commercial functionalities. Download the master code if you want to get quick access to the latest features for your development.
- **Obtaining OpenHarmony release code**
For details about how to obtain the source code of an OpenHarmony release, see [OpenHarmony Release Notes](../../release-notes/Readme.md).
- **Obtaining OpenHarmony master code** - **Obtaining OpenHarmony master code**
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\) Method 1 (recommended): Use the **repo** tool to download the source code over SSH. (You must have registered an SSH public key for access to Gitee.)
``` ```
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
...@@ -74,12 +82,8 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ...@@ -74,12 +82,8 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
repo forall -c 'git lfs pull' repo forall -c 'git lfs pull'
``` ```
- **Obtaining OpenHarmony release code**
For details about how to obtain the source code of an OpenHarmony release, see the [Release-Notes](../../release-notes/Readme.md).
### Running prebuilts ## Running prebuilts
Go to the root directory of the source code and run the following script to install the compiler and binary tool: Go to the root directory of the source code and run the following script to install the compiler and binary tool:
......
# Introduction to the Hi3516 Development Board
## Overview
Hi3516D V300 is a next-generation system on chip (SoC) designed for industry-dedicated smart HD IP cameras. It introduces a next-generation image signal processor (ISP), the H.265 video compression encoder, and a high-performance NNIE engine, leading the industry in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption.
**Figure 1** Hi3516 front view
![en-us_image_0000001226922318](figures/en-us_image_0000001226922318.png)
## Development Board Specifications
**Table 1** Hi3516 specifications
| Item| Description|
| -------- | -------- |
| Processor and internal memory| -&nbsp;Hi3516D V300 chip<br>-&nbsp;DDR3&nbsp;1 GB<br>-&nbsp;eMMC 4.5, 8 GB capacity|
| External components| -&nbsp;Ethernet port<br>-&nbsp;Audio and video<br>&nbsp;&nbsp;-&nbsp;1 voice input<br>&nbsp;&nbsp;-&nbsp;1 mono channel (AC_L) output, connected to a 3 W power amplifier (LM4871)<br>&nbsp;&nbsp;-&nbsp;MicroHDMI (1-channel HDMI 1.4)<br>-&nbsp;Camera<br>&nbsp;&nbsp;-&nbsp;Sensor IMX335<br>&nbsp;&nbsp;-&nbsp;M12 lens, 4 mm focal length, and 1.8 aperture<br>-&nbsp;Display<br>&nbsp;&nbsp;-&nbsp;LCD connector (2.35-inch)<br>&nbsp;&nbsp;-&nbsp;LCD connector (5.5-inch)<br>-&nbsp;External components and ports<br>&nbsp;&nbsp;-&nbsp;Memory card port<br>&nbsp;&nbsp;-&nbsp;JTAG/I2S port<br>&nbsp;&nbsp;-&nbsp;ADC port<br>&nbsp;&nbsp;-&nbsp;Steering gear port<br>&nbsp;&nbsp;-&nbsp;Grove connector<br>&nbsp;&nbsp;-&nbsp;USB 2.0 (Type-C)<br>&nbsp;&nbsp;-&nbsp;Three function keys, two user-defined keys, and one upgrade key<br>&nbsp;&nbsp;-&nbsp;LED indicator, green or red|
# Introduction to the RK3568 Development Board
## Overview
Bolstered by the Rockchip RK3568 chip, the RK3568 development board integrates a dual-core GPU and high-efficiency NPU. Its quad-core 64-bit Cortex-A55 processor uses the advanced 22 nm manufacturing process and is clocked at up to 2.0 GHz. The development board is packed with Bluetooth, Wi-Fi, audio, video, and camera features, with a wide range of expansion ports as well as video input and output ports. It comes with dual GE auto-sensing RJ45 ports, so it can be used in multi-connectivity products, such as NVRs and industrial gateways.
**Figure 1** Front view of the RK3568 development board
![en-us_image_0000001271442261](figures/en-us_image_0000001271442261.png)
**Figure 2** RK3568 rear view
![en-us_image_0000001226602394](figures/en-us_image_0000001226602394.png)
## Development Board Specifications
**Table 1** RK3568 specifications
| Item| Description|
| -------- | -------- |
| Display| -&nbsp;1 x HDMI 2.0 (Type-A) port, supporting 4K/60 fps output<br>-&nbsp;2 x MIPI, supporting 1920 x 1080\@60 fps output<br>-&nbsp; 1 x eDP, supporting 2K@60 fps output|
| Audio port| -&nbsp;1 x 8ch I2S/TDM/PDM<br>-&nbsp;1 x HDMI<br>-&nbsp;1 x speaker output<br>-&nbsp;1 x headset output<br>-&nbsp;1 x microphone for onboard audio input|
| Ethernet port| 2 x GMAC (10/100/1000M)|
| Wireless connectivity| SDIO port, supporting Wi-Fi 6 5G/2.5 GHz and Bluetooth 4.2|
| Camera port| MIPI-CSI2, 1 x 4-lane/2x2-lane\@2.5 Gbps/lane|
| USB port| -&nbsp;2 x USB 2.0 Host, Type-A<br>-&nbsp;1 x USB 3.0 Host, Type-A<br>-&nbsp;1 x USB3.0 OTG|
| PCIe | 1 x 2-lane PCIe 3.0 Connector (RC mode)|
| SATA | 1×SATA3.0&nbsp;Connector |
| SDMMC port| 1 x microSD card 3.0 |
| Keys| -&nbsp;1 x Vol+/Recovery<br>-&nbsp;1 x Reset<br>-&nbsp;1 x Power<br>-&nbsp;1 x Vol-<br>-&nbsp;1 x Mute|
| Debugging port| 1 x Debugging serial port|
| RTC | 1 x RTC|
| IR | 1 x IR|
| Tri-color indicator| 3 x LED|
| G-sensor | 1 x G-sensor|
| Fan| 1 x Fan|
| Expansion port| The 20-pin expansion ports include:<br>-&nbsp;2 x ADC<br>-&nbsp; 2 x I2C<br>-&nbsp;7 x GPIO (or 3 x GPIO + 4 x UART)<br>-&nbsp;3 x VCC power (12 V, 3.3 V, and 5 V)|
| Mother board dimensions| 180 mm x 130 mm|
| PCB| 4-laminate|
# Setting Up Environments for Standard System
## System Requirements
- Windows: Windows 10 (64-bit)
- Ubuntu: Ubuntu 18.04 to 21.10; recommended memory: 16 GB or larger.
- User name: cannot contain Chinese characters
- DevEco Device Tool: 3.0 Release
## Installing Necessary Libraries and Tools
To install the necessary libraries and tools, perform the following steps.
On Ubuntu:
1. Run the following **apt-get** command:
```
sudo apt-get update && sudo apt-get install binutils binutils-dev git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib gcc-arm-linux-gnueabi libc6-dev-i386 libc6-dev-amd64 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 genext2fs device-tree-compiler make libffi-dev e2fsprogs pkg-config perl openssl libssl-dev libelf-dev libdwarf-dev u-boot-tools mtd-utils cpio doxygen liblz4-tool openjdk-8-jre gcc g++ texinfo dosfstools mtools default-jre default-jdk libncurses5 apt-utils wget scons python3.8-distutils tar rsync git-core libxml2-dev lib32z-dev grsync xxd libglib2.0-dev libpixman-1-dev kmod jfsutils reiserfsprogs xfsprogs squashfs-tools pcmciautils quota ppp libtinfo-dev libtinfo5 libncurses5-dev libncursesw5 libstdc++6 gcc-arm-none-eabi vim ssh locales libxinerama-dev libxcursor-dev libxrandr-dev libxi-dev
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> The preceding command is applicable to Ubuntu 18.04. For other Ubuntu versions, modify the preceding installation command based on the installation package name. Where:
>
> - Python 3.8 or a later version is required. This section uses Python 3.8 as an example.
> - Java 8 or later is required. This section uses Java 8 as an example.
>
2. Set Python 3.8 as the default Python version.
Check the location of Python 3.8:
```
which python3.8
```
Change python and python3 to python3.8.
```
sudo update-alternatives --install /usr/bin/python python {python3.8 path} 1 #{Python3.8 path} is the location of Python 3.8 obtained in the previous step.
sudo update-alternatives --install /usr/bin/python3 python3 {python3.8 path} 1 #{Python3.8 path} is the location of Python 3.8 obtained in the previous step.
```
## Installing DevEco Device Tool
To remotely access the Ubuntu environment through Windows to perform operations such as burning, you need to install DevEco Device Tool on both Windows and Ubuntu.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> DevEco Device Tool is a one-stop integrated development environment (IDE) provided for developers of OpenHarmony-powered smart devices. It allows code editing, compiling, burning, and debugging. This document describes how to use DevEco Device Tool to remotely connect to the Ubuntu environment for burning and running.
### Installing DevEco Device Tool for Windows
1. Download the [DevEco Device Tool 3.0 Release](https://device.harmonyos.com/cn/ide#download) Windows edition.
2. Decompress the DevEco Device Tool package, double-click the installer, and then click **Next**.
3. Set the installation path of DevEco Device Tool to a path that does not contain any Chinese characters, and then click **Next**. You are advised to install DevEco Device Tool in a non-system drive.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If you have installed DevEco Device Tool 3.0 Beta2 or earlier, the earlier version will be uninstalled before you install a new version. If the following error message is displayed during the uninstallation, click **Ignore** to continue the installation. This error does not affect the installation of the new version.
>
> ![en-us_image_0000001239275843](figures/en-us_image_0000001239275843.png)
![en-us_image_0000001270076961](figures/en-us_image_0000001270076961.png)
4. When prompted, select the tools to be automatically installed.
1. On the **VSCode installation confirm** page, select **Install VScode 1.62.2 automatically** and click **Next**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If Visual Studio Code 1.62 or later has been installed, this step will be skipped.
![en-us_image_0000001237801283](figures/en-us_image_0000001237801283.png)
2. On the displayed **Python select page**, select **Download from Huawei mirror** and click **Next**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If Python 3.8 or 3.9 has been installed, select **Use one of compatible on your PC**.
![en-us_image_0000001193983334](figures/en-us_image_0000001193983334.png)
5. In the dialog box shown below, click **Next**.
![en-us_image_0000001259180828](figures/en-us_image_0000001259180828.png)
6. Read the user agreement and privacy statement carefully, select **I accept the licenses**, and click **Next**.
![en-us_image_0000001307019009](figures/en-us_image_0000001307019009.png)
7. Wait for the DevEco Device Tool setup wizard to automatically install DevEco Device Tool. After the installation is complete, click **Finish** to close the setup wizard.
![en-us_image_0000001239650137](figures/en-us_image_0000001239650137.png)
8. From Visual Studio Code, access the DevEco Device Tool page. Now you can conduct your development in DevEco Device Tool.
![en-us_image_0000001225760456](figures/en-us_image_0000001225760456.png)
### Installing DevEco Device Tool for Ubuntu
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> If the Ubuntu system has not been set up yet, set it up on a virtual machine running Windows. For details, see [Ubuntu Installation Guide](https://developer.huawei.com/consumer/cn/training/course/video/C101639987816176315). Then, [configure the Ubuntu basic environment](https://developer.huawei.com/consumer/cn/training/course/video/C101639988048536240).
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
```
ls -l /bin/sh
```
![en-us_image_0000001226764302](figures/en-us_image_0000001226764302.png)
2. Start the command-line tool, run the following command, enter your password, and select **No** to set **Ubuntu shell** to **bash**.
```
sudo dpkg-reconfigure dash
```
![en-us_image_0000001243641075](figures/en-us_image_0000001243641075.png)
2. Download the [DevEco Device Tool 3.0 Release](https://device.harmonyos.com/cn/ide#download) Linux edition.
3. Decompress the DevEco Device Tool software package and assign permission on the folder obtained from the decompression.
1. Go to the directory where the DevEco Device Tool software package is stored and run the following command to decompress the software package. In the command, change **devicetool-linux-tool-3.0.0.401.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.401.zip
```
2. Open the folder of the decompressed software package and run the following command to grant the execute permission on the installation file. In the command, change **devicetool-linux-tool-3.0.0.401.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.401.sh
```
4. Run the following command to install DevEco Device Tool, where **devicetool-linux-tool-3.0.0.401.sh** indicates the installation file name.
```
sudo ./devicetool-linux-tool-3.0.0.401.sh
```
5. On the page for agreeing to the user agreement and privacy statement, read and agree to the user agreement and privacy statement.
![en-us_image_0000001322167645](figures/en-us_image_0000001322167645.png)
Wait until the "DevEco Device Tool successfully installed." message is displayed.
![en-us_image_0000001198722374](figures/en-us_image_0000001198722374.png)
## Configuring Windows to Remotely Access the Ubuntu Build Environment
### Installing the SSH Service and Obtaining the IP Address for Remote Access
1. In Ubuntu, open the Terminal tool and run the following command to install the SSH service:
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
>
> If the command fails to be executed and the system displays a message indicating that the openssh-server and openssh-client depend on different versions, install the openssh-client of the required version (for example, **sudo apt-get install openssh-client=1:8.2p1-4**) as prompted on the command-line interface (CLI) and run the command again to install the openssh-server.
```
sudo apt-get install openssh-server
```
2. Run the following command to start the SSH service:
```
sudo systemctl start ssh
```
3. Run the following command to obtain the IP address of the current user for remote access to the Ubuntu environment from Windows:
```
ifconfig
```
![en-us_image_0000001215737140](figures/en-us_image_0000001215737140.png)
### Installing Remote SSH
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
![en-us_image_0000001193920448](figures/en-us_image_0000001193920448.png)
2. Click **Install** to install Remote-SSH. After the installation is successful, **Remote-SSH** is displayed on the **INSTALLED** list.
![en-us_image_0000001238880335](figures/en-us_image_0000001238880335.png)
### Remotely Connecting to the Ubuntu Environment
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001238760373](figures/en-us_image_0000001238760373.png), and click + on the **REMOTE EXOPLORER** page.
![en-us_image_0000001215878922](figures/en-us_image_0000001215878922.png)
2. In the **Enter SSH Connection Command** text box, enter **ssh *username*\@*ip_address***, where *ip_address* indicates the IP address of the remote computer to be connected and *username* indicates the account name used for logging in to the remote computer.
![en-us_image_0000001215879750](figures/en-us_image_0000001215879750.png)
3. In the displayed dialog box, select the default first option as the SSH configuration file.
![en-us_image_0000001260519729](figures/en-us_image_0000001260519729.png)
4. Under **SSH TARGETS**, find the remote computer and click ![en-us_image_0000001194080414](figures/en-us_image_0000001194080414.png) to start it.
![en-us_image_0000001215720398](figures/en-us_image_0000001215720398.png)
5. In the displayed dialog box, select **Linux**, select **Continue**, and enter the password for logging in to the remote computer.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
>
> To eliminate the need for frequently entering the password for logging in to the remote computer, [set an SSH public key](https://device.harmonyos.com/cn/docs/documentation/guide/ide-registering-public-key-0000001247162706).
![en-us_image_0000001215897530](figures/en-us_image_0000001215897530.png)
After the connection is successful, the plug-in is automatically installed in the .vscode-server folder on the remote computer. After the installation is complete, reload Visual Studio Code in Windows as prompted. Then you can develop, compile, and burn source code in DevEco Device Tool on Windows.
## Obtaining Source Code
In the Ubuntu environment, perform the following steps to obtain the OpenHarmony source code:
### Preparations
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
3. Install the git client and git-lfs. (Skip this step if these tools have been installed in Installing Required Libraries and Tools. )
Update the software source:
```
sudo apt-get update
```
Run the following command to install the tools:
```
sudo apt-get install git git-lfs
```
4. Configure user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
```
5. Run the following commands to install the **repo** tool:
In this example, **~/bin** is used as an example installation directory. You can change the directory as needed.
```
mkdir ~/bin
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o ~/bin/repo
chmod a+x ~/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
6. Add the path of the **repo** tool to environment variables.
```
vim ~/.bashrc # Edit environment variables.
export PATH=~/bin:$PATH # Add the path of the **repo** tool to the end of environment variables.
source ~/.bashrc # Apply environment variables.
```
### How to Obtain
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities.
- **Obtaining OpenHarmony master code**
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
```
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
- **Obtaining OpenHarmony release code**
For details about how to obtain the source code of an OpenHarmony release, see the [Release-Notes](../../release-notes/Readme.md).
### Running prebuilts
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
```
bash build/prebuilts_download.sh
```
## Installing the Compilation Tools
hb is a compilation tool of OpenHarmony. To install hb in Ubuntu, perform the following steps. For details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guide](../subsystems/subsys-build-all.md).
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> To install a proxy, see [Configuring the Proxy](../quick-start/quickstart-standard-reference.md#configuring-the-proxy).
1. Run the following command to install hb and update it to the latest version:
```
pip3 install --user build/lite
```
2. Set the environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
export PATH=~/.local/bin:$PATH
```
Update the environment variable.
```
source ~/.bashrc
```
3. Run the **hb -h** command in the source code directory. If the following information is displayed, the installation is successful:
```
usage: hb
OHOS build system
positional arguments:
{build,set,env,clean}
build Build source code
set OHOS build settings
env Show OHOS build env
clean Clean output
optional arguments:
-h, --help show this help message and exit
```
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**<br>
> - Run the following command to uninstall hb:
>
> ```
> pip3 uninstall ohos-build
> ```
>
> - If any issue occurs during the hb installation, see [FAQs](../quick-start/quickstart-standard-faq-hb.md) to troubleshoot.
# Fixing Burning Issues
## What should I do if Error: Opening COMxx: Access denied is displayed when I start burning
- **Symptom**
Error: Opening COMxx: Access denied is displayed after clicking Burn and selecting a serial port.
**Figure 1** Failed to open the serial port
![en-us_image_0000001271202461](figures/en-us_image_0000001271202461.png)
- **Possible Causes**
The serial port is in use.
- **Solution**
1. Search for the terminal using serial-xx from the drop-down list in the **TERMINAL** panel.
**Figure 2** Checking whether the serial port is in use
![en-us_image_0000001271202473](figures/en-us_image_0000001271202473.png)
2. Click the dustbin icon as shown below to disable the terminal using the serial port.
**Figure 3** Disabling the terminal using the serial port
![en-us_image_0000001271202469](figures/en-us_image_0000001271202469.png)
3. Click **Burn**, select the serial port, and start burning images again.
**Figure 4** Restarting the burning task
![en-us_image_0000001271562449](figures/en-us_image_0000001271562449.png)
## What should I do when Windows-based PC failed to be connected to the board?
- **Symptom**
The file image cannot be obtained after clicking Burn and selecting a serial port.
**Figure 5** Failed to obtain the file image due to network disconnection
![en-us_image_0000001226922306](figures/en-us_image_0000001226922306.png)
- **Possible Causes**
The board is disconnected from the Windows-based PC.
Windows Firewall does not allow Visual Studio Code to access the network.
- **Solution**
1. Check whether the network cable is properly connected.
2. Click **Windows Firewall**.
**Figure 6** Network and firewall settings
![en-us_image_0000001226634732](figures/en-us_image_0000001226634732.png)
3. Click **Firewall & network protection**, and on the displayed page, click **Allow an app through the firewall**.
**Figure 7** Firewall & network protection
![en-us_image_0000001271202457](figures/en-us_image_0000001271202457.png)
4. Select Visual Studio Code.
**Figure 8** Selecting Visual Studio Code
![en-us_image_0000001271234765](figures/en-us_image_0000001271234765.png)
5. Select the **Private** and **Public** network access rights for Visual Studio Code.
**Figure 9** Allowing Visual Studio Code to access the network
![en-us_image_0000001271474585](figures/en-us_image_0000001271474585.png)
## What should I do when the image failed to be burnt?
- **Symptom**
The burning status is not displayed after clicking Burn and selecting a serial port.
- **Possible Causes**
The IDE is not restarted after the DevEco plug-in is installed.
- **Solution**
Restart the IDE.
# Fixing Compilation Issues
## What should I do if the message "ImportError: No module named apt_pkg" is displayed during the execution of an unidentifiable command?
- **Symptom**
The message "ImportError: No module named apt_pkg" is displayed when an unidentifiable command is executed on the Linux server.
- **Possible Causes**
There is a compatibility issue of python3-apt.
- **Solution**
Reinstall python3-apt.
```
sudo apt-get remove python3-apt
sudo apt-get install python3-apt
```
## What should I do if the message indicating Python cannot be found is displayed during compilation and building?
- **Symptom**
The following error occurs during compilation and building:
```
-bash: /usr/bin/python: No such file or directory
```
- **Possible Cause 1**
Python is not installed.
- **Solution**
Run the following command to install Python. The following uses Python 3.8 as an example.
```
sudo apt-get install python3.8
```
- **Possible Cause 2**
The soft link that points to the Python does not exist in the **usr/bin** directory.
![en-us_image_0000001226922322](figures/en-us_image_0000001226922322.png)
- **Solution**
Run the following commands to add a soft link:
```
# cd /usr/bin/
# which python3
# ln -s /usr/local/bin/python3 python
# python --version
```
Example:
![en-us_image_0000001271562453](figures/en-us_image_0000001271562453.png)
## What should I do if the message indicating Python 3 cannot be found is displayed during the build process?
- **Symptom**
![en-us_image_0000001226602414](figures/en-us_image_0000001226602414.png)
- **Possible Causes**
Python 3 is not installed.
- **Solution**
Run the following command to install Python 3:
```
sudo apt-get install python3.8
```
## What should I do if the message "configure: error: no acceptable C compiler found in $PATH" is displayed during Python 3 installation?
- **Symptom**
The following error occurs during Python 3 installation:
```
configure: error: no acceptable C compiler found in $PATH. See 'config.log' for more details
```
- **Possible Causes**
**gcc** is not installed.
- **Solution**
1. Run the **apt-get install gcc** command to install **gcc** online.
2. After the installation, reinstall Python 3.
## What should I do if the message "-bash: make: command not found" is displayed during Python 3 installation?
- **Symptom**
The following error occurs during Python 3 installation:
```
-bash: make: command not found
```
- **Possible Causes**
Make is not installed.
- **Solution**
1. Run the **apt-get install make** command to install Make online.
2. After the installation, reinstall Python 3.
## What should I do if the message "No module named '_ctypes'" is displayed during Python 3 installation?
- **Symptom**
The following error occurs during Python 3 installation:
```
ModuleNotFoundError: No module named '_ctypes'
```
- **Possible Causes**
**libffi** and **libffi-devel** are not installed.
- **Solution**
1. Run the **apt-get install libffi* -y** command to install **libffi** and **libffi-devel** online.
2. After the installation, reinstall Python 3.
## What should I do if the message "No module named 'Crypto'" is displayed during the build process?
- **Symptom**
The following error occurs during compilation and building:
```
ModuleNotFoundError: No module named 'Crypto'
```
- **Possible Causes**
**Crypto** is not installed.
- **Solution**
Solution 1: Run the **pip3 install Crypto** command to install **Crypto** online.
Method 2: Offline installation
Download the source code from [PyPI](https://pypi.org/project/pycrypto/#files).
![en-us_image_0000001227082334](figures/en-us_image_0000001227082334.png)
Save the source package to the Linux server, decompress the package, and run the **python3 setup.py install** command to install Crypto.
After the preceding installation is complete, rebuild an environment.
# Fixing hb Installation Issues
## What should I do if garbled characters and segmentation faults occur during hb installation?
- **Symptom**
Garbled characters and segmentation faults occur during the execution of the **python3 -m pip install --user ohos-build** command.
- **Possible Causes**
pip is of an early version.
- **Solution**
Upgrade pip.
```
python3 -m pip install -U pip
```
## What should I do if the message "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation?
- **Symptom**
The message "cannot import 'sysconfig' from 'distutils'" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
- **Possible Causes**
The **distutils** module is unavailable.
- **Solution**
Install distutils.
```
sudo apt-get install python3.8-distutils
```
## What should I do if the message "module 'platform' has no attribute 'linux_distribution'" is displayed during hb installation?
- **Symptom**
The message "module 'platform' has no attribute 'linux_distribution'" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
- **Possible Causes**
There is a compatibility issue of python3-pip.
- **Solution**
Reinstall pip.
```
sudo apt remove python3-pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
```
## What should I do if the message "Could not find a version that satisfies the requirement ohos-build" is displayed during hb installation?
- **Symptom**
The message "Could not find a version that satisfies the requirement ohos-build" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
- **Possible Causes**
The installation fails due to poor network connectivity.
- **Solution**
1. Ensure that your computer has a good network connection. If the network connection is unstable, rectify the network fault and reinstall hb.
2. If the network is functional, run the following commands to install hb by specifying a temporary PyPI source:
```
python3 -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ohos-build
```
# Burning Code by Using HiTool
To burn code to the Hi3516D V300 development board, you can use HiTool in addition to DevEco Device Tool.
## Prerequisites
- The source code of the development board has been compiled into files for burning.
- [HiTool](http://www.hihope.org/download/download.aspx) has been installed on the client platform (for example, a Windows-based computer).
- The USB driver has been installed on the client platform. For details, see [Installing the USB Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393).
- A serial port terminal tool, such as IPOP, has been installed on the client platform.
- The client platform and development board are connected using a USB cable and serial cable.
## Procedure
1. Prepare the files to be burnt.
1. On the client platform, create a folder for storing the files to be burnt, for example, **D:\L2**.
2. Download the compiled source package to the client platform, decompress the package, and copy the files required for burning to the folder created in step 1.
For the Hi3516D V300 development board, the files required for burning of the standard system are as follows: **boot.img**, **Hi3516DV300-emmc.xml**, **system.img**, **u-boot-hi3516dv300_emmc.bin**, **uImage**, **updater.img**, **userdata.img**, and **vendor.img**.
2. Burn the image files using HiTool.
1. Open HiTool.
2. Set up HiTool.
Set the transfer mode to USB and burning mode to eMMC (the storage medium of the development board is eMMC).
3. Click **Browse** and select the burning configuration file (for example, **Hi3516DV300-emmc.xml**) from the folder created in step 1.
4. After clicking the **Burn** button, press and hold the **Update** key next to the serial port on the development board, and remove and insert the USB cable.
After the burning starts, logs are displayed in the console area at the bottom of HiTool.
When the burning is complete, HiTool displays a dialog box indicating that the burning is successful.
5. Click **OK**.
3. Import startup parameters.
1. Use the terminal tool to enable the serial port.
2. Restart the development board by removing and inserting its power supply. Press **Enter** in the serial port terminal tool within 3 seconds.
If **hisilicon \#** is displayed on the terminal tool page, the serial port of the development board is connected.
3. Copy the following startup parameters in the serial port terminal tool and press **Enter** to complete the setup.
```
setenv bootargs 'mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M clk_ignore_unused androidboot.selinux=permissive rootdelay=10 hardware=Hi3516DV300 init=/init root=/dev/ram0 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),2M(misc),3307M(system),256M(vendor),-(userdata)';setenv bootcmd 'mmc read 0x0 0x82000000 0x800 0x4800; bootm 0x82000000'
saveenv
reset
```
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**<br>
> When entering startup parameters, do not delete blank lines.
## Getting Started with Standard System (IDE Mode)
- [Standard System Overview](quickstart-ide-standard-overview.md)
- Environment Preparation
- [Setting Up the Windows+Ubuntu Hybrid Development Environment](quickstart-ide-standard-env-setup-win-ubuntu.md)
- [Obtaining Source Code](quickstart-ide-standard-sourcecode-acquire.md)
- [Creating a Source Code Project](quickstart-ide-standard-create-project.md)
- Running a Hello World Program
- Hi3516 Development Board
- [Writing a Hello World Program](quickstart-ide-standard-running-hi3516-create.md)
- [Building](quickstart-ide-standard-running-hi3516-build.md)
- [Burning](quickstart-ide-standard-running-hi3516-burning.md)
- [Running](quickstart-ide-standard-running-hi3516-running.md)
- RK3568 Development Board
- [Writing a Hello World Program](quickstart-ide-standard-running-rk3568-create.md)
- [Building](quickstart-ide-standard-running-rk3568-build.md)
- [Burning](quickstart-ide-standard-running-rk3568-burning.md)
- [Running](quickstart-ide-standard-running-rk3568-running.md)
- Appendix
- [Introduction to the Hi3516 Development Board](quickstart-ide-standard-board-introduction-hi3516.md)
- [Introduction to the RK3568 Development Board](quickstart-ide-standard-board-introduction-rk3568.md)
- [Overall Description of Compilation Form Factors](quickstart-build.md)
# Standard System Overview
## Introduction
The OpenHarmony standard system applies to devices with a reference memory greater than or equal to 128 MiB. This document helps you quickly get started for development of the OpenHarmony standard system, from environment setup to building, burning, and startup.
To accommodate different developer habits, OpenHarmony provides two modes for getting started with the standard system:
- IDE mode: DevEco Device Tool is used for one-stop development, covering dependency installation, building, burning, and running.
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool.
OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
This document exemplifies how to use the installation package mode. For details about the IDE mode, see [Getting Started with Standard System (IDE Mode)](../quick-start/quickstart-ide-standard-overview.md).
## Development Environment
In the Windows+Ubuntu hybrid environment for OpenHarmony development:
- Windows: used for source code development and burning.
- Ubuntu: used for source code building.
This document describes how to develop OpenHarmony in the Windows+Ubuntu environment.
## Development Boards
In this document, two development board models are used as examples: Hi3516D V300 and RK3516. For details about these development boards, see [Appendix](../quick-start/quickstart-standard-board-introduction-hi3516.md). You can purchase the development board as required.
## Development Process
Below you can see the quick start process for the development of the standard system.
**Figure 1** Quick start process for the development of the standard system
![en-us_image_0000001226634676](figures/en-us_image_0000001226634676.png)
## Getting Started with Standard System (Installation Package Mode)
- [Standard System Overview](quickstart-standard-overview.md)
- [Setting Up Environments for Standard System](quickstart-standard-env-setup.md)
- Running a Hello World Program
- Hi3516 Development Board
- [Writing a Hello World Program](quickstart-std-3516-create.md)
- [Building](quickstart-standard-running-hi3516-build.md)
- [Burning](quickstart-standard-running-hi3516-burning.md)
- [Running](quickstart-standard-running-hi3516-running.md)
- RK3568 Development Board
- [Writing a Hello World Program](quickstart-standard-running-rk3568-create.md)
- [Building](quickstart-standard-running-rk3568-build.md)
- [Burning](quickstart-standard-running-rk3568-burning.md)
- [Running](quickstart-standard-running-rk3568-running.md)
- FAQs
- [Fixing hb Installation Issues](quickstart-standard-faq-hb.md)
- [Fixing Compilation Issues](quickstart-standard-faq-compose.md)
- [Fixing Burning Issues](quickstart-standard-faq-burning.md)
- Appendix
- Introduction to Development Boards
- [Introduction to the Hi3516 Development Board](quickstart-standard-board-introduction-hi3516.md)
- [Introduction to the RK3568 Development Board](quickstart-standard-board-introduction-rk3568.md)
- [Overall Description of Compilation Form Factors](quickstart-build.md)
- [Reference](quickstart-standard-reference.md)
# Building
You can build source code with hb or the **build.sh** script. This section exemplifies how to build source code with hb. For details about how to build with the **build.sh** script, see [Building Source Code Using the build.sh Script](../quick-start/quickstart-standard-reference.md).
Go to the root directory of the source code in the Ubuntu environment and perform the following steps:
1. Set the build path.
```
hb set
```
2. Select the current path.
```
.
```
3. Select **Hi3516D V300** under **built-in** and press **Enter**.
4. Start building.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> - To build a component (for example, **hello**), run the **hb build -T _ Target name _** command.
>
> - To build a product incrementally, run the **hb build** command.
>
> - To build a product from the scratch, run the **hb build -f** command.
>
> This example builds a product from the scratch.
```
hb build -f
```
**Figure 1** Hi3516 build settings
![en-us_image_0000001271562433](figures/en-us_image_0000001271562433.png)
5. Check the build result. If "build success" is displayed, the building is successful.
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
> The build result and log files are stored in **out/hispark_taurus**.
# Burning
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
Hi3516D V300 supports burning for the small system through the USB port, network port, and serial port. This document describes how to burn source code through the USB port.
## Importing Source Code
After the building is complete, ensure that you can [remotely access the Ubuntu environment from Windows](quickstart-standard-env-setup.md). Then, perform the following steps to import the source code before burning:
1. Open DevEco Device Tool, go to the home page, and click **Import Project** to open your project or source code.
![en-us_image_0000001278358765](figures/en-us_image_0000001278358765.png)
2. Select the root directory of the OpenHarmony source code (in Ubuntu), select **Import OpenHarmony Source**, and click **Import**.
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> Make sure the selected directory does not contain Chinese characters or spaces.
![en-us_image_0000001271477045](figures/en-us_image_0000001271477045.png)
3. On the **Import Project** page, select a product, and the SoC, board, company, and kernel fields will be automatically populated. Then, select the OpenHarmony source code version for **Ohos Ver**.
![en-us_image_0000001279426717](figures/en-us_image_0000001279426717.png)
4. Click **Open** to open the project or source code.
## Burning
After the source code is imported, perform the following steps:
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
> This feature is available in DevEco Device Tool 2.2 Beta2 and later versions.
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516 Development Board](quickstart-lite-introduction-hi3516.md).
2. If your computer does not have the USB port driver or USB-to-serial driver, install it by following the instructions in [Installing the Serial Port Driver on the Hi3516D V300 or Hi3751 V350 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/hi3516_hi3518-drivers-0000001050743695) or [Installing the USB Port Driver on the Hi3516D V300 Development Board](https://device.harmonyos.com/en/docs/documentation/guide/usb_driver-0000001058690393), depending on the missing driver.
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
- If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. During the connection, DevEco Device Tool will restart. Therefore, to avoid task interruptions, do not connect to DevEco Device Tool when downloading or building source code.
![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png)
4. Click **Project Settings** on the menu bar to access the Hi3516D V300 project configuration page.
![en-us_image_0000001198566364](figures/en-us_image_0000001198566364.png)
5. On the **Tool Chain** tab page, set the Uploader burning tool. You can click **Install** on this page to install the tool online.
![en-us_image_0000001198566365](figures/en-us_image_0000001198566365.png)
6. On the **hi3516dv300** tab page, set the burning options.
- **upload_partitions**: Select the burning profile file (preset by default), which specifies the files to be burnt, start address and length of the partition, and other burning settings. In addition, select **Enable to use upload_partitions_profile**.
> ![icon-note.gif](../public_sys-resources/icon-note.gif) **NOTE**
>
> In the burning profile file, you can change the start address and length of the partition based on the size of the files to be burnt. Make sure the size of the partition is greater than that of the files to be burnt and the partition addresses of the files do not overlap.
>
> If this is the first time you burn files to the development board, select **Enable to use upload_partitions_profile for upload** so that the upload_partitions file will be automatically generated. Afterward, select **Enable to use upload_partitions_profile for upload** only when you need to generate a new **upload_partitions** file.
- **upload_protocol**: Select the burning protocol **hiburn-usb**.
- **upload_port**: Select the serial port number obtained.
![en-us_image_0000001177478136](figures/en-us_image_0000001177478136.png)
7. When you finish modifying, click **Save** on the top.
8. Choose **hi3516dv300** > **Upload** to transfer the files to be burnt from Ubuntu to Windows.
![en-us_image_0000001267532292](figures/en-us_image_0000001267532292.png)
When the "Operation paused, Please press Enter key to continue" message is displayed, which indicates that the transfer is complete, press **Enter** to start burning.
![en-us_image_0000001114129427](figures/en-us_image_0000001114129427.png)
9. When the following information is displayed in the **TERMINAL** window, press and hold the **Update** key within 15 seconds, remove and insert the USB cable, and then release the **Update** key to start burning.
![en-us_image_0000001326412233.png](figures/en-us_image_0000001326412233.png)
When the "SUCCESS" message is displayed, it indicates that the burning is successful.
![en-us_image_0000001160649344](figures/en-us_image_0000001160649344.png)
10. When the burning is successful, perform the operations in Running to start the system.
# Running
## Starting the System
After the burning is complete, perform the following steps to start the system in Windows:
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> This operation procedure is required only if this is the first time you burn an image for the standard system.
1. In DevEco Device Tool, click **Monitor** to open the serial port tool.
![en-us_image_0000001226762374](figures/en-us_image_0000001226762374.png)
2. Restart the development board. Before the autoboot countdown ends, press any key to enter the system.
![en-us_image_0000001271442265](figures/en-us_image_0000001271442265.gif)
3. Run the following commands to set system boot parameters:
```
setenv bootargs 'mem=640M console=ttyAMA0,115200 mmz=anonymous,0,0xA8000000,384M clk_ignore_unused rootdelay=10 hardware=Hi3516DV300 init=/init root=/dev/ram0 rw blkdevparts=mmcblk0:1M(boot),15M(kernel),20M(updater),2M(misc),3307M(system),256M(vendor),-(userdata)';
```
```
setenv bootcmd 'mmc read 0x0 0x82000000 0x800 0x4800; bootm 0x82000000'
```
![en-us_image_0000001271322437](figures/en-us_image_0000001271322437.png)
4. Save the parameter settings.
```
save
```
![en-us_image_0000001271562437](figures/en-us_image_0000001271562437.png)
5. Restart the development board to start the system.
```
reset
```
![en-us_image_0000001226762378](figures/en-us_image_0000001226762378.png)
## Running a Hello World Program
After the system is started, start the serial port tool, run the **helloworld** command in any directory, and press **Enter**. If the message "Hello World!" is displayed, the program runs successfully.
![en-us_image_0000001226602398](figures/en-us_image_0000001226602398.png)
## Next
Congratulations! You have finished all steps! Proceed to [develop a sample](../guide/device-clock-guide.md) to better familiarize yourself with OpenHarmony development.
# Burning
Burning is the process of downloading compiled program files to a development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn images on development boards quickly and efficiently.
For the RK3568 development board, image files are burnt in Windows.
## Importing Source Code
After the building is complete, ensure that you can [remotely access the Ubuntu environment from Windows](quickstart-standard-env-setup.md). Then, perform the following steps to import the source code before burning:
1. Open DevEco Device Tool, go to the home page, and click **Import Project** to open your project or source code.
![en-us_image_0000001278358765](figures/en-us_image_0000001278358765.png)
2. Select the root directory of the OpenHarmony source code (in Ubuntu), select **Import OpenHarmony Source**, and click **Import**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> Make sure the selected directory does not contain Chinese characters or spaces.
![en-us_image_0000001271477045](figures/en-us_image_0000001271477045.png)
3. On the **Import Project** page, select a product, and the SoC, board, company, and kernel fields will be automatically populated. Then, select the OpenHarmony source code version for **Ohos Ver**.
![en-us_image_0000001279587085](figures/en-us_image_0000001279587085.png)
4. Click **Open** to open the project or source code.
## Burning
After the source code is imported, perform the following steps:
1. [Download](https://gitee.com/hihope_iot/docs/blob/master/HiHope_DAYU200/%E7%83%A7%E5%86%99%E5%B7%A5%E5%85%B7%E5%8F%8A%E6%8C%87%E5%8D%97/windows/DriverAssitant_v5.1.1.zip) and install **DriverInstall.exe**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
>
> If the burning tool of an earlier version has been installed, uninstall it first.
2. Connect the computer and the target development board through the USB port. For details, see [Introduction to the RK3568 Development Board](quickstart-standard-board-introduction-rk3568.md).
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
- If ![en-us_image_0000001261315939](figures/en-us_image_0000001261315939.png) is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If ![en-us_image_0000001261515989](figures/en-us_image_0000001261515989.png) is displayed, click the connect icon. During the connection, DevEco Device Tool will restart. Therefore, to avoid task interruptions, do not connect to DevEco Device Tool when downloading or building source code.
![en-us_image_0000001261395999](figures/en-us_image_0000001261395999.png)
4. Click **Project Settings** on the menu bar to access the RK3568 project configuration page.
![en-us_image_0000001198566364](figures/en-us_image_0000001198566364.png)
5. On the **Tool Chain** tab page, set the Uploader burning tool. You can click **Install** on this page to install the tool online.
![en-us_image_0000001239661509](figures/en-us_image_0000001239661509.png)
6. On the **hh_scdy200** tab page, set the burning options.
- **upload_partitions_profile**: Select the burning profile file, which specifies the files to be burnt, start address and length of the partition, and other burning settings. In addition, select **Enable to use upload_partitions_profile**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
>
> In the burning profile file, you can change the start address and length of the partition based on the size of the files to be burnt. Make sure the size of the partition is greater than that of the files to be burnt and the partition addresses of the files do not overlap.
>
> If this is the first time you burn files to the development board, select **Enable to use upload_partitions_profile for upload** so that the upload_partitions file will be automatically generated. Afterward, select **Enable to use upload_partitions_profile for upload** only when you need to generate a new **upload_partitions** file.
- **upload_protocol**: Select the burning protocol **upgrade**.
![en-us_image_0000001194504874](figures/en-us_image_0000001194504874.png)
7. When you finish modifying, click **Save** on the top.
8. Choose **PROJECT TASKS** > **hh_scdy200** > **Upload** to start burning.
![en-us_image_0000001194821710](figures/en-us_image_0000001194821710.png)
9. If the message "Operation paused, Please press Enter key to continue" is displayed, press **Enter**.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
>
> If the message "The board is not in Loader mode. Please Hold on the VOL+key..." is displayed, place the development board in Loader mode as follows: Press and hold the Volume+ key for 3 seconds, press the RESET key, wait for 3 seconds, and then release the Volume+ key.
Wait until the burning is complete. If the following message is displayed, the burning is successful.
![en-us_image_0000001194984912](figures/en-us_image_0000001194984912.png)
# Writing a Hello World Program
The following exemplifies how to run the first program on the development board. The created program outputs the message "Hello World!" .
## Example Directory
The complete code directory is as follows:
```
applications/sample/hello
│ │── BUILD.gn
│ │── include
│ │ └── helloworld.h
│ │── src
│ │ └── helloworld.c
│ └── bundle.json
build
└── subsystem_config.json
vendor/hihope
└── rk3568
└── config.json
```
## How to Develop
Perform the steps below in the source code directory:
1. Create a directory and write the service code.
Create the **applications/sample/hello/src/helloworld.c** directory and file whose code is shown in the following example. You can customize the content to be printed. For example, you can change **World** to **OH**. Declare the string printing function **HelloPrint** in the **helloworld.h** file. You can use either C or C++ to develop a program.
```
#include <stdio.h>
#include "helloworld.h"
int main(int argc, char **argv)
{
HelloPrint();
return 0;
}
void HelloPrint()
{
printf("\n\n");
printf("\n\t\tHello World!\n");
printf("\n\n");
}
```
Add the header file **applications/sample/hello/include/helloworld.h**. The sample code is as follows:
```
#ifndef HELLOWORLD_H
#define HELLOWORLD_H
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
void HelloPrint();
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif // HELLOWORLD_H
```
2. Create a build file.
1. Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows:
```
import("//build/ohos.gni") # Import the build template.
ohos_executable("helloworld") {# Executable module.
sources = [ # Source code of the module.
"src/helloworld.c"
]
include_dirs = [ # Directory of header file on which the module depends.
"include"
]
cflags = []
cflags_c = []
cflags_cc = []
ldflags = []
configs = []
deps =[] # Internal dependencies of a component.
part_name = "hello" # Component name. This parameter is mandatory.
install_enable = true # Whether to install the software by default. This parameter is optional. By default, the software is not installed.
}
```
2. Create the **applications/sample/hello/bundle.json** file and add the description of the **sample** component. The content is as follows:
```
{
"name": "@ohos/hello",
"description": "Hello world example.",
"version": "3.1",
"license": "Apache License 2.0",
"publishAs": "code-segment",
"segment": {
"destPath": "applications/sample/hello"
},
"dirs": {},
"scripts": {},
"component": {
"name": "hello",
"subsystem": "sample",
"syscap": [],
"features": [],
"adapted_system_type": [ "mini", "small", "standard" ],
"rom": "10KB",
"ram": "10KB",
"deps": {
"components": [],
"third_party": []
},
"build": {
"sub_component": [
"//applications/sample/hello:helloworld"
],
"inner_kits": [],
"test": []
}
}
}
```
The **bundle.json** file consists of two parts. The first part describes the information about the subsystem to which the component belongs, and the second part defines the component building configuration. When adding a part, you need to specify the **sub_component** contained in the part. If there are interfaces provided for other components, describe them in **inner_kits**. If there are test cases, describe them in **test**.
3. Modify the subsystem configuration file.
Add the configuration of the new subsystem to the **build/subsystem_config.json** file.
```
"sample": {
"path": "applications/sample/hello",
"name": "sample"
},
```
4. Modify the product configuration file.
In the **vendor\hihope\rk3568\config.json** file, add the **hello** part after the existing part.
```
"usb:usb_manager_native":{},
"applications:prebuilt_hap":{},
"sample:hello":{},
"wpa_supplicant-2.9:wpa_supplicant-2.9":{},
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册