提交 5ca031c7 编写于 作者: E ester.zhou

update folder

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 a794a05f
# Getting Started
- [Mini and Small Systems](quickstart-lite.md)
- [Overview](quickstart-lite-overview.md)
- [Introduction](quickstart-lite-introduction.md)
- [Hi3861 Development Board](quickstart-lite-introduction-hi3861.md)
- [Hi3516 Development Board](quickstart-lite-introduction-hi3516.md)
- [Hi3518 Development Board](quickstart-lite-introduction-hi3518.md)
- [Environment Setup](quickstart-lite-env-setup.md)
- [Overview](quickstart-lite-env-setup-overview.md)
- [Setting Up Windows Development Environment](quickstart-lite-env-setup-windows.md)
- [Setting Up Ubuntu Development Environment](quickstart-lite-env-setup-linux.md)
- [FAQs](quickstart-lite-env-setup-faqs.md)
- [How to Develop](quickstart-lite-steps.md)
- [Hi3861](quickstart-lite-steps-hi3861.md)
- [Setting Up the Environment](quickstart-lite-steps-hi3861-setting.md)
- [Setting Up WLAN Connection](quickstart-lite-steps-hi3861-connection.md)
- [Running a Hello World Program](quickstart-lite-steps-hi3861-running.md)
- [FAQs](quickstart-lite-steps-hi3861-faqs.md)
- [Hi3516](quickstart-lite-steps-hi3516.md)
- [Setting Up the Environment](quickstart-lite-steps-hi3516-setting.md)
- [Running a Hello OHOS Program](quickstart-lite-steps-hi3516-running.md)
- [Developing a Driver](quickstart-lite-steps-hi3516-program.md)
- [FAQs](quickstart-lite-steps-hi3516-faqs.md)
- [Hi3518](quickstart-lite-steps-hi3518.md)
- [Setting Up the Environment](quickstart-lite-steps-hi3518-setting.md)
- [Running a Hello OHOS Program](quickstart-lite-steps-hi3518-running.md)
- [FAQs](quickstart-lite-steps-hi3518-faqs.md)
- [Standard System](quickstart-standard.md)
- [Introduction](quickstart-standard-overview.md)
- [Setting Up Windows Development Environment](quickstart-standard-windows-environment.md)
- [Setting Up Ubuntu Development Environment in Docker Mode](quickstart-standard-docker-environment.md)
- [Setting Up Ubuntu Development Environment with Installation Package](quickstart-standard-package-environment.md)
- [Burning Images](quickstart-standard-burn.md)
- [Running an Image](quickstart-standard-running.md)
- [FAQs](quickstart-standard-faqs.md)
\ No newline at end of file
# Getting Started
- Getting Started for Mini and Small Systems
- [Mini and Small System Overview](quickstart-ide-lite-overview.md)
- Environment Preparation
- [Setting Up the Windows+Ubuntu Hybrid Build 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-application-framework.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-hi3816-running.md)
- Hi3516 Development Board
- [Writing a Hello World Program](quickstart-ide-lite-steps-hi3516-application-framework.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)
- [Getting Started with Mini and Small Systems (Installation Package Mode)](quickstart-lite-package-directory.md)
- Getting Started for Standard System
- [Standard System Overview](quickstart-ide-standard-overview.md)
- Environment Preparation
- [Setting Up the Windows+Ubuntu Hybrid Build 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 Development Boards
- [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)
- [Getting Started for Standard System (Installation Package Mode)](quickstart-standard-package-directory.md)
# Getting Started with Mini and Small Systems (Installation Package Mode)
- **[Mini and Small System Overview](quickstart-lite-overview.md)**
- **[Environment Preparation](quickstart-lite-env-setup.md)**
- **[Running a Hello World Program](quickstart-lite-steps.md)**
- **[FAQs](quickstart-lite-env-setup-faqs.md)**
- **[Appendix](quickstart-lite-appendix.md)**
# Appendix
- **[Introduction to Development Boards](quickstart-ide-lite-board-introduction.md)**
# 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)**
# Creating 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**
> 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 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 **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 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).
## 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 Build Environment
The setup procedure varies, depending on whether you need a GUI. If you need a GUI, you need to install Visual Studio Code. In this case, follow the instructions in [Setting Up the Ubuntu Development Environment](https://device.harmonyos.com/en/docs/documentation/guide/ide-install-ubuntu-0000001072959308). If you do not need a GUI, perform the steps below:
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.400.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.400.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.400.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.400.sh
```
4. Run the following command to install DevEco Device Tool, where **devicetool-linux-tool-3.0.0.400.sh** indicates the installation file name.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> 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.400.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**
> 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** 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 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-cn_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)
# Environment Preparation
- **[Setting Up the Windows+Ubuntu Hybrid Build Environment](quickstart-ide-lite-env-setup-win-ubuntu.md)**
- **[Obtaining Source Code](quickstart-ide-lite-sourcecode-acquire.md)**
# 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|
# Introduction to the Hi3861 Development Board
## 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.
**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_0000001271234729](figures/en-us_image_0000001271234729.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 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-package-directory.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-board-introduction.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)
# 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.
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:
```
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
## Obtaining Source Code
> ![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
```
# 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
└── src
└── helloworld.c
```
## How to Develop
Perform the steps below in the source code directory:
1. Create a directory and the program source 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 **OHOS** to **World**. You can use either C or C++ to develop a program.
```
#include <stdio.h>
int main(int argc, char **argv)
{
printf("\n\n");
printf("\n\t\tHello OHOS!\n");
printf("\n\n\n");
return 0;
}
```
2. Create a build file.
Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows:
```
import("//build/lite/config/component/lite_component.gni")
lite_component("hello-OHOS") {
features = [ ":helloworld" ]
}
executable("helloworld") {
output_name = "helloworld"
sources = [ "src/helloworld.c" ]
}
```
3. Add a component.
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: 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.)
```
{
"components": [
{
"component": "camera_sample_communication",
"description": "Communication related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/communication"
],
"targets": [
"//applications/sample/camera/communication:sample"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##start##
{
"component": "hello_world_app",
"description": "hello world samples.",
"optional": "true",
"dirs": [
"applications/sample/hello"
],
"targets": [
"//applications/sample/hello:hello-OHOS"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##end##
{
"component": "camera_sample_app",
"description": "Camera related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/launcher",
"applications/sample/camera/cameraApp",
"applications/sample/camera/setting",
"applications/sample/camera/gallery",
"applications/sample/camera/media"
],
```
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.)
```
{
"subsystem": "applications",
"components": [
{ "component": "camera_sample_app", "features":[] },
{ "component": "camera_sample_ai", "features":[] },
##start##
{ "component": "hello_world_app", "features":[] },
##end##
{ "component": "camera_screensaver_app", "features":[] }
]
},
```
# 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_0000001265652869](figures/en-us_image_0000001265652869.png)
After the toolchain is automatically installed, the figure below is displayed.
![en-us_image_0000001220852754](figures/en-us_image_0000001220852754.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
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](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/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 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.
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 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_0000001226794644](figures/en-us_image_0000001226794644.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_0000001227114584](figures/en-us_image_0000001227114584.png)
3. Click **Monitor** on the taskbar to start the serial port tool.
![en-us_image_0000001271234705](figures/en-us_image_0000001271234705.png)
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)
## Running a Hello World Program
After the system is started, perform the following steps to run the Hello World program:
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_0000001271354693](figures/en-us_image_0000001271354693.png)
## Next
Congratulations! You have finished all steps! Proceed to [develop a sample camera with a screen](https://gitee.com/openharmony/docs/blob/master/en/device-dev/guide/device-camera.md) to better familiarize yourself with OpenHarmony development.
# Hi3516 Development Board
- **[Writing a Hello World Program](quickstart-ide-lite-steps-hi3516-application-framework.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)**
# 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](https://gitee.com/openharmony/docs/blob/master/en/device-dev/guide/device-wlan.md) to better familiarize yourself with OpenHarmony development.
# Writing a Hello World Program
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.
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.
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:
```
.
└── applications
└── sample
└── wifi-iot
└── app
└── my_first_app
│── hello_world.c
└── BUILD.gn
```
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.)
```
#include <stdio.h>
#include "ohos_init.h"
#include "ohos_types.h"
void HelloWorld(void)
{
printf("[DEMO] Hello world.\n");
}
SYS_RUN(HelloWorld);
```
3. Compile the **BUILD.gn** file for building services into a static library.
Create the **BUILD.gn** file in **./applications/sample/wifi-iot/app/my_first_app** and configure the file as follows:
The **BUILD.gn** file consists of three parts, including target, source file, and header file path. You need to fill in all of these parts.
```
static_library("myapp") {
sources = [
"hello_world.c"
]
include_dirs = [
"//utils/native/lite/include"
]
}
```
- Specify the compilation result named **libmyapp.a** in **static_library**. You can fill in this part based on your need.
- Specify the .c file on which a file depends and its path in **sources**. The path that contains **//** represents an absolute path (the code root path). The path that does not contain **//** is a relative path.
- Specify the path of .h file on which **sources** depends in **include_dirs**.
4. Add a component.
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: 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.)
```
{
"components": [
{
"component": "camera_sample_communication",
"description": "Communication related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/communication"
],
"targets": [
"//applications/sample/camera/communication:sample"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##start##
{
"component": "hello_world_app",
"description": "hello world samples.",
"optional": "true",
"dirs": [
"applications/sample/wifi-iot/app/my_first_app"
],
"targets": [
"//applications/sample/wifi-iot/app/my_first_app:myapp"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_m" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##end##
{
"component": "camera_sample_app",
"description": "Camera related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/launcher",
"applications/sample/camera/cameraApp",
"applications/sample/camera/setting",
"applications/sample/camera/gallery",
"applications/sample/camera/media"
],
```
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.)
```
{
"subsystem": "applications",
"components": [
##start##
{ "component": "hello_world_app", "features":[] },
##end##
{ "component": "wifi_iot_sample_app", "features":[] }
]
},
```
# 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
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](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-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_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.
3. 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)
> ![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 Hi3861 V100](https://device.harmonyos.com/en/docs/documentation/guide/hi3861-drivers-0000001058153433).
4. Choose **QUICK ACCESS** > **DevEco Home** > **Projects**, and then click **Settings**.
![en-us_image_0000001198943768](figures/en-us_image_0000001198943768.png)
5. 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)
6. Check the preset information of the files to be burnt and modify them when necessary.
On the **hi3861_app** tab page, select **partition_bin** from **New Option**, and set the path of the file to be burnt.
![en-us_image_0000001260919759](figures/en-us_image_0000001260919759.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 button on the development board to restart it.
![en-us_image_0000001198466090](figures/en-us_image_0000001198466090.png)
10. 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)
# 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)
# Hi3861 Development Board
- **[Writing a Hello World Program](quickstart-ide-lite-steps-hi3861-application-framework.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-hi3816-running.md)**
# Running a Hello World Program
- **[Hi3861 Development Board](quickstart-ide-lite-steps-hi3861.md)**
- **[Hi3516 Development Board](quickstart-ide-lite-steps-hi3516.md)**
# Getting Started for Mini and Small Systems (IDE Mode)
- **[Mini and Small System Overview](quickstart-ide-lite-overview.md)**
- **[Environment Preparation](quickstart-ide-lite-env-setup.md)**
- **[Creating a Source Code Project](quickstart-ide-lite-create-project.md)**
- **[Running a Hello World Program](quickstart-ide-lite-steps.md)**
- **[Appendix](quickstart-ide-lite-appendix.md)**
# Appendix
- **[Introduction to Development Boards](quickstart-ide-standard-board-introduction.md)**
# 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|
# 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_0000001271322293](figures/en-us_image_0000001271322293.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×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|
| 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 | -&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 |
| PCIe | 1 x 2-lane PCIe 3.0 Connector (RC mode)|
| SATA | 1×SATA3.0&nbsp;Connector |
| SDMMC | 1×Micro&nbsp;SD&nbsp;Card3.0 |
| Keys| -&nbsp;1×Vol+/Recovery<br>-&nbsp;1×Reset<br>-&nbsp;1×Power<br>-&nbsp;1×Vol-<br>-&nbsp;1×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| 180mm×130mm |
| PCB| 4-laminate|
# Introduction to Development Boards
- **[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)**
# Creating 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**
> 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**
> - 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 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).
## 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 Build Environment
The setup procedure varies, depending on whether you need a GUI. If you need a GUI, you need to install Visual Studio Code. In this case, follow the instructions in [Setting Up the Ubuntu Development Environment](https://device.harmonyos.com/en/docs/documentation/guide/ide-install-ubuntu-0000001072959308). If you do not need a GUI, perform the steps below:
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.400.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.400.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.400.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.400.sh
```
4. Run the following command to install DevEco Device Tool, where **devicetool-linux-tool-3.0.0.400.sh** indicates the installation file name.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> 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.400.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**
> 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** 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 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-cn_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)
# Environment Preparation
- **[Setting Up the Windows+Ubuntu Hybrid Build Environment](quickstart-ide-standard-env-setup-win-ubuntu.md)**
- **[Obtaining Source Code](quickstart-ide-standard-sourcecode-acquire.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 IDE mode. For details about the installation package mode, see [Getting Started with Standard System (Installation Package Mode)](../quick-start/quickstart-standard-package-directory.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-standard-board-introduction.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](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/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 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.
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.
# 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
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 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 productdefine\common\products\Hi3516DV300.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":{},
```
# 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**
> 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.
# 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)**
# 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**
> 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 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. 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**
> 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. 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
productdefine/common
└── products
└── rk3568.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 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 productdefine\common\products\rk3568.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":{},
```
# Running
## 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.
**Figure 1** System startup effect
![en-us_image_0000001226762222](figures/en-us_image_0000001226762222.jpg)
## 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.
![en-us_image_0000001226602250](figures/en-us_image_0000001226602250.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.
![en-us_image_0000001226922154](figures/en-us_image_0000001226922154.png)
# 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)**
# Running a Hello World Program
- **[Hi3516 Development Board](quickstart-ide-standard-running-hi3516.md)**
- **[RK3568 Development Board](quickstart-ide-standard-running-rk3568.md)**
# 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:
```
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
## Obtaining Source Code
> ![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
```
# Appendix
- **[Introduction to Development Boards](quickstart-lite-board-introduction.md)**
- **[Reference](quickstart-lite-reference.md)**
# 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)**
# FAQs<a name="EN-US_TOPIC_0000001128470858"></a>
# FAQs
## What should I do if garbled characters and segmentation faults occur during hb installation?<a name="section411894616119"></a>
- **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.
- **Solutions**
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?<a name="section629417571626"></a>
- **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.
- **Solutions**
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?<a name="section10871523332"></a>
- **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.
- **Solutions**
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?<a name="section47351657163213"></a>
- **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.
- **Solutions**
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
```
## What should I do if the message "ImportError: No module named apt\_pkg" is displayed during the execution of an unidentifiable command?<a name="section159891252236"></a>
- **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.
- **Solutions**
Reinstall python3-apt.
```
sudo apt-get remove python3-apt
sudo apt-get install python3-apt
```
- **[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)**
# Environment Setup<a name="EN-US_TOPIC_0000001128311058"></a>
# Setting Up Environments for the Mini and Small Systems
- **[Overview](quickstart-lite-env-setup-overview.md)**
- **[Setting Up Windows Development Environment](quickstart-lite-env-setup-windows.md)**
## System Requirements
- **[Setting Up Ubuntu Development Environment](quickstart-lite-env-setup-linux.md)**
- Windows: Windows 10 (64-bit)
- **[FAQs](quickstart-lite-env-setup-faqs.md)**
- Ubuntu: Ubuntu 18.04 or later; recommended memory: 16 GB or higher.
- 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
```
> ![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. Specifically:
>
> - 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 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**
> 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** 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)
### Installing DevEco Device Tool for Ubuntu
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.400.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.400.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.400.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.400.sh
```
4. Run the following command to install DevEco Device Tool, where **devicetool-linux-tool-3.0.0.400.sh** indicates the installation file name.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> 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.400.sh
```
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-cn_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)
## 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:
```
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
### Obtaining Source Code
> ![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 Tool
For details about the functions of the OpenHarmony compilation and building module, see [Compilation and Building Guidelines](https://gitee.com/openharmony/docs/blob/master/en/device-dev/subsystems/subsys-build.md).
Perform the following steps in Ubuntu:
### Install hb.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> To install a proxy, see [Configuring a Proxy](../quick-start/quickstart-lite-reference.md#configuring-a-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**
> - 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.
### Install LLVM. This step is 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 operation 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 a 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 the 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
```
# 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_0000001226634728](figures/en-us_image_0000001226634728.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_0000001226954644](figures/en-us_image_0000001226954644.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_0000001271234761](figures/en-us_image_0000001271234761.png)
3. Click **Burn**, select the serial port, and start burning images again.
**Figure 4** Restarting the burning task
![en-us_image_0000001271594765](figures/en-us_image_0000001271594765.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_0000001271234757](figures/en-us_image_0000001271234757.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 applications to communicate through Windows Firewall**.
**Figure 7** Firewall and network protection
![en-us_image_0000001271354749](figures/en-us_image_0000001271354749.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.
## 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**
The serial port is connected incorrectly.
- **Solution**
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".
- **Possible Cause 2**
The U-Boot of the board is damaged.
- **Solution**
Burn the U-Boot.
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.
> ![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
2. Burn the U-Boot file by following the procedures for burning a U-Boot file over USB.
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).
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
![en-us_image_0000001271234753](figures/en-us_image_0000001271234753.png)
# 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 when 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_0000001271354745](figures/en-us_image_0000001271354745.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_0000001227114636](figures/en-us_image_0000001227114636.png)
## What should I do when the message indicating Python 3 cannot be found is displayed during compilation and building?
- **Symptom**
![en-us_image_0000001227114640](figures/en-us_image_0000001227114640.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 when 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 when 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 when 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.
## "No module named 'Crypto'" 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_0000001226794696](figures/en-us_image_0000001226794696.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.
## What should I do when the message No module named 'ecdsa' is displayed during compilation and building? (Hi3861)
- **Symptom**
The following error occurs during compilation and building:
```
ModuleNotFoundError: No module named 'ecdsa'
```
- **Possible Causes**
**ecdsa** is not installed.
- **Solution**
Solution 1: Run the **pip3 install ecdsa** command to install **ecdsa** online.
Method 2: Offline installation
Download the installation package from [PyPI](https://pypi.org/project/ecdsa/#files).
![en-us_image_0000001271594753](figures/en-us_image_0000001271594753.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.
After the preceding installation is complete, rebuild an environment.
## What should I do when the message Could not find a version that satisfies the requirement six>=1.9.0 is displayed during compilation and building? (Hi3861)
- **Symptom**
The following error occurs during compilation and building:
```
Could not find a version that satisfies the requirement six>=1.9.0
```
- **Possible Causes**
**six** is not installed.
- **Solution**
Solution 1: Run the **pip3 install six** command to install **six** online.
Method 2: Offline installation
Download the installation package from [PyPI](https://pypi.org/project/six/#files).
![en-us_image_0000001271474573](figures/en-us_image_0000001271474573.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**.
After the preceding installation is complete, rebuild an environment.
## What should I do when the message cannot find -lgcc is displayed during compilation and building? (Hi3861)
- **Symptom**
The following error occurs during compilation and building:
```
riscv32-unknown-elf-ld: cannot find -lgcc
```
- **Possible Causes**
The PATH is incorrectly written by **gcc_riscv32**. There is an extra slash (/).
```
~/gcc_riscv32/bin/:/data/toolchain/
```
- **Solution**
Modify the PATH by deleting the slash (/).
```
~/gcc_riscv32/bin:/data/toolchain/
```
## What should I do if an lsb_release error occurs during kconfiglib installation? (Hi3861)
- **Symptom**
The following error occurs during **kconfiglib** installation:
```
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
```
- **Possible Causes**
The Python version matched with the **lsb_release** module is different from the current Python version.
- **Solution**
Run the **find / -name lsb_release** command, for example, **sudo rm -rf /usr/bin/lsb_release** to locate and delete **lsb_release**.
# 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
```
## Getting Started with Mini and Small Systems (IDE Mode)
- [Mini and Small System Overview](quickstart-ide-lite-overview.md)
- Environment Preparation
- [Setting Up the Windows+Ubuntu Hybrid Build 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-application-framework.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-hi3816-running.md)
- Hi3516 Development Board
- [Writing a Hello World Program](quickstart-ide-lite-steps-hi3516-application-framework.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)
- [Getting Started with Mini and Small Systems (Installation Package Mode)](quickstart-lite-package-directory.md)
# Hi3516 Development Board<a name="EN-US_TOPIC_0000001174350603"></a>
## Introduction<a name="section26131214194212"></a>
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** Hi3516D V300 front view<a name="fig6340825506"></a>
![](figures/hi3516d-v300-front-view.png "hi3516d-v300-front-view")
## Development Board Specifications<a name="section15192203316533"></a>
**Table 1** Specifications of the Hi3516 development board
<a name="table31714894311"></a>
<table><thead align="left"><tr id="row10171198194310"><th class="cellrowborder" valign="top" width="14.77%" id="mcps1.2.3.1.1"><p id="a2b235e9ed55f4338886788f140e648a0"><a name="a2b235e9ed55f4338886788f140e648a0"></a><a name="a2b235e9ed55f4338886788f140e648a0"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="85.22999999999999%" id="mcps1.2.3.1.2"><p id="p9702458104014"><a name="p9702458104014"></a><a name="p9702458104014"></a>Specification</p>
</th>
</tr>
</thead>
<tbody><tr id="row0171168114311"><td class="cellrowborder" valign="top" width="14.77%" headers="mcps1.2.3.1.1 "><p id="p1698185431418"><a name="p1698185431418"></a><a name="p1698185431418"></a>Processor and internal memory</p>
</td>
<td class="cellrowborder" valign="top" width="85.22999999999999%" headers="mcps1.2.3.1.2 "><a name="ul1147113537186"></a><a name="ul1147113537186"></a><ul id="ul1147113537186"><li>Hi3516D V300</li><li>DDR3 1GB</li><li>8 GB eMMC4.5</li></ul>
</td>
</tr>
<tr id="row21721687435"><td class="cellrowborder" valign="top" width="14.77%" headers="mcps1.2.3.1.1 "><p id="p817216810435"><a name="p817216810435"></a><a name="p817216810435"></a>External components</p>
</td>
<td class="cellrowborder" valign="top" width="85.22999999999999%" headers="mcps1.2.3.1.2 "><a name="ul179543016208"></a><a name="ul179543016208"></a><ul id="ul179543016208"><li>Ethernet port</li><li>Audio and video<a name="ul5941311869"></a><a name="ul5941311869"></a><ul id="ul5941311869"><li>One voice input</li><li>One mono (AC_L) output, connected to a 3 W power amplifier (LM4871)</li><li>MicroHDMI (one HDMI 1.4)</li></ul>
</li><li>Camera<a name="ul924263620"></a><a name="ul924263620"></a><ul id="ul924263620"><li>Sensor IMX335</li><li>M12 lens with a focal length of 4 mm and an aperture of 1.8</li></ul>
</li><li>Display<a name="ul101471711667"></a><a name="ul101471711667"></a><ul id="ul101471711667"><li>2.35-inch LCD connector</li><li>5.5-inch LCD connector</li></ul>
</li><li>External components and interfaces<a name="ul089255556"></a><a name="ul089255556"></a><ul id="ul089255556"><li>microSD card interface</li><li>JTAG/I2S interface</li><li>ADC interface</li><li>Steer gear interface</li><li>Grove connector</li><li>USB2.0(Type C)</li><li>Three function keys: two custom keys and one update key</li><li>LED indicator (including green and red)</li></ul>
</li></ul>
</td>
</tr>
</tbody>
</table>
# 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|
# Hi3861 Development Board<a name="EN-US_TOPIC_0000001174270685"></a>
## Introduction<a name="section19352114194115"></a>
The Hi3861 WLAN module is a development board with 2 x 5 cm form factor. It contains a 2.4 GHz WLAN SoC that highly integrates the IEEE 802.11b/g/n baseband and radio frequency \(RF\) circuit. This module provides open and easy-to-use development and debugging environments for running OpenHarmony.
**Figure 1** Appearance of Hi3861 WLAN module<a name="fig5781557185810"></a>
![](figures/appearance-of-hi3861-wlan-module.png "appearance-of-hi3861-wlan-module")
The Hi3861 WLAN module can also be connected to the Hi3861 mother board to expand its peripheral capabilities. The following figure shows the Hi3861 mother board.
**Figure 2** Appearance of the Hi3861 mother board<a name="fig12182375916"></a>
![](figures/appearance-of-the-hi3861-mother-board.png "appearance-of-the-hi3861-mother-board")
- 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** Hi3861 functions<a name="fig1367035113590"></a>
![](figures/hi3861-functions.png "hi3861-functions")
## Resources and Constraints<a name="section82610215014"></a>
As the Hi3861 only offers 2 MB Flash and 352 KB RAM, use them efficiently when compiling code.
## Development Board Specifications<a name="section169054431017"></a>
**Table 1** Hi3861 WLAN module specifications
<a name="t672b053e2ac94cbdb5244857fed4764e"></a>
<table><thead align="left"><tr id="r54b3810e43d24e1887c1d6a41394996b"><th class="cellrowborder" valign="top" width="18.060000000000002%" id="mcps1.2.3.1.1"><p id="a2b235e9ed55f4338886788f140e648a0"><a name="a2b235e9ed55f4338886788f140e648a0"></a><a name="a2b235e9ed55f4338886788f140e648a0"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="81.94%" id="mcps1.2.3.1.2"><p id="a95c4ba2e404f4a45b65984746aaa56ab"><a name="a95c4ba2e404f4a45b65984746aaa56ab"></a><a name="a95c4ba2e404f4a45b65984746aaa56ab"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="r71f534ea66af4191b020408df5978f41"><td class="cellrowborder" valign="top" width="18.060000000000002%" headers="mcps1.2.3.1.1 "><p id="a0531f1bb62d5443880576cc5de23f2e6"><a name="a0531f1bb62d5443880576cc5de23f2e6"></a><a name="a0531f1bb62d5443880576cc5de23f2e6"></a>General specifications</p>
</td>
<td class="cellrowborder" valign="top" width="81.94%" headers="mcps1.2.3.1.2 "><a name="u2a0d06f28d454d30818ced9a0432211b"></a><a name="u2a0d06f28d454d30818ced9a0432211b"></a><ul id="u2a0d06f28d454d30818ced9a0432211b"><li>Operates over 1×1 2.4 GHz frequency band (ch1-ch14).</li><li>The physical layer (PHY) complies with the IEEE 802.11b/g/n protocol.</li><li>The media access control (MAC) layer complies with the IEEE802.11 d/e/h/i/k/v/w protocol.</li></ul>
<a name="u8f31d142d92147789195a18b50836d2c"></a><a name="u8f31d142d92147789195a18b50836d2c"></a><ul id="u8f31d142d92147789195a18b50836d2c"><li>Includes the built-in public address (PA) and local area network (LAN); integrates transmit-receive (Tx/Rx) switch and Balun. </li><li>Supports the station (STA) and access point (AP) modes. When the Hi3861 WLAN module functions as an AP, a maximum of six STAs are supported.</li><li>Supports WFA WPA, WFA WPA2 personal, and WPS2.0.</li><li>Supports three kinds of packet traffic arbiter (PTA) (2- , 3- , or 4-wire PTA), each of which coexists with the BT or BLE chip.</li><li>The input voltage ranges from 2.3 V to 3.6 V.</li></ul>
<a name="ul114549122110"></a><a name="ul114549122110"></a><ul id="ul114549122110"><li>The input/output (I/O) power voltage can be 1.8 V or 3.3 V.</li></ul>
<a name="ue044275c53b84dd29dda674e16e72823"></a><a name="ue044275c53b84dd29dda674e16e72823"></a><ul id="ue044275c53b84dd29dda674e16e72823"><li>Supports self-calibration for RF hardware.</li><li>Performs with low power consumption:<a name="ul0879143622219"></a><a name="ul0879143622219"></a><ul id="ul0879143622219"><li>Ultra deep sleep mode: 5 μA @ 3.3 V</li><li>DTIM1: 1.5 mA @ 3.3 V</li><li>DTIM3: 0.8 mA @ 3.3 V</li></ul>
</li></ul>
</td>
</tr>
<tr id="rd9b56e759af34950b6887ca1bf5bb7cf"><td class="cellrowborder" valign="top" width="18.060000000000002%" headers="mcps1.2.3.1.1 "><p id="a0aed3860a78a4b50bedf60699afd3996"><a name="a0aed3860a78a4b50bedf60699afd3996"></a><a name="a0aed3860a78a4b50bedf60699afd3996"></a>PHY features</p>
</td>
<td class="cellrowborder" valign="top" width="81.94%" headers="mcps1.2.3.1.2 "><a name="u6568aa052152432aa1f44372445ca634"></a><a name="u6568aa052152432aa1f44372445ca634"></a><ul id="u6568aa052152432aa1f44372445ca634"><li>Supports all data rates of the single antenna required by the IEEE802.11b/g/n protocol.</li><li>Supports a maximum rate of 72.2 Mbps@HT20 MCS7</li><li>Supports the standard bandwidth (20 MHz) and narrow bandwidth (5 MHz or 10 MHz).</li><li>Supports space-time block coding (STBC).</li><li>Supports short guard interval (Short-GI).</li></ul>
</td>
</tr>
<tr id="r3563f9df9759486794952d46c5d2d03f"><td class="cellrowborder" valign="top" width="18.060000000000002%" headers="mcps1.2.3.1.1 "><p id="afd48a2d879dc4aada8b60bebb96523c7"><a name="afd48a2d879dc4aada8b60bebb96523c7"></a><a name="afd48a2d879dc4aada8b60bebb96523c7"></a>MAC features</p>
</td>
<td class="cellrowborder" valign="top" width="81.94%" headers="mcps1.2.3.1.2 "><a name="uca57d799e7814925a5bf1b891335bd79"></a><a name="uca57d799e7814925a5bf1b891335bd79"></a><ul id="uca57d799e7814925a5bf1b891335bd79"><li>Supports aggregate MAC service data unit (A-MPDU) and aggregate MAC protocol data unit (A-MSDU). </li><li>Supports block acknowledgment (Blk-ACK).</li><li>Supports quality of service (QoS), meeting customer's service requirements.</li></ul>
</td>
</tr>
<tr id="r3e1c86e5f6cd4df0a1b30a08fb8481a2"><td class="cellrowborder" valign="top" width="18.060000000000002%" headers="mcps1.2.3.1.1 "><p id="a57086ea97a1b46cdb21953bf0fc22d94"><a name="a57086ea97a1b46cdb21953bf0fc22d94"></a><a name="a57086ea97a1b46cdb21953bf0fc22d94"></a>CPU subsystem</p>
</td>
<td class="cellrowborder" valign="top" width="81.94%" headers="mcps1.2.3.1.2 "><a name="u612cc2cd0cfe40229263c4f506c0c69c"></a><a name="u612cc2cd0cfe40229263c4f506c0c69c"></a><ul id="u612cc2cd0cfe40229263c4f506c0c69c"><li>Integrates a high-performance 32-bit microprocessor with a maximum operating frequency of 160 MHz.</li><li>Includes built-in 352 KB SRAM and 288 KB ROM.</li><li>Includes a built-in 2 MB flash memory.</li></ul>
</td>
</tr>
<tr id="rae93c5236b084cd2a2c0d5c29027b40e"><td class="cellrowborder" valign="top" width="18.060000000000002%" headers="mcps1.2.3.1.1 "><p id="a9b14a9e95b3849278c332259d8add1b2"><a name="a9b14a9e95b3849278c332259d8add1b2"></a><a name="a9b14a9e95b3849278c332259d8add1b2"></a>Peripheral interfaces</p>
</td>
<td class="cellrowborder" valign="top" width="81.94%" headers="mcps1.2.3.1.2 "><a name="u7c73ebffd89e4092bd65f0d878d59b22"></a><a name="u7c73ebffd89e4092bd65f0d878d59b22"></a><ul id="u7c73ebffd89e4092bd65f0d878d59b22"><li>Include 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.)</li><li>The frequency of the external primary crystal oscillator is 40 MHz or 24 MHz.</li></ul>
</td>
</tr>
<tr id="r18810701aafe42ad8d9a7d882730c210"><td class="cellrowborder" valign="top" width="18.060000000000002%" headers="mcps1.2.3.1.1 "><p id="ae8f47db913724e458c265e858409950b"><a name="ae8f47db913724e458c265e858409950b"></a><a name="ae8f47db913724e458c265e858409950b"></a>Other information</p>
</td>
<td class="cellrowborder" valign="top" width="81.94%" headers="mcps1.2.3.1.2 "><a name="u25f28919a3b044c5af50f9f5f5616083"></a><a name="u25f28919a3b044c5af50f9f5f5616083"></a><ul id="u25f28919a3b044c5af50f9f5f5616083"><li>Package: QFN-32, 5 mm x 5 mm</li><li>Operating temperature: –40&deg;C to +85&deg;C</li></ul>
</td>
</tr>
</tbody>
</table>
## Key Features<a name="section1317173016507"></a>
OpenHarmony provides a series of available capabilities based on the Hi3861 platform. The following table describes the available key components.
**Table 2** Key components
<a name="table1659013482514"></a>
<table><thead align="left"><tr id="row1368918486512"><th class="cellrowborder" valign="top" width="22.63%" id="mcps1.2.3.1.1"><p id="p668914812516"><a name="p668914812516"></a><a name="p668914812516"></a>Component</p>
</th>
<th class="cellrowborder" valign="top" width="77.37%" id="mcps1.2.3.1.2"><p id="p9689154855115"><a name="p9689154855115"></a><a name="p9689154855115"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row868910487517"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p13689248165114"><a name="p13689248165114"></a><a name="p13689248165114"></a>wlan</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p11689144816511"><a name="p11689144816511"></a><a name="p11689144816511"></a>Provides WLAN service, such as connecting to or disconnecting from a station or hotspot, and querying the state of a station or hotspot.</p>
</td>
</tr>
<tr id="row568964819514"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p5689548175113"><a name="p5689548175113"></a><a name="p5689548175113"></a>iot controller</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p176893480517"><a name="p176893480517"></a><a name="p176893480517"></a>Provides the capability of operating peripherals, including the I2C, I2S, ADC, UART, SPI, SDIO, GPIO, PWM and FLASH.</p>
</td>
</tr>
<tr id="row143420119366"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p1737117331480"><a name="p1737117331480"></a><a name="p1737117331480"></a>soft bus</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p1037123314485"><a name="p1037123314485"></a><a name="p1037123314485"></a>Provides the capabilities of device discovery and data transmission in the distributed network.</p>
</td>
</tr>
<tr id="row1383559163617"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p2379233113914"><a name="p2379233113914"></a><a name="p2379233113914"></a>hichainsdk</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p5809349205012"><a name="p5809349205012"></a><a name="p5809349205012"></a>Provides the capability of securely transferring data between devices when they are interconnected.</p>
</td>
</tr>
<tr id="row54428163612"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p3775133619587"><a name="p3775133619587"></a><a name="p3775133619587"></a>huks</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p11304151710555"><a name="p11304151710555"></a><a name="p11304151710555"></a>Provides capabilities of key management, encryption, and decryption.</p>
</td>
</tr>
<tr id="row12690548135110"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p176901648115111"><a name="p176901648115111"></a><a name="p176901648115111"></a>system ability manager</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p1181353173111"><a name="p1181353173111"></a><a name="p1181353173111"></a>Provides a unified <span id="text10778141516322"><a name="text10778141516322"></a><a name="text10778141516322"></a>OpenHarmony</span> service development framework based on the service-oriented architecture.</p>
</td>
</tr>
<tr id="row1657310121587"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p730664220114"><a name="p730664220114"></a><a name="p730664220114"></a>bootstrap</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p39689262310"><a name="p39689262310"></a><a name="p39689262310"></a>Provides the entry identifier for starting a system service. When the system service management is started, the function identified by <strong id="b1954132834115"><a name="b1954132834115"></a><a name="b1954132834115"></a>bootstrap</strong> is called to start a system service.</p>
</td>
</tr>
<tr id="row15763812165616"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p17171118128"><a name="p17171118128"></a><a name="p17171118128"></a>syspara</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p12763912125617"><a name="p12763912125617"></a><a name="p12763912125617"></a>Provides capabilities of obtaining and setting system attributes.</p>
</td>
</tr>
<tr id="row121911343566"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p1097517270361"><a name="p1097517270361"></a><a name="p1097517270361"></a>utils</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p6848159569"><a name="p6848159569"></a><a name="p6848159569"></a>Provides basic and public capabilities, such as file operations and key-value (KV) storage management.</p>
</td>
</tr>
<tr id="row144219192579"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p8333104843714"><a name="p8333104843714"></a><a name="p8333104843714"></a>DFX</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p65111025155711"><a name="p65111025155711"></a><a name="p65111025155711"></a>Provides the DFX capabilities, such as logging and printing.</p>
</td>
</tr>
<tr id="row16159522125710"><td class="cellrowborder" valign="top" width="22.63%" headers="mcps1.2.3.1.1 "><p id="p18835202765718"><a name="p18835202765718"></a><a name="p18835202765718"></a>XTS</p>
</td>
<td class="cellrowborder" valign="top" width="77.37%" headers="mcps1.2.3.1.2 "><p id="p3835192795717"><a name="p3835192795717"></a><a name="p3835192795717"></a>Provides a set of <span id="text1482414523409"><a name="text1482414523409"></a><a name="text1482414523409"></a>OpenHarmony</span> certification test suites.</p>
</td>
</tr>
</tbody>
</table>
# 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.|
# Overview<a name="EN-US_TOPIC_0000001128311060"></a>
# Mini and Small System Overview
The mini and small OpenHarmony systems are suitable for IoT devices with limited memory. This document describes the system development with three typical development boards: Hi3861 WLAN module, Hi3516D V300, and Hi3518E V300.
With this document, you will quickly get familiar with environment setup, build, burning, debugging, and simple app and driver development for mini and small systems.
## 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-lite-ide-directory.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-board-introduction.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)
- [Environment Preparation](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-application-framework.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-hi3816-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-application-framework.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)
- [Getting Started with Mini and Small Systems (IDE Mode)](quickstart-lite-ide-directory.md)
- [Reference](quickstart-lite-reference.md)
# Reference
## Using the build.sh Script to Build Source Code
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, **Hi3516D V300** 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 [Building a Standard System](../subsystems/subsys-build-standard-large.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
```
# 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
└── src
└── helloworld.c
```
## How to Develop
Perform the steps below in the source code directory:
1. Create a directory and the program source 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 **OHOS** to **World**. You can use either C or C++ to develop a program.
```
#include <stdio.h>
int main(int argc, char **argv)
{
printf("\n\n");
printf("\n\t\tHello OHOS!\n");
printf("\n\n\n");
return 0;
}
```
2. Create a build file.
Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows:
```
import("//build/lite/config/component/lite_component.gni")
lite_component("hello-OHOS") {
features = [ ":helloworld" ]
}
executable("helloworld") {
output_name = "helloworld"
sources = [ "src/helloworld.c" ]
}
```
3. Add a component.
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: 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.)
```
{
"components": [
{
"component": "camera_sample_communication",
"description": "Communication related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/communication"
],
"targets": [
"//applications/sample/camera/communication:sample"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##start##
{
"component": "hello_world_app",
"description": "hello world samples.",
"optional": "true",
"dirs": [
"applications/sample/hello"
],
"targets": [
"//applications/sample/hello:hello-OHOS"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##end##
{
"component": "camera_sample_app",
"description": "Camera related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/launcher",
"applications/sample/camera/cameraApp",
"applications/sample/camera/setting",
"applications/sample/camera/gallery",
"applications/sample/camera/media"
],
```
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.)
```
{
"subsystem": "applications",
"components": [
{ "component": "camera_sample_app", "features":[] },
{ "component": "camera_sample_ai", "features":[] },
##start##
{ "component": "hello_world_app", "features":[] },
##end##
{ "component": "camera_screensaver_app", "features":[] }
]
},
```
# 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-lite-reference.md).
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 **ipcamera_hispark_taurus** under **hisilicon** 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_0000001271594749](figures/en-us_image_0000001271594749.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**
> Paths to burning-related files:
>
> - Build result and log files: **out/hispark_taurus/ipcamera_hispark_taurus**
>
> - U-Boot file: **device/board/hisilicon/hispark_taurus/uboot/out/boot/u-boot-hi3516dv300.bin**
# Burning
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.
### Importing Source Code
After the building is complete, ensure that you can [remotely access the Ubuntu environment from Windows](../quick-start/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_0000001171426014](figures/en-us_image_0000001171426014.png)
2. Select the target directory (in the Ubuntu environment) 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. Otherwise, the building may fail.
![en-us_image_0000001271791385](figures/en-us_image_0000001271791385.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**. Select **ipcamera_hispark_taurus**.
![en-us_image_0000001227711014](figures/en-us_image_0000001227711014.png)
6. 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 serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/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 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.
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 a Hello OHOS Program<a name="EN-US_TOPIC_0000001174270695"></a>
This section describes how to create, compile, burn, and run the first program, and finally print **Hello OHOS!** on the develop board.
## Creating a Program<a name="section204672145202"></a>
1. Create a directory and the program source code.
Create the **applications/sample/camera/apps/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 **OHOS** to **World**. You can use either C or C++ to develop a program.
```
#include <stdio.h>
int main(int argc, char **argv)
{
printf("\n************************************************\n");
printf("\n\t\tHello OHOS!\n");
printf("\n************************************************\n\n");
return 0;
}
```
2. Create a build file.
Create the **applications/sample/camera/apps/BUILD.gn** file. The file content is as follows:
```
import("//build/lite/config/component/lite_component.gni")
lite_component("hello-OHOS") {
features = [ ":helloworld" ]
}
executable("helloworld") {
output_name = "helloworld"
sources = [ "src/helloworld.c" ]
include_dirs = []
defines = []
cflags_c = []
ldflags = []
}
```
3. Add a new component.
Add the configuration of the **hello\_world\_app** component to the **build/lite/components/applications.json** file. The sample code below shows some configurations defined in the **applications.json** file, and the code between **\#\#start\#\#** and **\#\#end\#\#** is the new configuration \(Delete the rows where **\#\#start\#\#** and **\#\#end\#\#** are located after the configurations are added.\)
```
{
"components": [
{
"component": "camera_sample_communication",
"description": "Communication related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/communication"
],
"targets": [
"//applications/sample/camera/communication:sample"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##start##
{
"component": "hello_world_app",
"description": "Communication related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/apps"
],
"targets": [
"//applications/sample/camera/apps:hello-OHOS"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##end##
{
"component": "camera_sample_app",
"description": "Camera related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/launcher",
"applications/sample/camera/cameraApp",
"applications/sample/camera/setting",
"applications/sample/camera/gallery",
"applications/sample/camera/media"
],
```
4. Modify the board configuration file.
Add the **hello\_world\_app** component to the **vendor/hisilicon/hispark\_taurus/config.json** file. The sample code below shows the configurations of the **applications** subsystem, and the code between **\#\#start\#\#** and **\#\#end\#\#** is the new configuration \(Delete the rows where **\#\#start\#\#** and **\#\#end\#\#** are located after the configurations are added.\)
```
{
"subsystem": "applications",
"components": [
{ "component": "camera_sample_app", "features":[] },
{ "component": "camera_sample_ai", "features":[] },
##start##
{ "component": "hello_world_app", "features":[] },
##end##
{ "component": "camera_screensaver_app", "features":[] }
]
},
```
## Building<a name="section1077671315253"></a>
If the Linux environment is installed using Docker, perform the building by referring to [Using Docker to Prepare the Build Environment](../get-code/gettools-acquire.md#section107932281315). If the Linux environment is installed using a software package, go to the root directory of the source code and run the following commands for source code compilation:
```
hb set (Set the building path.)
. (Select the current path.)
Select ipcamera_hispark_taurus@hisilicon and press Enter.
hb build -f (Start building.)
```
**Figure 1** Hi3516 settings<a name="fig1458988766"></a>
![](figures/hi3516-settings.png "hi3516-settings")
The result files are generated in the **out/hispark\_taurus/ipcamera\_hispark\_taurus** directory.
>![](../public_sys-resources/icon-notice.gif) **NOTICE:**
>The U-Boot file of the Hi3516D V300 development board can be obtained from the following path: device/hisilicon/hispark\_taurus/sdk\_liteos/uboot/out/boot/u-boot-hi3516dv300.bin
## Burning<a name="section1347011412201"></a>
The Hi3516 development board allows you to burn flash memory over the USB port, serial port, or network port. The following uses the network port burning as an example.
### Burning Through the Network Port<a name="section1935410617363"></a>
To burn Hi3516D V300 through the network port in the Windows or Linux environment:
1. Connect the PC and the target development board through the serial port, network port, and power port. For details, see [Introduction to the Hi3516 Development Board](https://device.harmonyos.com/en/docs/start/introduce/oem_minitinier_des_3516-0000001152041033).
2. <a name="en-us_topic_0000001056443961_li142386399535"></a>Open Device Manager, then check and record the serial port number corresponding to the development board.
>![](../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/ide/user-guides/hi3516_hi3518-drivers-0000001050743695).
![](figures/hi3516-record-the-serial-port-number.png)
3. Open DevEco Device Tool, choose **QUICK ACCESS** \> **DevEco Home** \> **Projects**, and then click **Settings**.
# Running
![](figures/hi3516-deveco-device-tool-setting.png)
4. On the **Partition Configuration** tab page, modify the settings. In general cases, you can leave the fields at their default settings.
5. On the **hi3516dv300** tab page, configure the burning options.
## Starting the System
- **upload\_port**: Select the serial port number obtained in step [2](#en-us_topic_0000001056443961_li142386399535).
- **upload\_protocol**: Select the burning protocol **hiburn-net**.
- **upload\_partitions**: Select the file to be burnt. By default, the **fastboot**, **kernel**, **rootfs**, and **userfs** files are burnt at the same time.
![](figures/hi3516-upload-options.png)
6. <a name="en-us_topic_0000001056443961_li1558813168234"></a>Check and set the IP address of the network adapter connected to the development board. For details, see [Setting the IP Address of the Network Port for Burning to Hi3516](https://device.harmonyos.com/en/docs/ide/user-guides/set_ipaddress-0000001141825075).
7. Set the IP address of the network port for burning:
- **upload\_net\_server\_ip**: Select the IP address set in step [6](#en-us_topic_0000001056443961_li1558813168234), such as 192.168.1.2.
- **upload\_net\_client\_mask**: Set the subnet mask of the development board, such as 255.255.255.0. Once the **upload\_net\_server\_ip** field is set, this field will be automatically populated.
- **upload\_net\_client\_gw**: Set the gateway of the development board, such as 192.168.1.1. Once the **upload\_net\_server\_ip** field is set, this field will be automatically populated.
- **upload\_net\_client\_ip**: Set the IP address of the development board, such as 192.168.1.3. Once the **upload\_net\_server\_ip** field is set, this field will be automatically populated.
![](figures/ip-address-information.png)
8. When you finish modifying, click **Save** in the upper right corner.
9. Open the project file and go to ![](figures/hi3516-deveco-device-tool-logo.png) \> **PROJECT TASKS** \> **hi3516dv300** \> **Upload** to start burning.
![](figures/hi3516-upload-start-burning.png)
10. When the following message is displayed, power off the development board and then power it on.
![](figures/hi3516-restart-the-development-board.png)
After burning is completed, you need to configure the bootloader to run the OpenHarmony system.
11. If the following message is displayed, it indicates that the burning is successful.
1. In the Hi3516D V300 task, click **Configure bootloader (Boot OS)** to configure the bootloader.
![](figures/hi3516-burning-succeeded-net.png)
> ![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.
12. When the burning is successful, perform the operations in Running an Image to start the system.
![en-us_image_0000001209906547](figures/en-us_image_0000001209906547.png)
### Running an Image<a name="section24721014162010"></a>
2. When the message shown below is displayed, restart the development board. If "SUCCESS" is displayed, it indicates that the configuration is successful.
After burning is completed, you need to configure the bootloader to run the OpenHarmony system.
![en-us_image_0000001210385161](figures/en-us_image_0000001210385161.png)
1. In the Hi3516D V300 task, click **Configure bootloader \(Boot OS\)** to configure the bootloader.
3. Click **Monitor** on the taskbar to start the serial port tool.
>![](../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_0000001164506870](figures/en-us_image_0000001164506870.png)
![](figures/bootloader.png)
4. When the command output is displayed, press **Enter** until **OHOS #** is displayed, indicating that the system is started successfully.
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_0000001198626874](figures/en-us_image_0000001198626874.png)
![](figures/reset_success.png)
3. Click **Monitor** on the taskbar to start the serial port tool.
## Running a Hello World Program
![](figures/monitor.png)
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:
4. Follow the onscreen instructions until **OHOS \#** is displayed, indicating that the system is started successfully.
1. Go to the **bin** directory on the startup page.
```
cd bin
```
![](figures/reboot_success.png)
2. Run the following command to run the **helloworld** program:
```
./helloworld
```
If the message "Hello World!" is displayed, the program runs successfully.
## Running a Program<a name="section5276734182615"></a>
![en-us_image_0000001271234769](figures/en-us_image_0000001271234769.png)
In the root directory, run the **./bin/helloworld** command to operate the demo program. The compilation result is shown in the following example.
**Figure 2** Successful system startup and program execution<a name="fig149821431194515"></a>
![](figures/successful-system-startup-and-program-execution.png "successful-system-startup-and-program-execution")
## Next
Congratulations! You have finished all steps! Proceed to [develop a sample camera with a screen](https://gitee.com/openharmony/docs/blob/master/en/device-dev/guide/device-camera.md) to better familiarize yourself with OpenHarmony development.
# Setting Up the Environment<a name="EN-US_TOPIC_0000001174270689"></a>
# Setting Up the Hi3516 Development Board Environment
## Environment Requirements<a name="section179175261196"></a>
### Hardware<a name="section5840424125014"></a>
## Environment Requirements
- Hi3516D V300 IoT camera development board
- USB-to-serial cable and network cable \(The Windows workstation is connected to the Hi3516D V300 development board through the USB-to-serial cable and network cable.\)
The following figure shows the hardware connections.
### Hardware
**Figure 1** Hi3516 hardware connections<a name="fig86246141414"></a>
![](figures/hi3516-hardware-connections.png "hi3516-hardware-connections")
- Hi3516D V300 IoT camera development board
### Software<a name="section965634210501"></a>
- 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.)
>![](../public_sys-resources/icon-notice.gif) **NOTICE:**
>This section describes how to use an installation package to set up the compilation and development environment. If you are going to use Docker to set up the environment, skip this section and [Installing Linux Build Tools](#section182916865219).
The following table describes the tools required for setting up the general environment for a Linux server of the Hi3516 development board and how to obtain these tools.
### Software
**Table 1** Development tools and obtaining methods
The following table describes the tools required for setting up the general environment for a Linux server of the Hi3516D V300 development board.
<a name="table6299192712513"></a>
<table><thead align="left"><tr id="row122993276512"><th class="cellrowborder" valign="top" width="13.081308130813083%" id="mcps1.2.4.1.1"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>Development Tool</p>
</th>
<th class="cellrowborder" valign="top" width="19.921992199219922%" id="mcps1.2.4.1.2"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>Description</p>
</th>
<th class="cellrowborder" valign="top" width="66.996699669967%" id="mcps1.2.4.1.3"><p id="p12997271757"><a name="p12997271757"></a><a name="p12997271757"></a>How to Obtain</p>
</th>
</tr>
</thead>
<tbody><tr id="row167343191518"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p467443191517"><a name="p467443191517"></a><a name="p467443191517"></a>bash</p>
</td>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p0674153114151"><a name="p0674153114151"></a><a name="p0674153114151"></a>Processes CLI commands.</p>
</td>
<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p116746312151"><a name="p116746312151"></a><a name="p116746312151"></a>System configuration</p>
</td>
</tr>
<tr id="row14885193315201"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p137174662119"><a name="p137174662119"></a><a name="p137174662119"></a>Basic software package for compilation and building (required only for Ubuntu 20+)</p>
</td>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p258814561424"><a name="p258814561424"></a><a name="p258814561424"></a>Provides a basic software package for compilation and building.</p>
</td>
<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p1749611716181"><a name="p1749611716181"></a><a name="p1749611716181"></a>Internet</p>
</td>
</tr>
<tr id="row52253812238"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p28007392236"><a name="p28007392236"></a><a name="p28007392236"></a>dosfstools, mtools, and mtd-utils</p>
</td>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p98008390232"><a name="p98008390232"></a><a name="p98008390232"></a>Pack files.</p>
</td>
<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p280018394233"><a name="p280018394233"></a><a name="p280018394233"></a>apt-get install</p>
</td>
</tr>
<tr id="row29204072315"><td class="cellrowborder" valign="top" width="13.081308130813083%" headers="mcps1.2.4.1.1 "><p id="p5921190162318"><a name="p5921190162318"></a><a name="p5921190162318"></a>Java virtual machine (JVM)</p>
</td>
<td class="cellrowborder" valign="top" width="19.921992199219922%" headers="mcps1.2.4.1.2 "><p id="p17921110152311"><a name="p17921110152311"></a><a name="p17921110152311"></a>Compiles, debugs, and runs Java programs.</p>
</td>
<td class="cellrowborder" valign="top" width="66.996699669967%" headers="mcps1.2.4.1.3 "><p id="p16921805237"><a name="p16921805237"></a><a name="p16921805237"></a>apt-get install</p>
</td>
</tr>
</tbody>
</table>
**Table 1** Linux server development tools and functions
## Installing Linux Build Tools<a name="section182916865219"></a>
| Development Tool| Description|
| -------- | -------- |
| dosfstools, mtools, and mtd-utils| Pack files.|
| Java virtual machine (JVM)| Compiles, debugs, and runs Java programs.|
>![](../public_sys-resources/icon-notice.gif) **NOTICE:**
>- If you acquire the source code using an HPM component or HPM CLI tool, you do not need to install **hc-gen**.
>- \(Recommended\) If you obtain the source code via the mirror site or code repository, install **hc-gen**. When installing the compilation tool, ensure that its environment variable path is unique.
### Changing Linux Shell to Bash<a name="section1715027152617"></a>
Check whether bash is used as the shell.
```
ls -l /bin/sh
```
If **/bin/sh -\> bash** is not displayed, do as follows to change shell to bash.
**Method 1:** Run the following command on the device and then click **No**.
```
sudo dpkg-reconfigure dash
```
**Method 2:** Run the first command to delete **sh** and then run the second command to create a new soft link.
```
sudo rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh
```
### Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)<a name="section45512412251"></a>
Install the software.
```
sudo apt-get install build-essential gcc g++ make zlib* libffi-dev
```
### Installing File Packing Tools and JVM<a name="section16199102083717"></a>
1. Start a Linux server.
2. Install the dosfstools, mtools, mtd-utils, Java Runtime Environment \(JRE\), and Java SDK.
```
sudo apt-get install dosfstools mtools mtd-utils default-jre default-jdk
```
## 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).
# Hi3516<a name="EN-US_TOPIC_0000001128470852"></a>
# Hi3516 Development Board
- **[Setting Up the Environment](quickstart-lite-steps-hi3516-setting.md)**
- **[Running a Hello OHOS Program](quickstart-lite-steps-hi3516-running.md)**
- **[Developing a Driver](quickstart-lite-steps-hi3516-program.md)**
- **[Setting Up the Hi3516 Development Board Environment](quickstart-lite-steps-hi3516-setting.md)**
- **[FAQs](quickstart-lite-steps-hi3516-faqs.md)**
- **[Writing a Hello World Program](quickstart-lite-steps-hi3516-application-framework.md)**
- **[Building](quickstart-lite-steps-hi3516-building.md)**
- **[Burning](quickstart-lite-steps-hi3516-burn.md)**
- **[Running](quickstart-lite-steps-hi3516-running.md)**
# 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](https://gitee.com/openharmony/docs/blob/master/en/device-dev/guide/device-wlan.md) to better familiarize yourself with OpenHarmony development.
# Writing a Hello World Program
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.
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.
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:
```
.
└── applications
└── sample
└── wifi-iot
└── app
└── my_first_app
│── hello_world.c
└── BUILD.gn
```
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.)
```
#include <stdio.h>
#include "ohos_init.h"
#include "ohos_types.h"
void HelloWorld(void)
{
printf("[DEMO] Hello world.\n");
}
SYS_RUN(HelloWorld);
```
3. Compile the **BUILD.gn** file for building services into a static library.
Create the **BUILD.gn** file in **./applications/sample/wifi-iot/app/my_first_app** and configure the file as follows:
The **BUILD.gn** file consists of three parts, including target, source file, and header file path. You need to fill in all of these parts.
```
static_library("myapp") {
sources = [
"hello_world.c"
]
include_dirs = [
"//utils/native/lite/include"
]
}
```
- Specify the compilation result named **libmyapp.a** in **static_library**. You can fill in this part based on your need.
- Specify the .c file on which a file depends and its path in **sources**. The path that contains **//** represents an absolute path (the code root path). The path that does not contain **//** is a relative path.
- Specify the path of .h file on which **sources** depends in **include_dirs**.
4. Add a component.
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: 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.)
```
{
"components": [
{
"component": "camera_sample_communication",
"description": "Communication related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/communication"
],
"targets": [
"//applications/sample/camera/communication:sample"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##start##
{
"component": "hello_world_app",
"description": "hello world samples.",
"optional": "true",
"dirs": [
"applications/sample/wifi-iot/app/my_first_app"
],
"targets": [
"//applications/sample/wifi-iot/app/my_first_app:myapp"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_m" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##end##
{
"component": "camera_sample_app",
"description": "Camera related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/launcher",
"applications/sample/camera/cameraApp",
"applications/sample/camera/setting",
"applications/sample/camera/gallery",
"applications/sample/camera/media"
],
```
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.)
```
{
"subsystem": "applications",
"components": [
##start##
{ "component": "hello_world_app", "features":[] },
##end##
{ "component": "wifi_iot_sample_app", "features":[] }
]
},
```
# 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-lite-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 **wifiiot_hispark_pegasus** under **hisilicon** 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** Hi3861 build settings
![en-us_image_0000001226634716](figures/en-us_image_0000001226634716.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_pegasus/wifiiot_hispark_pegasus**.
# Burning
Burn the source code to Hi3861 through the serial port in Windows.
### Importing Source Code
After the building is complete, ensure that you can [remotely access the Ubuntu environment from Windows](../quick-start/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_0000001171426014](figures/en-us_image_0000001171426014.png)
2. Select the target directory (in the Ubuntu environment) 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. Otherwise, the building may fail.
![en-us_image_0000001227549226](figures/en-us_image_0000001227549226.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**. Select **wifiiot_hispark_pegasus**.
![en-us_image_0000001272109325](figures/en-us_image_0000001272109325.png)
6. 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 serial port and USB port. For details, see [Introduction to the Hi3861 V100 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-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_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.
3. 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)
> ![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 Hi3861 V100](https://device.harmonyos.com/en/docs/documentation/guide/hi3861-drivers-0000001058153433).
4. Choose **QUICK ACCESS** > **DevEco Home** > **Projects**, and then click **Settings**.
![en-us_image_0000001198943768](figures/en-us_image_0000001198943768.png)
5. 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)
6. Check the preset information of the files to be burnt and modify them when necessary.
On the **hi3861_app** tab page, select **partition_bin** from **New Option**, and set the path of the file to be burnt.
![en-us_image_0000001260919759](figures/en-us_image_0000001260919759.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 button on the development board to restart it.
![en-us_image_0000001198466090](figures/en-us_image_0000001198466090.png)
10. 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)
# 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. (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.
```
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_0000001271354733](figures/en-us_image_0000001271354733.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 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)
# Setting Up the Environment<a name="EN-US_TOPIC_0000001174270691"></a>
## Environment Requirements<a name="section466851916410"></a>
### Hardware<a name="section19202111020215"></a>
- Linux compile server
- Windows workstation \(host computer\)
- Hi3861 WLAN module
- USB Type-C cable used to connect the Windows workstation to Hi3861 WLAN module
The following figure shows the hardware connections.
**Figure 1** Hi3861 hardware connections<a name="fig285519359396"></a>
![](figures/hi3861-hardware-connections.png "hi3861-hardware-connections")
### Software<a name="section727451210318"></a>
>![](../public_sys-resources/icon-notice.gif) **NOTICE:**
>The following part describes how to install tools using installation packages. If you use Docker to set up the build environment, you only need to install the Windows workstation described in [Table 1](#table6299192712513).
The following table lists the tools required for the Hi3861 development board.
**Table 1** Required tools
<a name="table6299192712513"></a>
<table><thead align="left"><tr id="row122993276512"><th class="cellrowborder" valign="top" width="17.54%" id="mcps1.2.5.1.1"><p id="p162491657102110"><a name="p162491657102110"></a><a name="p162491657102110"></a>Platform</p>
</th>
<th class="cellrowborder" valign="top" width="23.59%" id="mcps1.2.5.1.2"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>Development Tool</p>
</th>
<th class="cellrowborder" valign="top" width="22.58%" id="mcps1.2.5.1.3"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>Description</p>
</th>
<th class="cellrowborder" valign="top" width="36.29%" id="mcps1.2.5.1.4"><p id="p12997271757"><a name="p12997271757"></a><a name="p12997271757"></a>How to Obtain</p>
</th>
</tr>
</thead>
<tbody><tr id="row935218593572"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p105554418586"><a name="p105554418586"></a><a name="p105554418586"></a>Linux server</p>
</td>
<td class="cellrowborder" valign="top" width="23.59%" headers="mcps1.2.5.1.2 "><p id="p45551740589"><a name="p45551740589"></a><a name="p45551740589"></a>Basic software package for compilation and building (required only for Ubuntu 20+)</p>
</td>
<td class="cellrowborder" valign="top" width="22.58%" headers="mcps1.2.5.1.3 "><p id="p655594115814"><a name="p655594115814"></a><a name="p655594115814"></a>Provides a basic software package for compilation and building.</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p165558415589"><a name="p165558415589"></a><a name="p165558415589"></a>Internet</p>
</td>
</tr>
<tr id="row1397335913612"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p3711468218"><a name="p3711468218"></a><a name="p3711468218"></a>Linux server</p>
</td>
<td class="cellrowborder" valign="top" width="23.59%" headers="mcps1.2.5.1.2 "><p id="p097355911620"><a name="p097355911620"></a><a name="p097355911620"></a>SCons 3.0.4+</p>
</td>
<td class="cellrowborder" valign="top" width="22.58%" headers="mcps1.2.5.1.3 "><p id="p1973195917619"><a name="p1973195917619"></a><a name="p1973195917619"></a>Executes script compilation.</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p1722663441514"><a name="p1722663441514"></a><a name="p1722663441514"></a>Internet</p>
</td>
</tr>
<tr id="row1968013216717"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p2681632977"><a name="p2681632977"></a><a name="p2681632977"></a>Linux server</p>
</td>
<td class="cellrowborder" valign="top" width="23.59%" headers="mcps1.2.5.1.2 "><p id="p1991501391312"><a name="p1991501391312"></a><a name="p1991501391312"></a>Python modules: setuptools, Kconfiglib, PyCryptodome, six, and ecdsa</p>
</td>
<td class="cellrowborder" valign="top" width="22.58%" headers="mcps1.2.5.1.3 "><p id="p968120325715"><a name="p968120325715"></a><a name="p968120325715"></a>Executes script compilation.</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p268116326711"><a name="p268116326711"></a><a name="p268116326711"></a>Internet</p>
</td>
</tr>
<tr id="row020914491313"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p20209749103116"><a name="p20209749103116"></a><a name="p20209749103116"></a>Linux server</p>
</td>
<td class="cellrowborder" valign="top" width="23.59%" headers="mcps1.2.5.1.2 "><p id="p7209104910317"><a name="p7209104910317"></a><a name="p7209104910317"></a>gcc riscv32</p>
</td>
<td class="cellrowborder" valign="top" width="22.58%" headers="mcps1.2.5.1.3 "><p id="p102093498311"><a name="p102093498311"></a><a name="p102093498311"></a>Executes script compilation.</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p321054953116"><a name="p321054953116"></a><a name="p321054953116"></a>Internet</p>
</td>
</tr>
<tr id="row1596703610215"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p071946112113"><a name="p071946112113"></a><a name="p071946112113"></a>Windows workstation</p>
</td>
<td class="cellrowborder" valign="top" width="23.59%" headers="mcps1.2.5.1.2 "><p id="p1044974291416"><a name="p1044974291416"></a><a name="p1044974291416"></a>CH341SER.EXE</p>
</td>
<td class="cellrowborder" valign="top" width="22.58%" headers="mcps1.2.5.1.3 "><p id="p94491342131413"><a name="p94491342131413"></a><a name="p94491342131413"></a>USB-to-Serial adapter driver</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p6449184214148"><a name="p6449184214148"></a><a name="p6449184214148"></a><a href="http://www.wch-ic.com/search?t=downloads&amp;q=ch340g" target="_blank" rel="noopener noreferrer">http://www.wch-ic.com/search?t=downloads&amp;q=ch340g</a></p>
</td>
</tr>
</tbody>
</table>
## Installing Linux Build Tools<a name="section497484245614"></a>
>![](../public_sys-resources/icon-notice.gif) **NOTICE:**
>- If you acquire the source code using an HPM component or HPM CLI tool, you do not need to install **gcc\_riscv32**.
>- \(Recommended\) If you obtain the source code via the mirror site or code repository, install **gcc\_riscv32**. When installing the compilation tool, ensure that its environment variable path is unique.
### Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)<a name="section45512412251"></a>
Install the software.
```
sudo apt-get install build-essential gcc g++ make zlib* libffi-dev
```
### Installing Scons<a name="section7438245172514"></a>
1. Start a Linux server.
2. Install the SCons installation package.
# Setting Up the Hi3861 Development Board Environment
```
python3 -m pip install scons
```
3. Check whether the installation is successful.
## Environment Requirements
```
scons -v
```
**Figure 2** Successful installation \(SCons version requirement: 3.0.4 or later\)<a name="fig151441613316"></a>
![](figures/successful-installation-(scons-version-requirement-3-0-4-or-later).png "successful-installation-(scons-version-requirement-3-0-4-or-later)")
### Hardware
- Linux workstation
### Installing Python Modules<a name="section88701892341"></a>
- Hi3861 WLAN module
1. Install setuptools.
- USB Type-C cable used to connect the Linux workstation to Hi3861 development board
```
pip3 install setuptools
```
2. Install the GUI menuconfig tool \(Kconfiglib\). You are advised to install Kconfiglib 13.2.0 or later.
- **Command line:**
### Software
```
sudo pip3 install kconfiglib
```
- **Installation package:**
1. Download the **.whl** file \(for example, **kconfiglib-13.2.0-py2.py3-none-any.whl**\).
The following table lists the tools required by the Hi3861 WLAN module.
Download path: [https://pypi.org/project/kconfiglib\#files](https://pypi.org/project/kconfiglib#files)
1. Install the **.whl** file.
**Table 1 Tools required by the Hi3861 WLAN module
```
sudo pip3 install kconfiglib-13.2.0-py2.py3-none-any.whl
```
| Development Tool| Description|
| -------- | -------- |
| SCons3.0.4+ | Executes script compilation.|
| Python modules: setuptools, Kconfiglib, PyCryptodome, six, and ecdsa| Executes script compilation.|
| gcc&nbsp;riscv32 | Executes script compilation.|
3. Install **PyCryptodome** using either of the following methods:
## Installing the Compilation Tools
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.
Perform the following steps to install the necessary tools:
- **Command line:**
```
sudo pip3 install pycryptodome
```
### Installing Scons
- **Installation package:**
1. Download the **.whl** file \(for example, **pycryptodome-3.9.9-cp38-cp38-manylinux1\_x86\_64.whl**\).
1. Run the following command to install the SCons installation package:
```
python3 -m pip install scons
```
Download path: [https://pypi.org/project/pycryptodome/\#files](https://pypi.org/project/pycryptodome/#files)
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.
```
scons -v
```
1. Install the **.whl** file.
**Figure 1** Successful SCons installation (the version must be 3.0.4 or later)
```
sudo pip3 install pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl
```
![en-us_image_0000001271234749](figures/en-us_image_0000001271234749.png)
4. Install **six** using either of the following methods:
- **Command line:**
### Installing Python Modules
```
sudo pip3 install six --upgrade --ignore-installed six
```
1. Install setuptools.
```
pip3 install setuptools
```
- **Installation package:**
1. Download the **.whl** file, for example, **six-1.12.0-py2.py3-none-any.whl**.
2. Install the GUI menuconfig tool (Kconfiglib). You are advised to install Kconfiglib 13.2.0 or later.
Download path: [https://pypi.org/project/six/\#files](https://pypi.org/project/six/#files)
- Command line:
```
sudo pip3 install kconfiglib
```
1. Install the **.whl** file.
- Installation package:
```
sudo pip3 install six-1.12.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)
5. Install **ecdsa** using either of the following methods:
- **Command line:**
2. Install the .whl file.
```
sudo pip3 install kconfiglib-13.2.0-py2.py3-none-any.whl
```
```
sudo pip3 install ecdsa
```
3. Install PyCryptodome using either of the following methods:
- **Installation package:**
1. Download the **.whl** file, for example, **ecdsa-0.14.1-py2.py3-none-any.whl**.
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.
Download path: [https://pypi.org/project/ecdsa/\#files](https://pypi.org/project/ecdsa/#files)
- Command line:
```
sudo pip3 install pycryptodome
```
- Installation package:
1. Install the **.whl** file.
1. Download the .whl file , for example, **pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl**.
```
sudo pip3 install ecdsa-0.14.1-py2.py3-none-any.whl
```
Download path: [https://pypi.org/project/pycryptodome/#files](https://pypi.org/project/pycryptodome/#files)
2. Install the .whl file.
```
sudo pip3 install pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl
```
4. Install **six** using either of the following methods:
- Command line:
```
sudo pip3 install six --upgrade --ignore-installed six
```
### Installing gcc\_riscv32 \(Compiler Toolchain for WLAN Module\)<a name="section34435451256"></a>
- Installation package:
>![](../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.
>- Steps 2 to 15 of the following procedure are used to build the **gcc\_riscv32** image. You can and skip these steps and directly [download the image](https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz).
1. Download the .whl file, for example, **six-1.12.0-py2.py3-none-any.whl**.
1. Start a Linux server.
2. Install the **GCC**, **G++**, **Bison**, **Flex**, **Makeinfo** tools to ensure that the toolchain can be correctly compiled.
Download path: [https://pypi.org/project/six/#files](https://pypi.org/project/six/#files)
```
sudo apt-get install gcc g++ flex bison texinfo
```
2. Install the .whl file.
```
sudo pip3 install six-1.12.0-py2.py3-none-any.whl
```
3. Download the RISC-V GNU toolchain.
5. Install **ecdsa** using either of the following methods:
```
git clone --recursive https://gitee.com/mirrors/riscv-gnu-toolchain.git
```
- Command line:
```
sudo pip3 install ecdsa
```
4. Open the **riscv-gnu-toolchain** folder and delete empty folders to prevent conflicts during the download of **Newlib**, **Binutils**, and **GCC**.
- Installation package:
```
cd riscv-gnu-toolchain && rm -rf riscv-newlib && rm -rf riscv-binutils && rm -rf riscv-gcc
```
1. Download the .whl file, for example, **ecdsa-0.14.1-py2.py3-none-any.whl**.
5. Download RISC-V Newlib 3.0.0.
Download path: [https://pypi.org/project/ecdsa/#files](https://pypi.org/project/ecdsa/#files)
```
git clone -b riscv-newlib-3.0.0 https://github.com/riscv/riscv-newlib.git
```
2. Install the .whl file.
```
sudo pip3 install ecdsa-0.14.1-py2.py3-none-any.whl
```
6. Download RISC-V Binutils 2.31.1.
```
git clone -b riscv-binutils-2.31.1 https://github.com/riscv/riscv-binutils-gdb.git
```
### Installing gcc_riscv32 (Compilation Toolchain for the WLAN Module)
7. Download RISC-V GCC 7.3.0.
> ![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.
>
> - 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.
```
git clone -b riscv-gcc-7.3.0 https://github.com/riscv/riscv-gcc
```
1. Start a Linux server.
8. Add the RISC-V GCC 7.3.0 patch.
2. Download the **RISC-V GNU** toolchain.
```
git clone --recursive https://gitee.com/mirrors/riscv-gnu-toolchain.git
```
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.
3. Open the **riscv-gnu-toolchain** folder and delete empty folders to prevent conflicts during the download of **Newlib**, **Binutils**, and **GCC**.
```
cd riscv-gnu-toolchain && rm -rf riscv-newlib && rm -rf riscv-binutils && rm -rf riscv-gcc
```
9. Download, decompress, and install [GMP 6.1.2](https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2).
4. Download RISC-V Newlib 3.0.0.
```
git clone -b riscv-newlib-3.0.0 https://github.com/riscv/riscv-newlib.git
```
```
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
```
5. Download RISC-V Binutils 2.31.1.
```
git clone -b riscv-binutils-2.31.1 https://github.com/riscv/riscv-binutils-gdb.git
```
10. Download, decompress, and install [mpfr-4.0.2](https://www.mpfr.org/mpfr-4.0.2/mpfr-4.0.2.tar.gz).
6. Download RISC-V GCC 7.3.0.
```
git clone -b riscv-gcc-7.3.0 https://github.com/riscv/riscv-gcc
```
```
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
```
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.
8. Download, decompress, and install [GMP 6.1.2](https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2).
```
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
```
11. Download, decompress, and install [mpc-1.1.0](https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.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
```
10. Download, decompress, and install [mpc-1.1.0](https://ftp.gnu.org/gnu/mpc/mpc-1.1.0.tar.gz).
```
tar -xvf mpc-1.1.0.tar.gz && mkdir build_mpc && cd build_mpc && ../mpc-1.1.0/configure --prefix=/usr/local/mpc-1.1.0 --with-gmp=/usr/local/gmp-6.1.2 --with-mpfr=/usr/local/mpfr-4.0.2 --disable-shared && make && make install
```
12. Open the **riscv-gnu-toolchain** folder and create a directory for toolchain output.
11. Open the **riscv-gnu-toolchain** folder and create a directory for toolchain output.
```
cd /opt && mkdir gcc_riscv32
```
13. Compile **binutils**.
12. Compile 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 ..
```
14. Build **Newlib**.
13. Build Newlib.
```
mkdir build_newlib && cd build_newlib && ../riscv-newlib/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 --libdir=/opt/gcc_riscv32 --includedir=/opt/gcc_riscv32 && make -j16 && make install && cd ..
```
15. Build **GCC**.
14. Build GCC.
```
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
```
16. Set an environment variable.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you use the compiled **riscv32 gcc** package, perform the following steps to set environment variables:
>1. Decompress the package to the root directory.
> ```
> tar -xvf gcc_riscv32-linux-7.3.0.tar.gz -C ~
> ```
>2. Set an environment variable.
> ```
> vim ~/.bashrc
> ```
>3. Copy the following command to the last line of the **.bashrc** file, save the file, and exit.
> ```
> export PATH=~/gcc_riscv32/bin:$PATH
> ```
15. Set the environment variable.
> ![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:
>
> ```
> tar -xvf gcc_riscv32-linux-7.3.0.tar.gz -C ~
> ```
```
vim ~/.bashrc
```
Copy the following command to the last line of the **.bashrc** file, save the file, and exit.
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
export PATH=~/gcc_riscv32/bin:$PATH
```
17. Validate the environment variable.
16. Validate the environment variable.
```
source ~/.bashrc
```
18. Check whether the compiler is successfully installed. If the compiler version number is correctly displayed, the installation is successful.
17. Check whether the compiler is successfully installed. If the compiler version number is correctly displayed, the installation is successful.
```
riscv32-unknown-elf-gcc -v
```
## Installing the USB-to-Serial Driver<a name="section1027732411513"></a>
Perform the following operations on the Windows station.
1. Download the USB-to-serial driver: [CH341SER USB-to-serial driver](http://www.hihope.org/en/download/download.aspx).
2. Install the driver.
3. After the driver is installed, remove and then insert the USB cable. The serial port entry should be displayed as shown in the following figure.
![](figures/serial-port-entry.png)
# Hi3861<a name="EN-US_TOPIC_0000001174350609"></a>
# Hi3861 Development Board
- **[Setting Up the Environment](quickstart-lite-steps-hi3861-setting.md)**
- **[Setting Up WLAN Connection](quickstart-lite-steps-hi3861-connection.md)**
- **[Running a Hello World Program](quickstart-lite-steps-hi3861-running.md)**
- **[Setting Up the Hi3861 Development Board Environment](quickstart-lite-steps-hi3861-setting.md)**
- **[FAQs](quickstart-lite-steps-hi3861-faqs.md)**
- **[Writing a Hello World Program](quickstart-lite-steps-hi3861-application-framework.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-hi3816-running.md)**
# How to Develop<a name="EN-US_TOPIC_0000001128470860"></a>
# Running a Hello World Program
- **[Hi3861](quickstart-lite-steps-hi3861.md)**
- **[Hi3516](quickstart-lite-steps-hi3516.md)**
- **[Hi3518](quickstart-lite-steps-hi3518.md)**
- **[Hi3861 Development Board](quickstart-lite-steps-hi3861.md)**
- **[Hi3516 Development Board](quickstart-lite-steps-hi3516.md)**
# Mini and Small Systems<a name="EN-US_TOPIC_0000001112826850"></a>
# Getting Started with Mini and Small Systems
- **[Overview](quickstart-lite-overview.md)**
- **[Introduction](quickstart-lite-introduction.md)**
- **[Environment Setup](quickstart-lite-env-setup.md)**
- **[How to Develop](quickstart-lite-steps.md)**
- **[Getting Started with Mini and Small Systems (IDE Mode)](quickstart-lite-ide-directory.md)**
- **[Getting Started with Mini and Small Systems (Installation Package Mode)](quickstart-lite-package-directory.md)**
# Appendix
- **[Introduction to Development Boards](quickstart-standard-board-introduction.md)**
- **[Reference](quickstart-standard-reference.md)**
# 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|
# 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)**
# Getting Started with Standard System (Using the Installation Package)
- **[Standard System Overview](quickstart-standard-overview.md)**
- **[Setting Up Environments for Standard System](quickstart-standard-env-setup.md)**
- **[Running a Hello World Project](quickstart-standard-running.md)**
- **[FAQs](quickstart-standard-faqs.md)**
- **[Appendix](quickstart-standard-appendix.md)**
# Setting Up Environments for Standard System
## System Requirements
- Windows: Windows 10 (64-bit)
- Ubuntu: Ubuntu 18.04 or later; recommended memory: 16 GB or higher.
- 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.
In 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
```
> ![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. Specifically:
>
> - 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 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**
> 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** 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)
### Installing DevEco Device Tool for Ubuntu
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.400.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.400.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.400.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.400.sh
```
4. Run the following command to install DevEco Device Tool, where **devicetool-linux-tool-3.0.0.400.sh** indicates the installation file name.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> 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.400.sh
```
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-cn_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)
## 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:
```
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
### Obtaining Source Code
> ![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 Tool
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 Guidelines](https://gitee.com/openharmony/docs/blob/master/en/device-dev/subsystems/subsys-build.md).
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> To install a proxy, see [Configuring a Proxy](../quick-start/quickstart-standard-reference.md#configuring-a-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**
> - 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 applications to communicate through Windows Firewall**.
**Figure 7** Firewall and 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 when 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 when the message indicating Python 3 cannot be found is displayed during compilation and building?
- **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 when 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 when 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 when 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.
## "No module named 'Crypto'" 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
```
# FAQs<a name="EN-US_TOPIC_0000001166804465"></a>
# FAQs
## What Should I Do If "ImportError: No module named apt\_pkg" Is Displayed During Compilation and Building?<a name="section32195464215"></a>
- **Symptom**
The message "ImportError: No module named apt\_pkg" is displayed when an unidentifiable command is executed on the Linux server.
- **[Fixing hb Installation Issues](quickstart-standard-faq-hb.md)**
- **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
```
- **[Fixing Compilation Issues](quickstart-standard-faq-compose.md)**
- **[Fixing Burning Issues](quickstart-standard-faq-burning.md)**
## Getting Started with Standard System (IDE Mode)
- [Standard System Overview](quickstart-ide-standard-overview.md)
- Environment Preparation
- [Setting Up the Windows+Ubuntu Hybrid Build 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 Development Boards
- [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)
- [Getting Started with Mini and Small Systems (Installation Package Mode)](quickstart-lite-package-directory.md)
# Getting Started with Standard System (IDE Mode)
- **[Standard System Overview](quickstart-ide-standard-overview.md)**
- **[Environment Preparation](quickstart-ide-standard-env-setup.md)**
- **[Creating a Source Code Project](quickstart-ide-standard-create-project.md)**
- **[Running a Hello World Program](quickstart-ide-standard-running.md)**
- **[Appendix](quickstart-ide-standard-appendix.md)**
# Introduction<a name="EN-US_TOPIC_0000001166764513"></a>
# Standard System Overview
This document helps you quickly understand how to set up a standard OpenHarmony system, and how to build, burn, and start the system. You can develop the standard system in Windows and build source code in Linux.
This document uses the recommended Hi3516D V300 development board as an example.
## Introduction
## Quick Start Process<a name="section7825218111517"></a>
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.
The following figure shows the process of getting started for the standard system, during which, you can set up the Ubuntu development environment in Docker mode or by using the installation package.
To accommodate different developer habits, OpenHarmony provides two modes for getting started with the standard system:
**Figure 1** Getting started for the standard system<a name="fig19162195553211"></a>
![](figures/getting-started-for-the-standard-system.png "getting-started-for-the-standard-system")
- IDE mode: DevEco Device Tool is used for one-stop development, covering dependency installation, building, burning, and running.
## Introduction to the Development Board<a name="en-us_topic_0000001053666242_section047719215429"></a>
- 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.
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.
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-standard-ide-directory.md).
**Figure 2** Hi3516D V300 front view<a name="fig202901538183412"></a>
![](figures/hi3516d-v300-front-view-1.png "hi3516d-v300-front-view-1")
## Development Board Specifications<a name="en-us_topic_0000001053666242_section15192203316533"></a>
## Development Environment
**Table 1** Specifications of the Hi3516 development board
In the Windows+Ubuntu hybrid environment for OpenHarmony development:
<a name="en-us_topic_0000001053666242_table31714894311"></a>
<table><thead align="left"><tr id="en-us_topic_0000001053666242_row10171198194310"><th class="cellrowborder" valign="top" width="14.77%" id="mcps1.2.3.1.1"><p id="en-us_topic_0000001053666242_a2b235e9ed55f4338886788f140e648a0"><a name="en-us_topic_0000001053666242_a2b235e9ed55f4338886788f140e648a0"></a><a name="en-us_topic_0000001053666242_a2b235e9ed55f4338886788f140e648a0"></a>Item</p>
</th>
<th class="cellrowborder" valign="top" width="85.22999999999999%" id="mcps1.2.3.1.2"><p id="en-us_topic_0000001053666242_p9702458104014"><a name="en-us_topic_0000001053666242_p9702458104014"></a><a name="en-us_topic_0000001053666242_p9702458104014"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0000001053666242_row0171168114311"><td class="cellrowborder" valign="top" width="14.77%" headers="mcps1.2.3.1.1 "><p id="en-us_topic_0000001053666242_p1698185431418"><a name="en-us_topic_0000001053666242_p1698185431418"></a><a name="en-us_topic_0000001053666242_p1698185431418"></a>Processor and internal memory</p>
</td>
<td class="cellrowborder" valign="top" width="85.22999999999999%" headers="mcps1.2.3.1.2 "><a name="en-us_topic_0000001053666242_ul1147113537186"></a><a name="en-us_topic_0000001053666242_ul1147113537186"></a><ul id="en-us_topic_0000001053666242_ul1147113537186"><li>Hi3516D V300</li><li>1 GB DDR3</li><li>8 GB eMMC4.5</li></ul>
</td>
</tr>
<tr id="en-us_topic_0000001053666242_row21721687435"><td class="cellrowborder" valign="top" width="14.77%" headers="mcps1.2.3.1.1 "><p id="en-us_topic_0000001053666242_p817216810435"><a name="en-us_topic_0000001053666242_p817216810435"></a><a name="en-us_topic_0000001053666242_p817216810435"></a>External components</p>
</td>
<td class="cellrowborder" valign="top" width="85.22999999999999%" headers="mcps1.2.3.1.2 "><a name="en-us_topic_0000001053666242_ul179543016208"></a><a name="en-us_topic_0000001053666242_ul179543016208"></a><ul id="en-us_topic_0000001053666242_ul179543016208"><li>Ethernet port</li><li>Audio and video<a name="en-us_topic_0000001053666242_ul5941311869"></a><a name="en-us_topic_0000001053666242_ul5941311869"></a><ul id="en-us_topic_0000001053666242_ul5941311869"><li>One voice input</li><li>One mono output (AC_L), connected to a 3 W power amplifier (LM4871)</li><li>Micro-HDMI (one HDMI 1.4)</li></ul>
</li><li>Cameras<a name="en-us_topic_0000001053666242_ul924263620"></a><a name="en-us_topic_0000001053666242_ul924263620"></a><ul id="en-us_topic_0000001053666242_ul924263620"><li>Sensor IMX335</li><li>M12 lens with a focal length of 4 mm and an aperture of 1.8</li></ul>
</li><li>Display<a name="en-us_topic_0000001053666242_ul101471711667"></a><a name="en-us_topic_0000001053666242_ul101471711667"></a><ul id="en-us_topic_0000001053666242_ul101471711667"><li>2.35-inch LCD connector</li><li>5.5-inch LCD connector</li></ul>
</li><li>External components and interfaces<a name="en-us_topic_0000001053666242_ul089255556"></a><a name="en-us_topic_0000001053666242_ul089255556"></a><ul id="en-us_topic_0000001053666242_ul089255556"><li>microSD card interface</li><li>JTAG/I2S interface</li><li>ADC interface</li><li>Steer gear interface</li><li>Grove connector</li><li>USB 2.0 (Type C)</li><li>Three function keys: two custom keys and one update key</li><li>LED indicator (including green and red)</li></ul>
</li></ul>
</td>
</tr>
</tbody>
</table>
- 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.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-standard-running-hi3516-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)
- [Getting Started with Standard System (IDE Mode)](quickstart-standard-ide-directory.md)
- [Reference](quickstart-standard-reference.md)
# Reference
## Using the build.sh Script to Build Source Code
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, **Hi3516D V300** 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 [Building a Standard System](../subsystems/subsys-build-standard-large.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
```
# 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/hi3516dv300**.
# Burning
To burn source code to Hi3516D V300 through the USB 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](../quick-start/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_0000001171426014](figures/en-us_image_0000001171426014.png)
2. Select the target directory (in the Ubuntu environment) 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. Otherwise, the building may fail.
![en-us_image_0000001227711882](figures/en-us_image_0000001227711882.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**. In the figure below, **Hi3516DV300** is used as an example.
![en-us_image_0000001271912277](figures/en-us_image_0000001271912277.png)
6. 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 serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/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 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.
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.
# 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
productdefine/common
└── products
└── Hi3568DV300.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 **productdefine/common/products/Hi3516DV300.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":{},
```
# 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.
# Hi3516 Development Board
- **[Writing a Hello World Program](quickstart-standard-running-hi3516-create.md)**
- **[Building](quickstart-standard-running-hi3516-build.md)**
- **[Burning](quickstart-standard-running-hi3516-burning.md)**
- **[Running](quickstart-standard-running-hi3516-running.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 **rk3568** 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** 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**
> The build result and log files are stored in **out/rk3568**.
# Burning
To burn source code to RK3568 on Windows, perform the following steps:
### Importing Source Code
After the building is complete, ensure that you can [remotely access the Ubuntu environment from Windows](../quick-start/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_0000001171426014](figures/en-us_image_0000001171426014.png)
2. Select the target directory (in the Ubuntu environment) 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. Otherwise, the building may fail.
![en-us_image_0000001272032361](figures/en-us_image_0000001272032361.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**. Select **rk3568**.
![en-us_image_0000001227712350](figures/en-us_image_0000001227712350.png)
6. 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) **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**
> 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 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. Inthis 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. 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**
> 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_linuxv, **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. 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
productdefine/common
└── products
└── rk3568.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 **productdefine/common/products/rk3568.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":{},
```
# Running
## 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.
**Figure 1** System startup effect
![en-us_image_0000001226602406](figures/en-us_image_0000001226602406.jpg)
## 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.
![en-us_image_0000001226922310](figures/en-us_image_0000001226922310.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.
![en-us_image_0000001271202465](figures/en-us_image_0000001271202465.png)
# 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)**
# Running an Image<a name="EN-US_TOPIC_0000001142160948"></a>
# Running a Hello World Program
## Running an Image<a name="section153991115191314"></a>
After the image burning is complete, perform the following steps to run the system:
>![](../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.
![](figures/open-the-serial-port-tool.png)
2. Restart the development board. Before the autoboot countdown ends, 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:
```
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'
```
![](figures/setenv-bootargs.png)
4. Save the parameter settings.
```
save
```
![](figures/save-the-parameter-settings.png)
5. Restart the development board to start the system.
```
reset
```
![](figures/start-the-system.png)
## Next<a name="section5600113114323"></a>
Congratulations! You have completed the quick start for the standard system. Get yourself familiar with OpenHarmony by a [Development Example for Clock App](../guide/device-clock-guide.md).
- **[Hi3516 Development Board](quickstart-standard-running-hi3516.md)**
- **[RK3568 Development Board](quickstart-standard-running-rk3568.md)**
# Standard System<a name="EN-US_TOPIC_0000001111221726"></a>
# Getting Started with Standard System
- **[Introduction](quickstart-standard-overview.md)**
- **[Setting Up a Windows Development Environment](quickstart-standard-windows-environment.md)**
- **[Setting Up a Ubuntu Development Environment in Docker Mode](quickstart-standard-docker-environment.md)**
- **[Setting Up a Ubuntu Development Environment Using the Installation Package](quickstart-standard-package-environment.md)**
- **[Burning Images](quickstart-standard-burn.md)**
- **[Running an Image](quickstart-standard-running.md)**
- **[FAQs](quickstart-standard-faqs.md)**
- **[Getting Started with Standard System (IDE Mode)](quickstart-standard-ide-directory.md)**
- **[Getting Started with Standard System (Installation Package Mode)](quickstart-standard-package-directory.md)**
# Getting Started<a name="EN-US_TOPIC_0000001157479389"></a>
# Getting Started
- **[Mini and Small Systems](quickstart-lite.md)**
- **[Standard System](quickstart-standard.md)**
- **[Getting Started with Mini and Small Systems](quickstart-lite.md)**
- **[Getting Started with Standard System](quickstart-standard.md)**
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册