提交 d6f897dd 编写于 作者: O openharmony_ci 提交者: Gitee

!367 add hdc faqs

Merge pull request !367 from duangavin123/master
......@@ -2,27 +2,41 @@
After the OpenHarmony SDK is configured, you can start developing your app only by **importing a sample project** to begin with.
1. On the DevEco Studio welcome page, click **Import HarmonyOS Sample** to import a sample project.
Sample projects for OpenHarmony app development are supported. Import a sample project with the following description: **This sample is intended for novices at developing OpenHarmony applications.**. For example, the **JsHelloWorld** sample in the **common** category.
![](figures/en-us_image_0000001165463605.png)
1. On the DevEco Studio welcome page, go to **Configure** \(or ![](figures/en-us_image_0000001118018452.png) icon\) \> **Settings** \> **Version Control** \> **Git** and click **Test** to check whether the Git tool is installed.
- If the tool has been installed, import a sample by referring to [2](#li5947194711181).
![](figures/en-us_image_0000001118018088.png)
- If the tool hasn't been installed, click **Download and Install**. DevEco Studio will automatically download and install it. Then import a sample by referring to [2](#li5947194711181).
![](figures/en-us_image_0000001164498191.png)
2. <a name="li5947194711181"></a>On the DevEco Studio welcome page, click **Import HarmonyOS Sample** to import a sample project.
![](figures/en-us_image_0000001163835551.png)
2. Go to **ability** \> **HelloWorld** and click **Next**.
3. Go to **common** \> **JsHelloWorld** \> **Next**.
![](figures/en-us_image_0000001117635678.png)
![](figures/en-us_image_0000001118201202.png)
3. Configure **App Name** and **Project Location** and click **Finish**. Wait until the sample project is imported.
4. Configure **App Name** and **Project Location** and click **Finish**. Wait until the sample project is imported.
![](figures/en-us_image_0000001163915521.png)
4. Wait until the project sync is indicated to be failed. Open the **build.gradle** file in the project and change the version number of the HAP plugin to **2.4.4.3-RC**.
5. Open the **build.gradle** file in the project and change the version number of the HAP plugin to **2.4.4.3-RC**.
![](figures/en-us_image_0000001117475776.png)
5. Click ![](figures/en-us_image_0000001163835553.png) under **Gradle** in the upper right corner to sync the project again.
6. Click ![](figures/en-us_image_0000001163835553.png) under **Gradle** in the upper right corner to sync the project again.
![](figures/en-us_image_0000001117635680.png)
6. When the project is successfully synced, you can develop your OpenHarmony app.
7. When the project is successfully synced, you can develop your OpenHarmony app.
![](figures/en-us_image_0000001163915523.png)
......
......@@ -22,7 +22,7 @@ For details about how to use DevEco Studio, see [HUAWEI DevEco Studio User Guid
- OpenHarmony supports only app development in JS.
- Developing OpenHarmony apps in DevEco Studio is supported on Windows.
DevEco Studio serves as a development tool for both OpenHarmony and HarmonyOS apps. Refer to the following table for descriptions about the IDE function differences between OpenHarmony and HarmonyOS.
DevEco Studio serves as a development tool for both OpenHarmony and HarmonyOS apps. Refer to the following table for descriptions about the functions not supported for OpenHarmony.
<a name="table852516933419"></a>
<table><thead align="left"><tr id="row1952618913415"><th class="cellrowborder" valign="top" width="29.882988298829883%" id="mcps1.1.4.1.1"><p id="p165268963418"><a name="p165268963418"></a><a name="p165268963418"></a>Feature</p>
......
......@@ -10,4 +10,6 @@
- **[Running on the Device](running-on-the-device-9.md)**
- **[FAQs](faqs-10.md)**
# FAQs<a name="EN-US_TOPIC_0000001167349549"></a>
- [hdc\_std Fails to Connect to a Device](#section1221016541119)
- [hdc\_std Fails to Run](#section219185710311)
## hdc\_std Fails to Connect to a Device<a name="section1221016541119"></a>
- **Symptom**
**\[Empty\]** is displayed in the output after the **hdc\_std list targets** command is run.
- **Possible Causes and Solutions**
1. The device cannot be identified.
Check whether **HDC Device** exists in the universal serial bus device of the device manager. If **HDC Device** does not exist, the device cannot be connected. In this case, remove and then insert the device or burn the latest image for the device.
2. hdc\_std works improperly.
Run the **hdc kill** or **hdc start -r** command to kill or restart the hdc service, and then run the **hdc list targets** command to check whether device information is obtained.
If no device information is obtained, check whether the adb process exists in the task manager. If the adb process exists, kill this process because it may affect the hdc service. After that, run **hdc kill** or **hdc start -r** and then **hdc list targets** again.
3. hdc\_std does not match the device.
If the latest image is burnt for the device, hdc\_std must also be of the latest version. As hdc\_std is updated continuously, obtain hdc\_std of the latest version from the **developtools\_hdc\_standard** repository in the **prebuilt** directory.
## hdc\_std Fails to Run<a name="section219185710311"></a>
- **Symptom**
The **hdc\_std.exe** file does not run after being clicked.
- **Possible Causes and Solutions**
**hdc\_std.exe** requires no installation and can be directly used on a disk. It can also be added to environment variables. Open the cmd window and run the **hdc\_std** command to use **hdc\_std.exe**.
......@@ -4,5 +4,5 @@
## Setting Up the Development Environment and Creating a Project<a name="section1912530122716"></a>
Download and install DevEco Studio. For details, see the [DHUAWEI DevEco Studio User Guide](../docs/zh-cn/application-dev/quick-start/DevEco-Studio(OpenHarmony)使用指南.md).
Download and install DevEco Studio. For details, see the [HUAWEI DevEco Studio User Guide](../../application-dev/quick-start/deveco-studio-(openharmony)-user-guide.md).
# Running on the Device<a name="EN-US_TOPIC_0000001115258034"></a>
Before you install the app and run it on the development board, install the DevEco Device Tool by following operations provided in [HUAWEI DevEco Device Tool User Guide](https://device.harmonyos.com/en/docs/ide/user-guides/tool_install-0000001050164976). Burn OpenHarmony into the development board, and run it on the board. For details about how to build, burn, and run an image, see [Getting Started with Hi3516](../quick-start/how-to-develop-12.md). After the image is running normally and the system is started properly, perform the following steps to install or uninstall the app:
Before you install the app and run it on the development board, install the DevEco Device Tool by following operations provided in [HUAWEI DevEco Device Tool User Guide](https://device.harmonyos.com/en/docs/ide/user-guides/service_introduction-0000001050166905). Burn OpenHarmony into the development board, and run it on the board. For details about how to build, burn, and run an image, see [Getting Started with Hi3516](../quick-start/how-to-develop-12.md). After the image is running normally and the system is started properly, perform the following steps to install or uninstall the app:
1. Obtain the HDC client from the following path:
......
# Signing and Packaging<a name="EN-US_TOPIC_0000001161737833"></a>
After finishing writing the app code, you need to sign and package the app before running it on a real device. For details, see Signing and Packaging Guide.
After finishing writing the app code, you need to sign and package the app before running it on a real device. For details, see [Signing and Packaging Guide](../../application-dev/quick-start/configuring-the-openharmony-app-signature.md).
# Getting Started
- [Overview](overview.md)
- [Mini and Small Systems](mini-and-small-systems.md)
- [Overview](overview-0.md)
- [Introduction to the Development Boards](introduction-to-the-development-boards.md)
......@@ -8,6 +9,7 @@
- [Hi3518 Development Board](hi3518-development-board.md)
- [Environment Setup](environment-setup.md)
- [Overview](overview-1.md)
- [Windows Development Environment](windows-development-environment.md)
- [Ubuntu Build Environment](ubuntu-build-environment.md)
- [FAQ](faq.md)
......@@ -20,22 +22,22 @@
- [FAQs](faqs.md)
- [Hi3516](hi3516.md)
- [Setting Up the Environment](setting-up-the-environment-1.md)
- [Setting Up the Environment](setting-up-the-environment-2.md)
- [Running a Hello OHOS Program](running-a-hello-ohos-program.md)
- [Developing a Driver](developing-a-driver.md)
- [FAQs](faqs-2.md)
- [FAQs](faqs-3.md)
- [Hi3518](hi3518.md)
- [Setting Up the Environment](setting-up-the-environment-3.md)
- [Running a Hello OHOS Program](running-a-hello-ohos-program-4.md)
- [FAQs](faqs-5.md)
- [Setting Up the Environment](setting-up-the-environment-4.md)
- [Running a Hello OHOS Program](running-a-hello-ohos-program-5.md)
- [FAQs](faqs-6.md)
- [Standard System](standard-system.md)
- [Overview](overview-6.md)
- [Environment Setup](environment-setup-7.md)
- [Overview](overview-8.md)
- [Windows Development Environment](windows-development-environment-9.md)
- [Ubuntu Build Environment](ubuntu-build-environment-10.md)
- [Overview](overview-7.md)
- [Environment Setup](environment-setup-8.md)
- [Overview](overview-9.md)
- [Windows Development Environment](windows-development-environment-10.md)
- [Preparing the Ubuntu Build Environment](preparing-the-ubuntu-build-environment.md)
- [FAQs](faqs-11.md)
- [How to Develop](how-to-develop-12.md)
......
......@@ -430,7 +430,7 @@ Compile and burn images by referring to [Building](../quick-start/running-a-hel
1. Connect to a serial port.
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>If the connection fails, rectify the fault by referring to [FAQs](../quick-start/faqs-2.md).
>If the connection fails, rectify the fault by referring to [FAQs](../quick-start/faqs-3.md).
**Figure 1** Serial port connection<a name="en-us_topic_0000001151888681_fig056645018495"></a>
......@@ -463,7 +463,7 @@ Compile and burn images by referring to [Building](../quick-start/running-a-hel
<tr id="en-us_topic_0000001151888681_row12234912381"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="en-us_topic_0000001151888681_p172306219392"><a name="en-us_topic_0000001151888681_p172306219392"></a><a name="en-us_topic_0000001151888681_p172306219392"></a>setenv bootargs "console=ttyAMA0,115200n8 root=emmc fstype=vfat rootaddr=10M rootsize=20M rw";</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="en-us_topic_0000001151888681_p13489329396"><a name="en-us_topic_0000001151888681_p13489329396"></a><a name="en-us_topic_0000001151888681_p13489329396"></a>Run this command to set the output mode to serial port output, baud rate to <strong id="en-us_topic_0000001151888681_b1378372812210"><a name="en-us_topic_0000001151888681_b1378372812210"></a><a name="en-us_topic_0000001151888681_b1378372812210"></a>115200</strong>, data bit to <strong id="en-us_topic_0000001151888681_b27871628822"><a name="en-us_topic_0000001151888681_b27871628822"></a><a name="en-us_topic_0000001151888681_b27871628822"></a>8</strong>, <strong id="en-us_topic_0000001151888681_b678811281528"><a name="en-us_topic_0000001151888681_b678811281528"></a><a name="en-us_topic_0000001151888681_b678811281528"></a>rootfs</strong> to be mounted to the <strong id="en-us_topic_0000001151888681_b978813281220"><a name="en-us_topic_0000001151888681_b978813281220"></a><a name="en-us_topic_0000001151888681_b978813281220"></a>emmc</strong> component, and file system type to <strong id="en-us_topic_0000001151888681_b12788132814217"><a name="en-us_topic_0000001151888681_b12788132814217"></a><a name="en-us_topic_0000001151888681_b12788132814217"></a>vfat</strong>.</p>
<p id="en-us_topic_0000001151888681_p12481832163913"><a name="en-us_topic_0000001151888681_p12481832163913"></a><a name="en-us_topic_0000001151888681_p12481832163913"></a><strong id="en-us_topic_0000001151888681_b965011165313"><a name="en-us_topic_0000001151888681_b965011165313"></a><a name="en-us_topic_0000001151888681_b965011165313"></a>rootaddr=10 M, rootsize=20 M rw</strong> indicates the start address and size of the rootfs.img file to be burnt, respectively. The file size <strong id="en-us_topic_0000001151888681_b0633135515546"><a name="en-us_topic_0000001151888681_b0633135515546"></a><a name="en-us_topic_0000001151888681_b0633135515546"></a>must be the same</strong> as that of the <strong id="en-us_topic_0000001151888681_b69061726113015"><a name="en-us_topic_0000001151888681_b69061726113015"></a><a name="en-us_topic_0000001151888681_b69061726113015"></a>rootfs.img</strong> file in the IDE.</p>
<p id="en-us_topic_0000001151888681_p12481832163913"><a name="en-us_topic_0000001151888681_p12481832163913"></a><a name="en-us_topic_0000001151888681_p12481832163913"></a><strong id="en-us_topic_0000001151888681_b965011165313"><a name="en-us_topic_0000001151888681_b965011165313"></a><a name="en-us_topic_0000001151888681_b965011165313"></a>rootaddr=10M rootsize=20M rw</strong> indicates the start address and size of the <strong id="en-us_topic_0000001151888681_b1538675832018"><a name="en-us_topic_0000001151888681_b1538675832018"></a><a name="en-us_topic_0000001151888681_b1538675832018"></a>rootfs.img</strong> file to be burnt, respectively. The file size <strong id="en-us_topic_0000001151888681_b0633135515546"><a name="en-us_topic_0000001151888681_b0633135515546"></a><a name="en-us_topic_0000001151888681_b0633135515546"></a>must be the same</strong> as that of the <strong id="en-us_topic_0000001151888681_b69061726113015"><a name="en-us_topic_0000001151888681_b69061726113015"></a><a name="en-us_topic_0000001151888681_b69061726113015"></a>rootfs.img</strong> file in the IDE.</p>
</td>
</tr>
<tr id="en-us_topic_0000001151888681_row18234161153820"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="en-us_topic_0000001151888681_p823417118386"><a name="en-us_topic_0000001151888681_p823417118386"></a><a name="en-us_topic_0000001151888681_p823417118386"></a>saveenv</p>
......
# Environment Setup<a name="EN-US_TOPIC_0000001157501675"></a>
- **[Overview](overview-9.md)**
- **[Windows Development Environment](windows-development-environment-10.md)**
- **[Preparing the Ubuntu Build Environment](preparing-the-ubuntu-build-environment.md)**
- **[FAQs](faqs-11.md)**
# Environment Setup<a name="EN-US_TOPIC_0000001151881067"></a>
Use the DevEco Device Tool for development, build, burning, and debugging of OpenHarmony.
The DevEco Device Tool is currently available on Windows and Ubuntu. This document takes the Windows version as an example.
For details about how to use the Ubuntu version, see the [HUAWEI DevEco Device Tool User Guide](https://device.harmonyos.com/en/docs/ide/user-guides/service_introduction-0000001050166905).
The Windows version supports build for the Hi3861 development board only. For other development boards, you should use the Ubuntu version and switch to the Ubuntu platform. The following describes how to set up the development environment and build environment for mini and small OpenHarmony.
- **[Overview](overview-1.md)**
- **[Windows Development Environment](windows-development-environment.md)**
......
......@@ -2,7 +2,8 @@
- [What should I do if garbled characters and segmentation faults occur during hb installation?](#section411894616119)
- [What should I do if the message "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation?](#section629417571626)
- [What should I do if the message "module 'platform' has no attribute 'linux\_distribution'" is displayed during hb Installation?](#section10871523332)
- [What should I do if the message "module 'platform' has no attribute 'linux\_distribution'" is displayed during hb installation?](#section10871523332)
- [What should I do if the message "Could not find a version that satisfies the requirement ohos-build" is displayed during hb installation?](#section47351657163213)
- [What should I do if the message "ImportError: No module named apt\_pkg" is displayed during the execution of an unidentifiable command?](#section159891252236)
## What should I do if garbled characters and segmentation faults occur during hb installation?<a name="section411894616119"></a>
......@@ -45,7 +46,7 @@
```
## What should I do if the message "module 'platform' has no attribute 'linux\_distribution'" is displayed during hb Installation?<a name="section10871523332"></a>
## What should I do if the message "module 'platform' has no attribute 'linux\_distribution'" is displayed during hb installation?<a name="section10871523332"></a>
- **Symptom**
......@@ -67,6 +68,27 @@
```
## 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**
......
# FAQs<a name="EN-US_TOPIC_0000001105368702"></a>
- [What should I do when the images failed to be burnt over the selected serial port?](#section627268185113)
- [What should I do when Windows-based PC failed to be connected to the board?](#section195391036568)
- [What should I do when the image failed to be burnt?](#section571164016565)
- [What should I do when the message indicating Python cannot be found is displayed during compilation and building?](#section1039835245619)
- [What should I do when no command output is displayed?](#section14871149155911)
## What should I do when the images failed to be burnt over the selected serial port?<a name="section627268185113"></a>
- **Symptom**
**Error: Opening COMxx: Access denied** is displayed after clicking **Burn** and selecting a serial port.
**Figure 1** Failed to open the serial port<a name="fig066333283916"></a>
![](figures/failed-to-open-the-serial-port.png "failed-to-open-the-serial-port")
- **Possible Causes**
The serial port has been used.
- **Solutions**
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 used<a name="fig165994164420"></a>
![](figures/checking-whether-the-serial-port-is-used.png "checking-whether-the-serial-port-is-used")
2. Click the dustbin icon as shown in the following figure to disable the terminal using the serial port.
**Figure 3** Disabling the terminal using the serial port<a name="fig7911282453"></a>
![](figures/disabling-the-terminal-using-the-serial-port.png "disabling-the-terminal-using-the-serial-port")
3. Click **Burn**, select the serial port, and start burning images again.
**Figure 4** Restarting burning<a name="fig1138624316485"></a>
![](figures/changjian1.png)
## What should I do when Windows-based PC failed to be connected to the board?<a name="section195391036568"></a>
- **Symptom**
The file image cannot be obtained after clicking **Burn** and selecting a serial port.
**Figure 5** Failed to obtain the image file due to unavailable connection<a name="fig5218920223"></a>
![](figures/failed-to-obtain-the-image-file-due-to-unavailable-connection.png "failed-to-obtain-the-image-file-due-to-unavailable-connection")
- **Possible Causes**
The board is disconnected from the Windows-based PC.
Windows Firewall does not allow Visual Studio Code to access the network.
- **Solutions**
1. Check whether the network cable is properly connected.
2. Click **Windows Firewall**.
**Figure 6** Network and firewall setting<a name="fig62141417794"></a>
![](figures/network-and-firewall-setting.png "network-and-firewall-setting")
3. Click **Firewall & network protection**, and on the displayed page, click **Allow applications to communicate through Windows Firewall**.
**Figure 7** Firewall and network protection<a name="fig20703151111116"></a>
![](figures/firewall-and-network-protection.png "firewall-and-network-protection")
4. Select the Visual Studio Code application.
**Figure 8** Selecting the Visual Studio Code application<a name="fig462316612165"></a>
![](figures/selecting-the-visual-studio-code-application.png "selecting-the-visual-studio-code-application")
5. Select the **Private** and **Public** network access rights for the Visual Studio Code application.
**Figure 9** Allowing the Visual Studio Code application to access the network<a name="fig132725269184"></a>
![](figures/allowing-the-visual-studio-code-application-to-access-the-network.png "allowing-the-visual-studio-code-application-to-access-the-network")
## What should I do when the image failed to be burnt?<a name="section571164016565"></a>
- **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.
- **Solutions**
Restart the IDE.
## What should I do when the message indicating Python cannot be found is displayed during compilation and building?<a name="section1039835245619"></a>
- **Symptom**
![](figures/en-us_image_0000001105056492.png)
- **Possible Cause 1**: Python is not installed.
- **Solutions**
Install Python by referring to [Installing and Configuring Python](../quick-start/ubuntu-build-environment.md).
- **Possible Cause 2**: The soft link that points to the Python does not exist in the usr/bin directory.
![](figures/en-us_image_0000001151976069.png)
- **Solutions**
Run the following commands:
```
# cd /usr/bin/
# which python3
# ln -s /usr/local/bin/python3 python
# python --version
```
Example:
![](figures/en-us_image_0000001152176139.png)
## What should I do when no command output is displayed?<a name="section14871149155911"></a>
- **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.
- **Solutions**
Change the serial port number.
Start **Device Manager** to check whether the serial port connected to the board is the same as that connected to the terminal device. If the serial ports are different, perform step [1](../quick-start/running-a-hello-ohos-program.md) in the **Running an Image** section to change the serial port number.
- **Possible Cause 2**
The U-boot of the board is damaged.
- **Solutions**
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.
>![](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 [Programming Flash Memory on the Hi3516](https://device.harmonyos.com/en/docs/ide/user-guides/hi3516_upload-0000001052148681)/[Programming Flash Memory on the Hi3518](https://device.harmonyos.com/en/docs/ide/user-guides/hi3518_upload-0000001057313128)
3. Log in to the serial port after the burning is complete.
**Figure 10** Serial port displayed after the U-boot is burnt<a name="en-us_topic_0000001053466255_fig155914681910"></a>
![](figures/serial-port-displayed-after-the-u-boot-is-burnt.png "serial-port-displayed-after-the-u-boot-is-burnt")
# FAQs<a name="EN-US_TOPIC_0000001152168589"></a>
- [What should I do when the images failed to be burnt over the selected serial port?](#section1498892119619)
- [What should I do when Windows-based PC failed to be connected to the board?](#section8512971816)
- [What should I do when the image failed to be burnt?](#section1767804111198)
- [What should I do when the message indicating Python cannot be found is displayed during compilation and building?](#en-us_topic_0000001053466255_section1039835245619)
- [What should I do when no command output is displayed?](#en-us_topic_0000001053466255_section14871149155911)
## What should I do when the images failed to be burnt over the selected serial port?<a name="section1498892119619"></a>
- **Symptom**
**Error: Opening COMxx: Access denied** is displayed after clicking **Burn** and selecting a serial port.
**Figure 1** Failed to open the serial port<a name="en-us_topic_0000001053466255_fig066333283916"></a>
![](figures/failed-to-open-the-serial-port-8.png "failed-to-open-the-serial-port-8")
- **Possible Causes**
The serial port has been used.
- **Solutions**
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 used<a name="en-us_topic_0000001053466255_fig165994164420"></a>
![](figures/checking-whether-the-serial-port-is-used-9.png "checking-whether-the-serial-port-is-used-9")
2. Click the dustbin icon as shown in the following figure to disable the terminal using the serial port.
**Figure 3** Disabling the terminal using the serial port<a name="en-us_topic_0000001053466255_fig7911282453"></a>
![](figures/disabling-the-terminal-using-the-serial-port-10.png "disabling-the-terminal-using-the-serial-port-10")
3. Click **Burn**, select the serial port, and start burning images again.
**Figure 4** Restarting burning<a name="en-us_topic_0000001053466255_fig1138624316485"></a>
![](figures/changjian1-11.png)
## What should I do when Windows-based PC failed to be connected to the board?<a name="section8512971816"></a>
- **Symptom**
The file image cannot be obtained after clicking **Burn** and selecting a serial port.
**Figure 5** Failed to obtain the image file due to unavailable connection<a name="en-us_topic_0000001053466255_fig5218920223"></a>
![](figures/failed-to-obtain-the-image-file-due-to-unavailable-connection-12.png "failed-to-obtain-the-image-file-due-to-unavailable-connection-12")
- **Possible Causes**
The board is disconnected from the Windows-based PC.
Windows Firewall does not allow Visual Studio Code to access the network.
- **Solutions**
1. Check whether the network cable is properly connected.
2. Click **Windows Firewall**.
**Figure 6** Network and firewall setting<a name="en-us_topic_0000001053466255_fig62141417794"></a>
![](figures/network-and-firewall-setting-13.png "network-and-firewall-setting-13")
3. Click **Firewall & network protection**, and on the displayed page, click **Allow applications to communicate through Windows Firewall**.
**Figure 7** Firewall and network protection<a name="en-us_topic_0000001053466255_fig20703151111116"></a>
![](figures/firewall-and-network-protection-14.png "firewall-and-network-protection-14")
4. Select the Visual Studio Code application
**Figure 8** Selecting the Visual Studio Code application<a name="en-us_topic_0000001053466255_fig462316612165"></a>
![](figures/selecting-the-visual-studio-code-application-15.png "selecting-the-visual-studio-code-application-15")
5. Select the **Private** and **Public** network access rights for the Visual Studio Code application.
**Figure 9** Allowing the Visual Studio Code application to access the network<a name="en-us_topic_0000001053466255_fig132725269184"></a>
![](figures/allowing-the-visual-studio-code-application-to-access-the-network-16.png "allowing-the-visual-studio-code-application-to-access-the-network-16")
## What should I do when the image failed to be burnt?<a name="section1767804111198"></a>
- **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.
- **Solutions**
Restart the IDE.
## What should I do when the message indicating Python cannot be found is displayed during compilation and building?<a name="en-us_topic_0000001053466255_section1039835245619"></a>
- **Symptom**
![](figures/en-us_image_0000001105376260.png)
- **Possible Cause 1**
Python is not installed.
- **Solutions**
Install Python by referring to [Installing and Configuring Python](../quick-start/ubuntu-build-environment.md).
- **Possible Cause 2**: The soft link that points to the Python does not exist in the usr/bin directory.
![](figures/en-us_image_0000001105216304.png)
- **Solutions**
Run the following commands:
```
# cd /usr/bin/
# which python3
# ln -s /usr/local/bin/python3 python
# python --version
```
Example:
![](figures/en-us_image_0000001152256235.png)
## What should I do when no command output is displayed?<a name="en-us_topic_0000001053466255_section14871149155911"></a>
- **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.
- **Solutions**
Change the serial port number.
Start **Device Manager** to check whether the serial port connected to the board is the same as that connected to the terminal device. If the serial ports are different, perform step [1](../quick-start/running-a-hello-ohos-program.md) in the **Running an Image** section to change the serial port number.
- **Possible Cause 2**
The U-boot of the board is damaged.
- **Solutions**
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.
>![](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 [Programming Flash Memory on the Hi3516](https://device.harmonyos.com/en/docs/ide/user-guides/hi3516_upload-0000001052148681)/[Programming Flash Memory on the Hi3518](https://device.harmonyos.com/en/docs/ide/user-guides/hi3518_upload-0000001057313128)
3. Log in to the serial port after the burning is complete.
![](figures/en-us_image_0000001105536118.png)
# Hi3516<a name="EN-US_TOPIC_0000001105041328"></a>
- **[Setting Up the Environment](setting-up-the-environment-1.md)**
- **[Setting Up the Environment](setting-up-the-environment-2.md)**
- **[Running a Hello OHOS Program](running-a-hello-ohos-program.md)**
- **[Developing a Driver](developing-a-driver.md)**
- **[FAQs](faqs-2.md)**
- **[FAQs](faqs-3.md)**
# Hi3518<a name="EN-US_TOPIC_0000001152041035"></a>
- **[Setting Up the Environment](setting-up-the-environment-3.md)**
- **[Setting Up the Environment](setting-up-the-environment-4.md)**
- **[Running a Hello OHOS Program](running-a-hello-ohos-program-4.md)**
- **[Running a Hello OHOS Program](running-a-hello-ohos-program-5.md)**
- **[FAQs](faqs-5.md)**
- **[FAQs](faqs-6.md)**
......@@ -19,7 +19,7 @@ The Hi3861 WLAN module can also be connected to the Hi3861 mother board to expan
**Figure 2** Appearance of the Hi3861 mother board<a name="fig111746288192"></a>
![](figures/3861背面.png)
![](figures/en-us_image_0000001119945810.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.
......
......@@ -10,14 +10,14 @@
## Environment Setup<a name="section1246439101710"></a>
For details about setting up the standard OpenHarmony environment, see [Setting Up the Environment](overview-8.md).
For details about setting up the standard OpenHarmony environment, see [Setting Up the Environment](overview-9.md).
>![](public_sys-resources/icon-note.gif) **NOTE:**
>For details about the environment requirements of the third-party development board, refer to the official guide of the development board.
## Build<a name="section375234715135"></a>
Perform the following operations in the Linux environment.
If you are using the Docker environment, refer to the Docker usage guide to build the system. If you are using the installation package, perform the following operations in the Linux environment.
1. Go to the root directory of the source code and run the following command to build the distribution.
......@@ -72,7 +72,7 @@ The Hi3516DV300 supports programming through the USB port in Windows or Linux+Wi
3. Open DevEco Device Tool and go to **Projects** \> **Settings**.
![](figures/2021-01-27_170334-18.png)
![](figures/2021-01-27_170334-17.png)
4. On the **Partition Configuration** tab page, enter the information about the files to be programmed, including the following.
......@@ -216,7 +216,7 @@ The Hi3516DV300 supports programming through the USB port in Windows or Linux+Wi
![](figures/en-us_image_0000001160528243.png)
6. When you finish modifying, click **Save** in the upper right corner.
7. Open the project file, go to ![](figures/2021-01-27_170334-19.png) \> **PROJECT TASKS** \> **fastboot** \> **Erase** to erase U-boot.
7. Open the project file, go to ![](figures/2021-01-27_170334-18.png) \> **PROJECT TASKS** \> **fastboot** \> **Erase** to erase U-boot.
![](figures/en-us_image_0000001163045527.png)
......@@ -233,7 +233,7 @@ The Hi3516DV300 supports programming through the USB port in Windows or Linux+Wi
>![](public_sys-resources/icon-note.gif) **NOTE:**
>If this is the first time you program flash memory on the Hi3516 or Hi3518 board, the message "not find the Devices" may be displayed. In this case, follow the steps in [Installing the USB Driver on the Hi3516 or Hi3518 Series Development Boards](https://device.harmonyos.com/en/docs/ide/user-guides/usb_driver-0000001058690393) and start programming again.
![](figures/1-20.png)
![](figures/1-19.png)
11. If the following message is displayed, it indicates that the programming is successful.
......@@ -242,5 +242,5 @@ The Hi3516DV300 supports programming through the USB port in Windows or Linux+Wi
## Development Example<a name="section5600113114323"></a>
You have completed the quick start for the standard system. Get yourself familiar with OpenHarmony by a [Development Example for Platform Drivers](../guide/overview-13.md).
You have completed the quick start for the standard system. Get yourself familiar with OpenHarmony by a [Development Example for Platform Drivers](../guide/overview-11.md).
# Overview<a name="EN-US_TOPIC_0000001105598722"></a>
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, Hi3516, and Hi3518.
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 driver development for mini and small systems.
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.
# Overview<a name="EN-US_TOPIC_0000001119076372"></a>
Use the DevEco Device Tool for development, build, burning, and debugging of OpenHarmony.
The DevEco Device Tool is currently available on Windows and Ubuntu. This document takes the Windows version as an example.
For details about how to use the Ubuntu version, see the [HUAWEI DevEco Device Tool User Guide](https://device.harmonyos.com/en/docs/ide/user-guides/service_introduction-0000001050166905).
The Windows version supports build for the Hi3861 development board only. For other development boards, you should use the Ubuntu version and switch to the Ubuntu platform. The following describes how to set up the development environment and build environment for mini and small OpenHarmony.
# Overview<a name="EN-US_TOPIC_0000001163428879"></a>
This document helps you quickly understand how to set up a standard OpenHarmony system, and how to build, burn, and start the system. This document uses the recommended Hi3516D V300 development board as an example.
# Overview<a name="EN-US_TOPIC_0000001135547521"></a>
- [Introduction](#section18217135811916)
- [Environment Requirements](#section466851916410)
- [Hardware](#section19682305453)
- [Software](#section1595725202314)
## Introduction<a name="section18217135811916"></a>
In a standard OpenHarmony system, you can use the DevEco Device Tool for development and burning in Windows, and for build in Linux. This document describes how to set up the environment.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>The procedure for setting up a Windows standard-system environment is basically the same as that for setting up a Windows mini- or small-system environment. Therefore, you can skip section [Windows Development Environment](windows-development-environment-10.md) if you have set up a Windows mini- or small-system environment.
## Environment Requirements<a name="section466851916410"></a>
### Hardware<a name="section19682305453"></a>
- Linux compile server
- Windows workstation \(host computer\)
### Software<a name="section1595725202314"></a>
**Table 1** Development platform requirements
<a name="tc50585b2b3fe43f7835154789b0e25af"></a>
<table><thead align="left"><tr id="ra9df6acc53154b819d5f86d885d994de"><th class="cellrowborder" valign="top" width="8.53%" id="mcps1.2.5.1.1"><p id="a999bb40532eb4f74a7383e1e776bb94a"><a name="a999bb40532eb4f74a7383e1e776bb94a"></a><a name="a999bb40532eb4f74a7383e1e776bb94a"></a>Platform</p>
</th>
<th class="cellrowborder" valign="top" width="14.49%" id="mcps1.2.5.1.2"><p id="ae63cf791fbe348d3b907d20fc4927df8"><a name="ae63cf791fbe348d3b907d20fc4927df8"></a><a name="ae63cf791fbe348d3b907d20fc4927df8"></a>Software</p>
</th>
<th class="cellrowborder" valign="top" width="47%" id="mcps1.2.5.1.3"><p id="a54c4c80c43c84cb187342865a1d2b51e"><a name="a54c4c80c43c84cb187342865a1d2b51e"></a><a name="a54c4c80c43c84cb187342865a1d2b51e"></a>Description</p>
</th>
<th class="cellrowborder" valign="top" width="29.98%" id="mcps1.2.5.1.4"><p id="a11e8d096fb204378a63d8805cd6d1f88"><a name="a11e8d096fb204378a63d8805cd6d1f88"></a><a name="a11e8d096fb204378a63d8805cd6d1f88"></a>Remarks</p>
</th>
</tr>
</thead>
<tbody><tr id="row117591159175819"><td class="cellrowborder" valign="top" width="8.53%" headers="mcps1.2.5.1.1 "><p id="a0c1290183f2548898dbfc516a4db2c4b"><a name="a0c1290183f2548898dbfc516a4db2c4b"></a><a name="a0c1290183f2548898dbfc516a4db2c4b"></a>Linux compile server</p>
</td>
<td class="cellrowborder" valign="top" width="14.49%" headers="mcps1.2.5.1.2 "><p id="a687efa8001f140488dc1da9a2ee8f6d1"><a name="a687efa8001f140488dc1da9a2ee8f6d1"></a><a name="a687efa8001f140488dc1da9a2ee8f6d1"></a>Operating system</p>
</td>
<td class="cellrowborder" valign="top" width="47%" headers="mcps1.2.5.1.3 "><p id="ace724e00c9094eccb8c600d6ad426ed8"><a name="ace724e00c9094eccb8c600d6ad426ed8"></a><a name="ace724e00c9094eccb8c600d6ad426ed8"></a>Ubuntu 18.04 64-bit or later is used for the Linux OS, and bash is used as the shell. The server hardware specifications are as follows:</p>
<a name="ul152485517227"></a><a name="ul152485517227"></a><ul id="ul152485517227"><li>Hard disk: at least 400 GB</li><li>CPU: at least 8 cores</li><li>Memory: at least 32 GB</li></ul>
<p id="p17176265243"><a name="p17176265243"></a><a name="p17176265243"></a>Common software such as samba and vim is installed in the OS by default. Adaptation is required to support Linux file sharing.</p>
</td>
<td class="cellrowborder" rowspan="2" valign="top" width="29.98%" headers="mcps1.2.5.1.4 "><p id="a4d0e2c8444484554ab58949ce322be32"><a name="a4d0e2c8444484554ab58949ce322be32"></a><a name="a4d0e2c8444484554ab58949ce322be32"></a>You can develop programs on the Windows workstation or Linux server via a remote login.</p>
</td>
</tr>
<tr id="r85c4bf56ff3244e48db9d2f5b622b340"><td class="cellrowborder" valign="top" headers="mcps1.2.5.1.1 "><p id="a8e99fd0262cb4489b70cf86c2144c294"><a name="a8e99fd0262cb4489b70cf86c2144c294"></a><a name="a8e99fd0262cb4489b70cf86c2144c294"></a>Windows workstation</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.5.1.2 "><p id="a44d6164ce2e9421f9ade362f600c2815"><a name="a44d6164ce2e9421f9ade362f600c2815"></a><a name="a44d6164ce2e9421f9ade362f600c2815"></a>Operating system</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.5.1.3 "><p id="a1c17349e334a44ada5c5f150457fe17d"><a name="a1c17349e334a44ada5c5f150457fe17d"></a><a name="a1c17349e334a44ada5c5f150457fe17d"></a>Windows XP/Windows7/Windows10</p>
</td>
</tr>
</tbody>
</table>
......@@ -59,7 +59,7 @@ In addition, OpenHarmony provides a series of optional system components that ca
</td>
<td class="cellrowborder" valign="top" width="38.54385438543855%" headers="mcps1.2.4.1.2 "><p id="p3213132491711"><a name="p3213132491711"></a><a name="p3213132491711"></a>Getting started with setup, build, burning, debugging, and running of <span id="text203751321355"><a name="text203751321355"></a><a name="text203751321355"></a>OpenHarmony</span></p>
</td>
<td class="cellrowborder" valign="top" width="33.58335833583358%" headers="mcps1.2.4.1.3 "><a name="ul1222811151378"></a><a name="ul1222811151378"></a><ul id="ul1222811151378"><li><a href="overview-0.md">Getting Started for Mini and Small Systems</a></li><li><a href="overview-6.md">Getting Started for Standard System</a></li></ul>
<td class="cellrowborder" valign="top" width="33.58335833583358%" headers="mcps1.2.4.1.3 "><a name="ul1222811151378"></a><a name="ul1222811151378"></a><ul id="ul1222811151378"><li><a href="overview-0.md">Getting Started for Mini and Small Systems</a></li><li><a href="overview-7.md">Getting Started for Standard System</a></li></ul>
</td>
</tr>
<tr id="row421315248178"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p0213724191718"><a name="p0213724191718"></a><a name="p0213724191718"></a>Basic capabilities</p>
......
# Preparing the Ubuntu Build Environment<a name="EN-US_TOPIC_0000001161257591"></a>
- [Setting up an Ubuntu Build Environment Using a Docker Environment](#section1643363843714)
- [Obtaining System Source Code](#section58448331029)
- [Installing and Using the Docker Environment](#section22916211916)
- [Setting up an Ubuntu Build Environment Using an Installation Package](#section25961010189)
- [Installing Dependent Tools](#section109262032104819)
- [Obtaining Standard-System Source Code](#section6325556113718)
- [Obtaining prebuilts](#section16453104219209)
- [Configuring the Node.js Environment and Obtaining the Node\_modules Dependency Package](#section133741330192119)
- [Installing the hc-gen Tool](#section149281248182116)
You can use either the Docker environment or installation package provided by OpenHarmony to set up an Ubuntu build environment. This section describes the two methods.
## Setting up an Ubuntu Build Environment Using a Docker Environment<a name="section1643363843714"></a>
The standard OpenHarmony system provides a Docker environment which encapsulates build tools. To use the Docker environment, perform the following steps:
1. Obtain the system source code.
2. Install and use the Docker environment.
### Obtaining System Source Code<a name="section58448331029"></a>
For details, see [Source Code Acquisition](../get-code/source-code-acquisition.md).
### Installing and Using the Docker Environment<a name="section22916211916"></a>
For details, see [Installing and Using Docker](../get-code/tool-acquisition.md).
## Setting up an Ubuntu Build Environment Using an Installation Package<a name="section25961010189"></a>
The procedure is as follows:
1. Install dependent tools.
2. Obtain the system source code.
3. Obtain prebuilts.
4. Configure the Node.js environment and obtain the Node\_modules dependency package.
5. Install the hc-gen tool.
### Installing Dependent Tools<a name="section109262032104819"></a>
The installation command is as follows:
```
sudo apt-get install binutils git-core git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4
```
>![](public_sys-resources/icon-caution.gif) **CAUTION:**
>The preceding command is applicable to Ubuntu 18.04. For other Ubuntu versions, use the corresponding installation commands based on the installation package name. If the Ubuntu version is later than 18.04, Python 2.7 and python-minimal must be installed.
### Obtaining Standard-System Source Code<a name="section6325556113718"></a>
For details, see [Source Code Acquisition](../get-code/source-code-acquisition.md).
### Obtaining prebuilts<a name="section16453104219209"></a>
1. Go to the OpenHarmony working directory.
```
cd OpenHarmony
```
2. Download the script.
```
curl https://gitee.com/landwind/script-tools/raw/master/Shell/OpenHarmony/OpenHarmony_2.0_canary_prebuilts_download.sh >./prebuilts_download.sh
```
3. Download and decompress the prebuilts package in a specified directory.
```
bash ./prebuilts_download.sh
```
By default, binary files are stored in the **OpenHarmony\_2.0\_canary\_prebuilts** directory, which is in the same directory as **OpenHarmony**. To change the storage path, change the value of **bin\_dir** in **prebuilts\_download.sh**.
4. Return to the previous directory.
```
cd -
```
### Configuring the Node.js Environment and Obtaining the Node\_modules Dependency Package<a name="section133741330192119"></a>
To build the JS framework, you need to download and configure Node.js on a Linux server. The procedure is as follows \(the **OpenHarmony** directory in the following steps is the root directory of the current project and is configurable\):
1. Download Node.js on a Linux server.
```
mkdir -p OpenHarmony/prebuilts/build-tools/common/nodejs # Create the nodejs directory.
cd OpenHarmony/prebuilts/build-tools/common/nodejs # Go to the nodejs directory.
wget --no-check-certificate https://nodejs.org/download/release/v12.18.4/node-v12.18.4-linux-x64.tar.gz # Download the Node.js package.
tar -zxvf node-v12.18.4-linux-x64.tar.gz # Decompress the Node.js package.
cd - # Return to the previous directory.
```
2. Configure the Node.js variable and download the **node\_modules** package.
```
cd OpenHarmony/third_party/jsframework # Go to the jsframework directory.
export PATH=../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin:${PATH} # Configure the Node.js variable.
npm install # Download the node_modules package.
cd - # Return to the previous directory.
```
3. Store the **node\_modules** package in the **prebuilts/build-tools/common/js-framework** directory of the OpenHarmony code.
```
mkdir -p OpenHarmony/prebuilts/build-tools/common/js-framework # Create the js-framework directory.
cp -rp OpenHarmony/third_party/jsframework/node_modules OpenHarmony/prebuilts/build-tools/common/js-framework/
```
### Installing the hc-gen Tool<a name="section149281248182116"></a>
hc-gen is used to compile the driver. To install hc-gen, perform the following steps:
1. Start a Linux server.
2. Download [hc-gen](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar).
3. Decompress the hc-gen installation package to **\~/hc-gen** on the Linux server.
```
tar -xvf hc-gen-0.65-linux.tar -C ~/
```
4. Set an environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the **.bashrc** file, save the file, and exit.
```
export PATH=~/hc-gen:$PATH
```
5. Validate the environment variable.
```
source ~/.bashrc
```
# Running a Hello OHOS Program<a name="EN-US_TOPIC_0000001105528572"></a>
- [Creating a Program](#section1550972416485)
- [Building](#section234175193114)
- [Burning](#section7609155824819)
- [Running an Image](#section17612105814480)
- [Follow-up Learning](#section9712145420182)
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="section1550972416485"></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\_aries/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": [
##start##
{ "component": "hello_world_app", "features":[] },
##end##
{ "component": "camera_sample_app", "features":[] }
]
},
```
## Building<a name="section234175193114"></a>
If the Linux environment is installed using Docker, perform the building by referring to [Using Docker to Prepare the Build Environment](../get-code/tool-acquisition.md). 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_aries@hisilicon and press Enter.
hb build -f (Start building.)
```
The result files are generated in the **out/hispark\_aries/ipcamera\_hispark\_aries** directory.
**Figure 1** Settings<a name="fig4305770509"></a>
![](figures/settings-4.png "settings-4")
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>The U-boot file of the Hi3518E V300 development board can be obtained from the following path: device/hisilicon/hispark\_aries/sdk\_liteos/uboot/out/boot/u-boot-hi3518ev300.bin
## Burning<a name="section7609155824819"></a>
The USB port is the only burning mode supported by the Hi3518 development board.
1. Connect the PC and the target development board through the serial port and USB port. In this section, the Hi3518EV300 is used as an example. For details, please refer to [Introduction to the Hi3518 Development Board](https://device.harmonyos.com/en/docs/start/introduce/oem_camera_start_hi3518-0000001050170473).
2. <a name="en-us_topic_0000001057313128_li46411811196"></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/en-us_image_0000001073057176.png)
3. Open DevEco Device Tool and go to **Projects** \> **Settings**.
![](figures/en-us_image_0000001077956808.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 **hi3518ev300** tab page, set the programming options.
- **upload\_port**: Select the serial port number obtained in step [2](#en-us_topic_0000001057313128_li46411811196).
- **upload\_protocol**: Select the programming protocol **hiburn-usb**.
- **upload\_partitions**: Select the file to be programmed. By default, the **fastboot**, **kernel**, **rootfs**, and **userfs** files are programmed at the same time.
![](figures/en-us_image_0000001096963405.png)
6. When you finish modifying, click **Save** in the upper right corner.
7. Open the project file, go to ![](figures/2021-01-27_170334-5.png) \> **PROJECT TASKS** \> **hi3518ev300\_fastboot** \> **Erase** to erase U-boot.
![](figures/en-us_image_0000001163529159.png)
8. When the following message is displayed, power off the development board and then power it on.
![](figures/en-us_image_0000001078089378.png)
9. If the following message is displayed, it indicates that U-Boot is erased successfully.
![](figures/en-us_image_0000001073835952.png)
10. Go to **hi3518ev300** \> **Upload** to start programming.
![](figures/en-us_image_0000001163568181.png)
11. If the following message is displayed, it indicates that the programming is successful.
![](figures/en-us_image_0000001073242197.png)
## Running an Image<a name="section17612105814480"></a>
1. Connect to a serial port.
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>If the connection fails, rectify the fault by referring to [FAQs](../quick-start/faqs-6.md).
**Figure 2** Serial port connection<a name="fig056645018495"></a>
![](figures/chuankou1-6.png)
1. Click **Monitor** to enable the serial port. The **TERMINAL** window is displayed.
2. Press **Enter** repeatedly until **hisilicon** displays.
3. Go to [step 2](#li9441185382314) if the board is started for the first time or the startup parameters need to be modified; go to [step 3](#li6442853122312) otherwise.
2. <a name="li9441185382314"></a>\(Mandatory for the first burning\) Modify the **bootcmd** and **bootargs** parameters of U-boot. This step is a fixed operation and the result can be saved. However, you need to perform the following steps again if U-boot needs to be reburnt.
**Table 1** Parameters of the U-boot
<a name="table1336762011222"></a>
<table><thead align="left"><tr id="row193681920182219"><th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.1"><p id="p3368202016229"><a name="p3368202016229"></a><a name="p3368202016229"></a>Command</p>
</th>
<th class="cellrowborder" valign="top" width="50%" id="mcps1.2.3.1.2"><p id="p936812052217"><a name="p936812052217"></a><a name="p936812052217"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row10368142032210"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p1636882092214"><a name="p1636882092214"></a><a name="p1636882092214"></a>setenv bootcmd "sf probe 0;sf read 0x40000000 0x100000 0x600000;go 0x40000000";</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p17368202082213"><a name="p17368202082213"></a><a name="p17368202082213"></a>Run this command to set the content of <strong id="b209671361282"><a name="b209671361282"></a><a name="b209671361282"></a>bootcmd</strong>. Select the flash whose number is 0, and read content that has a size of 0x600000 (6 MB) and a start address of 0x100000 to memory address 0x40000000. The size must be the same as that of the <strong id="b12634352103017"><a name="b12634352103017"></a><a name="b12634352103017"></a>OHOS_Image.bin</strong> file in the IDE.</p>
</td>
</tr>
<tr id="row136814209227"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p234414019231"><a name="p234414019231"></a><a name="p234414019231"></a>setenv bootargs "console=ttyAMA0,115200n8 root=flash fstype=jffs2 rw rootaddr=7M rootsize=8M";</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p10368102010223"><a name="p10368102010223"></a><a name="p10368102010223"></a>In this command, <strong id="b1475793912349"><a name="b1475793912349"></a><a name="b1475793912349"></a>bootargs</strong> is set to the serial port output, the baud rate is <strong id="b1310782917185"><a name="b1310782917185"></a><a name="b1310782917185"></a>115200</strong>, the data bit is <strong id="b149010367189"><a name="b149010367189"></a><a name="b149010367189"></a>8</strong>, and the <strong id="b19757173918344"><a name="b19757173918344"></a><a name="b19757173918344"></a>rootfs</strong> is mounted to the flash memory. The file system type is set to <strong id="b875763919342"><a name="b875763919342"></a><a name="b875763919342"></a>jffs2 rw</strong>, which provides the read-write attribute for the JFFS2 file system. <strong id="b186911414141517"><a name="b186911414141517"></a><a name="b186911414141517"></a>rootaddr=7M rootsize=8M</strong> indicates the actual start address and length of the <strong id="b841582383217"><a name="b841582383217"></a><a name="b841582383217"></a>rootfs.img</strong> file to be burnt, respectively. The file size must be the same as that of the <strong id="b51690521108"><a name="b51690521108"></a><a name="b51690521108"></a>rootfs.img</strong> file in the IDE.</p>
</td>
</tr>
<tr id="row2368120112219"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p20368142072217"><a name="p20368142072217"></a><a name="p20368142072217"></a>saveenv</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p19368102020220"><a name="p19368102020220"></a><a name="p19368102020220"></a><strong id="b12547103053713"><a name="b12547103053713"></a><a name="b12547103053713"></a>saveenv</strong> means to save the current configuration.</p>
</td>
</tr>
<tr id="row63689205220"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p3368162015223"><a name="p3368162015223"></a><a name="p3368162015223"></a>reset</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p23681820182217"><a name="p23681820182217"></a><a name="p23681820182217"></a><strong id="b29195356377"><a name="b29195356377"></a><a name="b29195356377"></a>reset</strong> means to reset the board.</p>
</td>
</tr>
<tr id="row346253519253"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p16462113512251"><a name="p16462113512251"></a><a name="p16462113512251"></a>pri</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p3462335152514"><a name="p3462335152514"></a><a name="p3462335152514"></a><strong id="b18592103953712"><a name="b18592103953712"></a><a name="b18592103953712"></a>pri</strong> means to view the displayed parameters.</p>
</td>
</tr>
</tbody>
</table>
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>**go 0x40000000** \(optional\) indicates that the command is fixed in the startup parameters by default and the board automatically starts after it is reset. If you want to manually start the board, press **Enter** in the countdown phase of the U-boot startup to interrupt the automatic startup.
3. <a name="li6442853122312"></a>If **hisilicon \#** is displayed during the startup, run the **reset** command. After the system automatically starts and **OHOS** is displayed, run the **./bin/helloworld** command and then press **Enter**. The system is started successfully if information shown in the following figure is displayed.
**Figure 3** Successful system startup and program execution<a name="fig265662981319"></a>
![](figures/successful-system-startup-and-program-execution-7.png "successful-system-startup-and-program-execution-7")
## Follow-up Learning<a name="section9712145420182"></a>
Congratulations! You have finished all steps! You are advised to go on learning how to develop [Cameras with a Screen](../guide/cameras-with-a-screen.md).
......@@ -179,7 +179,7 @@ The Hi3516 development board allows you to burn flash memory over the USB port,
- **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/en-us_image_0000001160649345.png)
![](figures/en-us_image_0000001117463460.png)
8. When you finish modifying, click **Save** in the upper right corner.
9. Open the project file and go to ![](figures/2021-01-27_170334-2.png) \> **PROJECT TASKS** \> **hi3516dv300** \> **Upload** to start programming.
......@@ -200,7 +200,7 @@ The Hi3516 development board allows you to burn flash memory over the USB port,
1. Connect to a serial port.
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>If the connection fails, rectify the fault by referring to [FAQs](../quick-start/faqs-2.md).
>If the connection fails, rectify the fault by referring to [FAQs](../quick-start/faqs-3.md).
**Figure 2** Serial port connection<a name="fig056645018495"></a>
......@@ -233,7 +233,7 @@ The Hi3516 development board allows you to burn flash memory over the USB port,
<tr id="row12234912381"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p172306219392"><a name="p172306219392"></a><a name="p172306219392"></a>setenv bootargs "console=ttyAMA0,115200n8 root=emmc fstype=vfat rootaddr=10M rootsize=20M rw";</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.2 "><p id="p13489329396"><a name="p13489329396"></a><a name="p13489329396"></a>Run this command to set the output mode to serial port output, baud rate to <strong id="b1378372812210"><a name="b1378372812210"></a><a name="b1378372812210"></a>115200</strong>, data bit to <strong id="b27871628822"><a name="b27871628822"></a><a name="b27871628822"></a>8</strong>, <strong id="b678811281528"><a name="b678811281528"></a><a name="b678811281528"></a>rootfs</strong> to be mounted to the <strong id="b978813281220"><a name="b978813281220"></a><a name="b978813281220"></a>emmc</strong> component, and file system type to <strong id="b12788132814217"><a name="b12788132814217"></a><a name="b12788132814217"></a>vfat</strong>.</p>
<p id="p12481832163913"><a name="p12481832163913"></a><a name="p12481832163913"></a><strong id="b965011165313"><a name="b965011165313"></a><a name="b965011165313"></a>rootaddr=10 M, rootsize=20 M rw</strong> indicates the start address and size of the rootfs.img file to be burnt, respectively. The file size <strong id="b0633135515546"><a name="b0633135515546"></a><a name="b0633135515546"></a>must be the same</strong> as that of the <strong id="b69061726113015"><a name="b69061726113015"></a><a name="b69061726113015"></a>rootfs.img</strong> file in the IDE.</p>
<p id="p12481832163913"><a name="p12481832163913"></a><a name="p12481832163913"></a><strong id="b965011165313"><a name="b965011165313"></a><a name="b965011165313"></a>rootaddr=10M rootsize=20M rw</strong> indicates the start address and size of the <strong id="b1538675832018"><a name="b1538675832018"></a><a name="b1538675832018"></a>rootfs.img</strong> file to be burnt, respectively. The file size <strong id="b0633135515546"><a name="b0633135515546"></a><a name="b0633135515546"></a>must be the same</strong> as that of the <strong id="b69061726113015"><a name="b69061726113015"></a><a name="b69061726113015"></a>rootfs.img</strong> file in the IDE.</p>
</td>
</tr>
<tr id="row18234161153820"><td class="cellrowborder" valign="top" width="50%" headers="mcps1.2.3.1.1 "><p id="p823417118386"><a name="p823417118386"></a><a name="p823417118386"></a>saveenv</p>
......
# Setting Up the Environment<a name="EN-US_TOPIC_0000001105829366"></a>
- [Environment Requirements](#section179175261196)
- [Hardware](#section5840424125014)
- [Software](#section965634210501)
- [Installing Linux Build Tools](#section182916865219)
- [Changing Linux Shell to Bash](#section1715027152617)
- [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section45512412251)
- [Installing a File Packing Tool](#section1969111820270)
- [Installing the JVM](#section1692618112713)
## Environment Requirements<a name="section179175261196"></a>
### Hardware<a name="section5840424125014"></a>
- 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.
**Figure 1** Hardware connections<a name="fig19527104710591"></a>
![](figures/矩形备份-292.png)
### Software<a name="section965634210501"></a>
>![](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.
**Table 1** Development tools and obtaining methods
<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>
## Installing Linux Build Tools<a name="section182916865219"></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 compilation tools like **LLVM** and **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 && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
```
### Installing a File Packing Tool<a name="section1969111820270"></a>
1. Start a Linux server.
2. Install **dosfstools**.
```
sudo apt-get install dosfstools
```
3. Install **mtools**.
```
sudo apt-get install mtools
```
4. Install **mtd-utils**.
```
sudo apt-get install mtd-utils
```
### Installing the JVM<a name="section1692618112713"></a>
1. Start a Linux server.
2. Install the Java Runtime Environment \(JRE\).
```
sudo apt-get install default-jre
```
3. Install the Java Development Kit \(JDK\).
```
sudo apt-get install default-jdk
```
# Setting Up the Environment<a name="EN-US_TOPIC_0000001152389293"></a>
- [Environment Requirements](#section1724111409282)
- [Hardware](#section487353718276)
- [Software Requirements](#section17315193935817)
- [Installing Linux Build Tools](#section8831868501)
- [Changing Linux Shell to Bash](#section1715027152617)
- [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section45512412251)
- [Installing a File Packing Tool](#section1686964015274)
- [Installing hc-gen](#section18706403274)
## Environment Requirements<a name="section1724111409282"></a>
### Hardware<a name="section487353718276"></a>
- Hi3518E V300 IoT camera development board
- USB-to-serial cable and network cable \(The Windows workstation is connected to the Hi3518E V300 development board through the USB-to-serial cable and network cable.\)
The following figure shows the hardware connections.
**Figure 1** Hardware connections<a name="fig8211468392"></a>
![](figures/hardware-connections-3.png "hardware-connections-3")
### Software Requirements<a name="section17315193935817"></a>
>![](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](#section8831868501).
The following table describes the tools required for setting up the general environment for a Linux server of the Hi3518 development board and how to obtain these tools.
**Table 1** Development tools and obtaining methods
<a name="table15485545145811"></a>
<table><thead align="left"><tr id="row1748610451588"><th class="cellrowborder" valign="top" width="23.332333233323332%" id="mcps1.2.4.1.1"><p id="p13486154545816"><a name="p13486154545816"></a><a name="p13486154545816"></a>Development Tool</p>
</th>
<th class="cellrowborder" valign="top" width="14.65146514651465%" id="mcps1.2.4.1.2"><p id="p44867452589"><a name="p44867452589"></a><a name="p44867452589"></a>Description</p>
</th>
<th class="cellrowborder" valign="top" width="62.016201620162015%" id="mcps1.2.4.1.3"><p id="p1748619458583"><a name="p1748619458583"></a><a name="p1748619458583"></a>How to Obtain</p>
</th>
</tr>
</thead>
<tbody><tr id="row18630134151917"><td class="cellrowborder" valign="top" width="23.332333233323332%" headers="mcps1.2.4.1.1 "><p id="p1563113417199"><a name="p1563113417199"></a><a name="p1563113417199"></a>bash</p>
</td>
<td class="cellrowborder" valign="top" width="14.65146514651465%" headers="mcps1.2.4.1.2 "><p id="p463193418190"><a name="p463193418190"></a><a name="p463193418190"></a>Processes CLI commands.</p>
</td>
<td class="cellrowborder" valign="top" width="62.016201620162015%" headers="mcps1.2.4.1.3 "><p id="p1063118344191"><a name="p1063118344191"></a><a name="p1063118344191"></a>System configuration</p>
</td>
</tr>
<tr id="row7598468212"><td class="cellrowborder" valign="top" width="23.332333233323332%" headers="mcps1.2.4.1.1 "><p id="p659815642111"><a name="p659815642111"></a><a name="p659815642111"></a>Basic software package for compilation and building (required only for Ubuntu 20+)</p>
</td>
<td class="cellrowborder" valign="top" width="14.65146514651465%" headers="mcps1.2.4.1.2 "><p id="p137174662119"><a name="p137174662119"></a><a name="p137174662119"></a>Provides a basic software package for compilation and building.</p>
</td>
<td class="cellrowborder" valign="top" width="62.016201620162015%" headers="mcps1.2.4.1.3 "><p id="p125983652118"><a name="p125983652118"></a><a name="p125983652118"></a>Internet</p>
</td>
</tr>
<tr id="row08231641105420"><td class="cellrowborder" valign="top" width="23.332333233323332%" headers="mcps1.2.4.1.1 "><p id="p1682494111548"><a name="p1682494111548"></a><a name="p1682494111548"></a>dosfstools, mtools, and mtd-utils</p>
</td>
<td class="cellrowborder" valign="top" width="14.65146514651465%" headers="mcps1.2.4.1.2 "><p id="p1362445934918"><a name="p1362445934918"></a><a name="p1362445934918"></a>Pack files.</p>
</td>
<td class="cellrowborder" valign="top" width="62.016201620162015%" headers="mcps1.2.4.1.3 "><p id="p1262475944916"><a name="p1262475944916"></a><a name="p1262475944916"></a>apt-get install</p>
</td>
</tr>
</tbody>
</table>
## Installing Linux Build Tools<a name="section8831868501"></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 **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 && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
```
### Installing a File Packing Tool<a name="section1686964015274"></a>
1. Start a Linux server.
2. Install **dosfstools**.
```
sudo apt-get install dosfstools
```
3. Install **mtools**.
```
sudo apt-get install mtools
```
4. Install **mtd-utils**.
```
sudo apt-get install mtd-utils
```
### Installing hc-gen<a name="section18706403274"></a>
1. Start a Linux server.
2. Download [hc-gen](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar).
3. Decompress the hc-gen installation package to **\~/hc-gen** on the Linux server.
```
tar -xvf hc-gen-0.65-linux.tar -C ~/
```
4. Set an environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the **.bashrc** file, save the file, and exit.
```
export PATH=~/hc-gen:$PATH
```
5. Validate the environment variable.
```
source ~/.bashrc
```
......@@ -4,7 +4,7 @@
- [Hardware](#section19202111020215)
- [Software](#section727451210318)
- [Install Linux Build Tools](#section497484245614)
- [Installing Linux Build Tools](#section497484245614)
- [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section45512412251)
- [Installing Scons](#section7438245172514)
- [Installing Python Modules](#section88701892341)
......@@ -94,7 +94,7 @@ The following table lists the tools required for the Hi3861 development board.
</tbody>
</table>
## Install Linux Build Tools<a name="section497484245614"></a>
## 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**.
......@@ -320,7 +320,7 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
>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 /opt
> tar -xvf gcc_riscv32-linux-7.3.0.tar.gz -C ~
> ```
>2. Set an environment variable.
> ```
......@@ -328,7 +328,7 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
> ```
>3. Copy the following command to the last line of the **.bashrc** file, save the file, and exit.
> ```
> export PATH=/opt/gcc_riscv32/bin:$PATH
> export PATH=~/gcc_riscv32/bin:$PATH
> ```
```
......@@ -338,7 +338,7 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
Copy the following command to the last line of the **.bashrc** file, save the file, and exit.
```
export PATH=/opt/gcc_riscv32/bin:$PATH
export PATH=~/gcc_riscv32/bin:$PATH
```
17. Validate the environment variable.
......
# Standard System<a name="EN-US_TOPIC_0000001111221726"></a>
- **[Overview](overview-6.md)**
- **[Overview](overview-7.md)**
- **[Environment Setup](environment-setup-7.md)**
- **[Environment Setup](environment-setup-8.md)**
- **[How to Develop](how-to-develop-12.md)**
......
# Windows Development Environment<a name="EN-US_TOPIC_0000001114978364"></a>
- [Obtaining the Software](#en-us_topic_0000001058091994_section1483143015558)
- [Installing Visual Studio Code](#en-us_topic_0000001058091994_section71401018163318)
- [Installing Python](#en-us_topic_0000001058091994_section16266553175320)
- [Installing Node.js](#en-us_topic_0000001058091994_section5353233124511)
- [Installing hpm](#en-us_topic_0000001058091994_section173054793610)
- [Installing the DevEco Device Tool Plug-in](#en-us_topic_0000001058091994_section4336315185716)
Operating system: 64-bit version of Windows 10.
DevEco Device Tool is a plug-in for Visual Studio Code. The installation procedure includes five parts:
1. Installing Visual Studio Code
2. Installing Python
3. Installing Node.js
4. Installing hpm
5. Installing the DevEco Device Tool Plug-in
## Obtaining the Software<a name="en-us_topic_0000001058091994_section1483143015558"></a>
<a name="en-us_topic_0000001058091994_table12730195765616"></a>
<table><thead align="left"><tr id="en-us_topic_0000001058091994_row6730125785610"><th class="cellrowborder" valign="top" width="19.49%" id="mcps1.1.5.1.1"><p id="en-us_topic_0000001058091994_p1573065716561"><a name="en-us_topic_0000001058091994_p1573065716561"></a><a name="en-us_topic_0000001058091994_p1573065716561"></a>Tool</p>
</th>
<th class="cellrowborder" valign="top" width="20.5%" id="mcps1.1.5.1.2"><p id="en-us_topic_0000001058091994_p197306572566"><a name="en-us_topic_0000001058091994_p197306572566"></a><a name="en-us_topic_0000001058091994_p197306572566"></a>Description</p>
</th>
<th class="cellrowborder" valign="top" width="20.03%" id="mcps1.1.5.1.3"><p id="en-us_topic_0000001058091994_p373085711569"><a name="en-us_topic_0000001058091994_p373085711569"></a><a name="en-us_topic_0000001058091994_p373085711569"></a>Version</p>
</th>
<th class="cellrowborder" valign="top" width="39.98%" id="mcps1.1.5.1.4"><p id="en-us_topic_0000001058091994_p197309576566"><a name="en-us_topic_0000001058091994_p197309576566"></a><a name="en-us_topic_0000001058091994_p197309576566"></a>Obtaining Channel</p>
</th>
</tr>
</thead>
<tbody><tr id="en-us_topic_0000001058091994_row12730155765618"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.1 "><p id="en-us_topic_0000001058091994_p123931728135713"><a name="en-us_topic_0000001058091994_p123931728135713"></a><a name="en-us_topic_0000001058091994_p123931728135713"></a>Visual Studio Code</p>
</td>
<td class="cellrowborder" valign="top" width="20.5%" headers="mcps1.1.5.1.2 "><p id="en-us_topic_0000001058091994_p12332194816317"><a name="en-us_topic_0000001058091994_p12332194816317"></a><a name="en-us_topic_0000001058091994_p12332194816317"></a>Code editing tool</p>
</td>
<td class="cellrowborder" valign="top" width="20.03%" headers="mcps1.1.5.1.3 "><p id="en-us_topic_0000001058091994_p711918919618"><a name="en-us_topic_0000001058091994_p711918919618"></a><a name="en-us_topic_0000001058091994_p711918919618"></a>V1.53 or later (64-bit)</p>
</td>
<td class="cellrowborder" valign="top" width="39.98%" headers="mcps1.1.5.1.4 "><p id="en-us_topic_0000001058091994_p2721438193710"><a name="en-us_topic_0000001058091994_p2721438193710"></a><a name="en-us_topic_0000001058091994_p2721438193710"></a><a href="https://code.visualstudio.com/Download" target="_blank" rel="noopener noreferrer">https://code.visualstudio.com/Download</a></p>
</td>
</tr>
<tr id="en-us_topic_0000001058091994_row187311257185619"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.1 "><p id="en-us_topic_0000001058091994_p21270444579"><a name="en-us_topic_0000001058091994_p21270444579"></a><a name="en-us_topic_0000001058091994_p21270444579"></a>Python</p>
</td>
<td class="cellrowborder" valign="top" width="20.5%" headers="mcps1.1.5.1.2 "><p id="en-us_topic_0000001058091994_p547205817316"><a name="en-us_topic_0000001058091994_p547205817316"></a><a name="en-us_topic_0000001058091994_p547205817316"></a>Programming tool</p>
</td>
<td class="cellrowborder" valign="top" width="20.03%" headers="mcps1.1.5.1.3 "><p id="en-us_topic_0000001058091994_p1991315166416"><a name="en-us_topic_0000001058091994_p1991315166416"></a><a name="en-us_topic_0000001058091994_p1991315166416"></a>v3.7.4–3.8.x (64-bit)</p>
</td>
<td class="cellrowborder" valign="top" width="39.98%" headers="mcps1.1.5.1.4 "><p id="en-us_topic_0000001058091994_p1599022403"><a name="en-us_topic_0000001058091994_p1599022403"></a><a name="en-us_topic_0000001058091994_p1599022403"></a><a href="https://www.python.org/downloads/" target="_blank" rel="noopener noreferrer">https://www.python.org/downloads/</a></p>
</td>
</tr>
<tr id="en-us_topic_0000001058091994_row117316576562"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.1 "><p id="en-us_topic_0000001058091994_p16405151165717"><a name="en-us_topic_0000001058091994_p16405151165717"></a><a name="en-us_topic_0000001058091994_p16405151165717"></a>Node.js</p>
</td>
<td class="cellrowborder" valign="top" width="20.5%" headers="mcps1.1.5.1.2 "><p id="en-us_topic_0000001058091994_p1773185765616"><a name="en-us_topic_0000001058091994_p1773185765616"></a><a name="en-us_topic_0000001058091994_p1773185765616"></a>The npm environment provider</p>
</td>
<td class="cellrowborder" valign="top" width="20.03%" headers="mcps1.1.5.1.3 "><p id="en-us_topic_0000001058091994_p573118572567"><a name="en-us_topic_0000001058091994_p573118572567"></a><a name="en-us_topic_0000001058091994_p573118572567"></a>v12.0.0 or later (64-bit)</p>
</td>
<td class="cellrowborder" valign="top" width="39.98%" headers="mcps1.1.5.1.4 "><p id="en-us_topic_0000001058091994_p9200911141112"><a name="en-us_topic_0000001058091994_p9200911141112"></a><a name="en-us_topic_0000001058091994_p9200911141112"></a><a href="https://nodejs.org/en/download/" target="_blank" rel="noopener noreferrer">https://nodejs.org/en/download/</a></p>
</td>
</tr>
<tr id="en-us_topic_0000001058091994_row6731105715561"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.1 "><p id="en-us_topic_0000001058091994_p2081865318571"><a name="en-us_topic_0000001058091994_p2081865318571"></a><a name="en-us_topic_0000001058091994_p2081865318571"></a>hpm</p>
</td>
<td class="cellrowborder" valign="top" width="20.5%" headers="mcps1.1.5.1.2 "><p id="en-us_topic_0000001058091994_p1632215161040"><a name="en-us_topic_0000001058091994_p1632215161040"></a><a name="en-us_topic_0000001058091994_p1632215161040"></a>Package manager</p>
</td>
<td class="cellrowborder" valign="top" width="20.03%" headers="mcps1.1.5.1.3 "><p id="en-us_topic_0000001058091994_p773185715566"><a name="en-us_topic_0000001058091994_p773185715566"></a><a name="en-us_topic_0000001058091994_p773185715566"></a>Latest version</p>
</td>
<td class="cellrowborder" valign="top" width="39.98%" headers="mcps1.1.5.1.4 "><p id="en-us_topic_0000001058091994_p14731125745610"><a name="en-us_topic_0000001058091994_p14731125745610"></a><a name="en-us_topic_0000001058091994_p14731125745610"></a>Run the following command:</p>
<pre class="screen" id="en-us_topic_0000001058091994_screen54628167163"><a name="en-us_topic_0000001058091994_screen54628167163"></a><a name="en-us_topic_0000001058091994_screen54628167163"></a>npm install -g @ohos/hpm-cli</pre>
</td>
</tr>
<tr id="en-us_topic_0000001058091994_row13317205645717"><td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.1 "><p id="en-us_topic_0000001058091994_p143411112587"><a name="en-us_topic_0000001058091994_p143411112587"></a><a name="en-us_topic_0000001058091994_p143411112587"></a>DevEco Device Tool</p>
</td>
<td class="cellrowborder" valign="top" width="20.5%" headers="mcps1.1.5.1.2 "><p id="en-us_topic_0000001058091994_p1690316506517"><a name="en-us_topic_0000001058091994_p1690316506517"></a><a name="en-us_topic_0000001058091994_p1690316506517"></a>Plug-in for the OpenHarmony source code compilation, programming, and debugging</p>
</td>
<td class="cellrowborder" valign="top" width="20.03%" headers="mcps1.1.5.1.3 "><p id="en-us_topic_0000001058091994_p113171956185715"><a name="en-us_topic_0000001058091994_p113171956185715"></a><a name="en-us_topic_0000001058091994_p113171956185715"></a>v2.2 Beta1</p>
</td>
<td class="cellrowborder" valign="top" width="39.98%" headers="mcps1.1.5.1.4 "><p id="en-us_topic_0000001058091994_p3503163074720"><a name="en-us_topic_0000001058091994_p3503163074720"></a><a name="en-us_topic_0000001058091994_p3503163074720"></a><a href="https://device.harmonyos.com/en/ide#download" target="_blank" rel="noopener noreferrer">https://device.harmonyos.com/en/ide#download</a></p>
<p id="en-us_topic_0000001058091994_p23171856135717"><a name="en-us_topic_0000001058091994_p23171856135717"></a><a name="en-us_topic_0000001058091994_p23171856135717"></a>Log in with your HUAWEI ID to download it. You can <a href="https://developer.huawei.com/consumer/en/doc/start/registration-and-verification-0000001053628148" target="_blank" rel="noopener noreferrer">register an account here</a>.</p>
</td>
</tr>
</tbody>
</table>
## Installing Visual Studio Code<a name="en-us_topic_0000001058091994_section71401018163318"></a>
>![](public_sys-resources/icon-note.gif) **NOTE:**
>If you have installed Visual Studio Code, open the CLT and run **code --version** to check whether the version is 1.53 or later. If the version number is returned, it indicates that the environment variables are set correctly.
1. Double-click the Visual Studio Code package to install it. During the installation, select **Add to PATH \(requires shell restart\)**.
![](figures/en-us_image_0000001057335403.png)
2. After the installation is complete, restart the computer for the environment variables of Visual Studio Code to take effect.
3. Open the CLT and run **code --version**. If the version number can be displayed, it indicates that the installation is successful.
## Installing Python<a name="en-us_topic_0000001058091994_section16266553175320"></a>
1. Double-click the Python software package, select **Add Python xx to PATH**, and click **Install Now**.
![](figures/en-us_image_0000001096154076.png)
2. After the installation is complete, click **Close**.
![](figures/en-us_image_0000001142794291.png)
3. Open the CLT, and run **python --version** to check the installation result.
![](figures/en-us_image_0000001143154485.png)
4. In the CLT, run the following commands to set the pip source for downloading the dependencies required for later installation:
```
pip config set global.trusted-host repo.huaweicloud.com
pip config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple
pip config set global.timeout 120
```
## Installing Node.js<a name="en-us_topic_0000001058091994_section5353233124511"></a>
>![](public_sys-resources/icon-note.gif) **NOTE:**
>If you have installed Node.js, open the CLT and run **node -v** to check whether the version is 12.0.0 or later.
1. Run the downloaded software package to install. Use the default settings when following the installation wizard, and click **Next** until **Finish** is displayed. During the installation, Node.js will automatically set the system Path environment variable to the installation directory of **node.exe**.
2. Open the CLT and run **node -v**. If the version number of Node.js is displayed, it indicates that Node.js has been successfully installed.
![](figures/en-us_image_0000001056814287.png)
## Installing hpm<a name="en-us_topic_0000001058091994_section173054793610"></a>
Before installing hpm, ensure that Node.js has been installed
and that your network can access the Internet. If your network requires a proxy to access the Internet, [set up the npm proxy](https://device.harmonyos.com/cn/docs/ide/user-guides/npm_proxy-0000001054491032) first.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>If hpm has been installed, run **npm update -g @ohos/hpm-cli** to update it to the latest version.
1. You are advised to set the npm source to an image in China, for example, a HUAWEI CLOUD image source.
```
npm config set registry https://repo.huaweicloud.com/repository/npm/
```
2. Open the CLT and run the following command to install the latest version of hpm:
```
npm install -g @ohos/hpm-cli
```
![](figures/en-us_image_0000001073840162.png)
3. After the installation is complete, run the following command to obtain the installation result:
```
hpm -V
```
![](figures/en-us_image_0000001100641602.png)
## Installing the DevEco Device Tool Plug-in<a name="en-us_topic_0000001058091994_section4336315185716"></a>
To install the DevEco Device Tool plug-in, ensure that the **user name of the host cannot contain Chinese characters**; otherwise, the plug-in may fail to run.
DevEco Device Tool will automatically download and install the C/C++ and CodeLLDB plug-ins from the Visual Studio Code Marketplace during the installation process. Therefore, make sure Visual Studio Code can access the Internet. If your network requires a proxy to access the Internet, [set up the Visual Studio Code proxy](https://device.harmonyos.com/cn/docs/ide/user-guides/vscode_proxy-0000001074231144) first.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>Before installing DevEco Device Tool, ensure that Visual Studio Code is closed.
1. Decompress the DevEco Device Tool plug-in package and double-click the installer to install.
2. During the installation, the dependency files \(such as C/C++ and CodeLLDB plug-ins\) and execution programs required by DevEco Device Tool are automatically installed.
![](figures/en-us_image_0000001072468991.png)
3. After the installation is complete, the CLT is automatically closed.
4. Open Visual Studio Code, click the ![](figures/en-us_image_0000001072757874.png) button on the left, and check whether C/C++, CodeLLDB, and DevEco Device Tool are listed in **INSTALLED**.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>If the C/C++ and CodeLLDB plug-ins fail to be installed, DevEco Device Tool cannot run properly. To solve the issue, see [Installing the C/C++ and CodeLLDB Plug-ins Offline](https://device.harmonyos.com/en/docs/ide/user-guides/offline_plugin_install-0000001074376846).
![](figures/en-us_image_0000001142802505.png)
......@@ -75,7 +75,8 @@ You can use the DevEco tool to perform the image burning of the Hi3861 WLAN modu
![](figures/en-us_image_0000001078404538.png)
4. On the **hi3861** tab page, set the programming options.
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 **hi3861** tab page, set the programming options.
- **upload\_port**: Select the serial port number obtained in step [2](#en-us_topic_0000001056563976_li848662117291).
- **upload\_protocol**: Select the programming protocol **burn-serial**.
......@@ -83,17 +84,10 @@ You can use the DevEco tool to perform the image burning of the Hi3861 WLAN modu
![](figures/en-us_image_0000001078244328.png)
5. Modify the settings of the **hi3861\_app** file. In general cases, you can leave the fields at their default settings. To change the default settings, select the target item in the **New Option** field first.
![](figures/en-us_image_0000001120802173.png)
6. When you finish modifying, click **Save** in the upper right corner.
7. Open the project file. In the DevEco Device Tool window, go to **PROJECT TASKS** \> **hi3861** \> **Upload** to start programming.
![](figures/en-us_image_0000001078313582.png)
7. Open the project file. In the DevEco Device Tool window, go to **PROJECT TASKS** \> **env:hi3861** \> **Upload** to start programming.
![](figures/en-us_image_0000001120802383.png)
![](figures/en-us_image_0000001163569275.png)
8. When the following information is displayed, press the RST button on the development board to restart it.
......
# hdc\_std FAQs<a name="EN-US_TOPIC_0000001119447290"></a>
- [hdc\_std Fails to Connect to a Device](#section1221016541119)
- [hdc\_std Fails to Run](#section219185710311)
## hdc\_std Fails to Connect to a Device<a name="section1221016541119"></a>
- **Symptom**
**\[Empty\]** is displayed in the output after the **hdc\_std list targets** command is run.
- **Possible Causes and Solutions**
1. The device cannot be identified.
Check whether **HDC Device** exists in the universal serial bus device of the device manager. If **HDC Device** does not exist, the device cannot be connected. In this case, remove and then insert the device or burn the latest image for the device.
2. hdc\_std works improperly.
Run the **hdc kill** or **hdc start -r** command to kill or restart the hdc service, and then run the **hdc list targets** command to check whether device information is obtained.
If no device information is obtained, check whether the adb process exists in the task manager. If the adb process exists, kill this process because it may affect the hdc service. After that, run **hdc kill** or **hdc start -r** and then **hdc list targets** again.
3. hdc\_std does not match the device.
If the latest image is burnt for the device, hdc\_std must also be of the latest version. As hdc\_std is updated continuously, obtain hdc\_std of the latest version from the **developtools\_hdc\_standard** repository in the **prebuilt** directory.
## hdc\_std Fails to Run<a name="section219185710311"></a>
- **Symptom**
The **hdc\_std.exe** file does not run after being clicked.
- **Possible Causes and Solutions**
**hdc\_std.exe** requires no installation and can be directly used on a disk. It can also be added to environment variables. Open the cmd window and run the **hdc\_std** command to use **hdc\_std.exe**.
......@@ -212,9 +212,9 @@ Stops a service process.
**Table 5** Command description
<a name="table540423782919"></a>
<table><tbody><tr id="row8404937152910"><td class="cellrowborder" valign="top" width="50%"><p id="p7404113711295"><a name="p7404113711295"></a><a name="p7404113711295"></a><strong id="b250850493"><a name="b250850493"></a><a name="b250850493"></a>Parameter</strong></p>
<table><tbody><tr id="row8404937152910"><td class="cellrowborder" valign="top" width="50%"><p id="p7404113711295"><a name="p7404113711295"></a><a name="p7404113711295"></a><strong id="b892176915"><a name="b892176915"></a><a name="b892176915"></a>Parameter</strong></p>
</td>
<td class="cellrowborder" valign="top" width="50%"><p id="p4405193792919"><a name="p4405193792919"></a><a name="p4405193792919"></a><strong id="b774952731"><a name="b774952731"></a><a name="b774952731"></a>Description</strong></p>
<td class="cellrowborder" valign="top" width="50%"><p id="p4405193792919"><a name="p4405193792919"></a><a name="p4405193792919"></a><strong id="b1368677681"><a name="b1368677681"></a><a name="b1368677681"></a>Description</strong></p>
</td>
</tr>
<tr id="row174051037112912"><td class="cellrowborder" valign="top" width="50%"><p id="p134056375291"><a name="p134056375291"></a><a name="p134056375291"></a>-r</p>
......@@ -222,9 +222,9 @@ Stops a service process.
<td class="cellrowborder" valign="top" width="50%"><p id="p18405337142911"><a name="p18405337142911"></a><a name="p18405337142911"></a>Triggers the service restart.</p>
</td>
</tr>
<tr id="row164052037162913"><td class="cellrowborder" valign="top" width="50%"><p id="p124051837182918"><a name="p124051837182918"></a><a name="p124051837182918"></a><strong id="b2067039134"><a name="b2067039134"></a><a name="b2067039134"></a>Return Value</strong></p>
<tr id="row164052037162913"><td class="cellrowborder" valign="top" width="50%"><p id="p124051837182918"><a name="p124051837182918"></a><a name="p124051837182918"></a><strong id="b684557688"><a name="b684557688"></a><a name="b684557688"></a>Return Value</strong></p>
</td>
<td class="cellrowborder" valign="top" width="50%"><p id="p8405113782918"><a name="p8405113782918"></a><a name="p8405113782918"></a><strong id="b539675609"><a name="b539675609"></a><a name="b539675609"></a>Description</strong></p>
<td class="cellrowborder" valign="top" width="50%"><p id="p8405113782918"><a name="p8405113782918"></a><a name="p8405113782918"></a><strong id="b770856573"><a name="b770856573"></a><a name="b770856573"></a>Description</strong></p>
</td>
</tr>
<tr id="row15405163702915"><td class="cellrowborder" valign="top" width="50%"><p id="p0976152811311"><a name="p0976152811311"></a><a name="p0976152811311"></a>①Kill server finish</p>
......@@ -248,7 +248,7 @@ Starts the service process.
**Table 6** Command description
<a name="table11605125417348"></a>
<table><tbody><tr id="row176051354123419"><td class="cellrowborder" valign="top" width="50%"><p id="p16605185413418"><a name="p16605185413418"></a><a name="p16605185413418"></a><strong id="b2072965358"><a name="b2072965358"></a><a name="b2072965358"></a>Parameter</strong></p>
<table><tbody><tr id="row176051354123419"><td class="cellrowborder" valign="top" width="50%"><p id="p16605185413418"><a name="p16605185413418"></a><a name="p16605185413418"></a><strong id="b121603420"><a name="b121603420"></a><a name="b121603420"></a>Parameter</strong></p>
</td>
<td class="cellrowborder" valign="top" width="50%"><p id="p3605125413346"><a name="p3605125413346"></a><a name="p3605125413346"></a><strong id="b415620225414"><a name="b415620225414"></a><a name="b415620225414"></a>Description</strong></p>
</td>
......@@ -258,9 +258,9 @@ Starts the service process.
<td class="cellrowborder" valign="top" width="50%"><p id="p1860525413414"><a name="p1860525413414"></a><a name="p1860525413414"></a>Restarts the service process if it has started.</p>
</td>
</tr>
<tr id="row14606154183415"><td class="cellrowborder" valign="top" width="50%"><p id="p160695453412"><a name="p160695453412"></a><a name="p160695453412"></a><strong id="b575170795"><a name="b575170795"></a><a name="b575170795"></a>Return Value</strong></p>
<tr id="row14606154183415"><td class="cellrowborder" valign="top" width="50%"><p id="p160695453412"><a name="p160695453412"></a><a name="p160695453412"></a><strong id="b1842320248"><a name="b1842320248"></a><a name="b1842320248"></a>Return Value</strong></p>
</td>
<td class="cellrowborder" valign="top" width="50%"><p id="p1606154163419"><a name="p1606154163419"></a><a name="p1606154163419"></a><strong id="b1208563473"><a name="b1208563473"></a><a name="b1208563473"></a>Description</strong></p>
<td class="cellrowborder" valign="top" width="50%"><p id="p1606154163419"><a name="p1606154163419"></a><a name="p1606154163419"></a><strong id="b1413594554"><a name="b1413594554"></a><a name="b1413594554"></a>Description</strong></p>
</td>
</tr>
<tr id="row7606135433416"><td class="cellrowborder" valign="top" width="50%"><p id="p716462216389"><a name="p716462216389"></a><a name="p716462216389"></a>None</p>
......@@ -438,7 +438,7 @@ Sends a file to a remote device.
Example:
hdc\_std file send E:\\a.txt /data/local/tmp
hdc\_std file send E:\\a.txt /data/local/tmp/a.txt
- **file recv \[-a\] _remote local_**
......@@ -484,7 +484,7 @@ Receives a file from a remote device.
Example:
hdc\_std file recv /tmp/fileb ./
hdc\_std file recv /data/local/tmp/a.txt ./a.txt
## App Commands<a name="section2072647133819"></a>
......
......@@ -4,4 +4,6 @@
- **[hdc\_std Usage Guidelines](hdc_std-usage-guidelines.md)**
- **[hdc\_std FAQs](hdc_std-faqs.md)**
# 常见问题<a name="ZH-CN_TOPIC_0000001167349549"></a>
- [hdc\_std连接不到设备](#section1221016541119)
- [hdc\_std运行不了](#section219185710311)
## hdc\_std连接不到设备<a name="section1221016541119"></a>
- **现象描述**
执行 "hdc\_std list targets"命令后结果为:\[Empty\]
- **可能原因和解决方法**
1. 设备没有被识别:
在设备管理器中查看是否有hdc设备,在通用串行总线设备中会有“HDC Device”信息。如果没有,hdc无法连接。此时需要插拔设备,或者烧写最新的镜像。
2. hdc\_std工作异常:
可以执行"hdc kill"或者"hdc start -r"杀掉hdc服务或者重启hdc服务,然后再执行hdc list targets查看是否已经可以获取设备信息。
如果一直获取不到设备信息,请在任务管理器中查询是否有adb进程,该进程可能会对hdc产生干扰,可以将其杀掉后重复执行上面的步骤。
3. hdc\_std与设备不匹配:
如果设备烧写的是最新镜像,hdc\_std也需要使用最新版本。由于hdc\_std会持续更新,请从开源仓developtools\_hdc\_standard中获取,具体位置在该开源仓的prebuilt目录。
## hdc\_std运行不了<a name="section219185710311"></a>
- **现象描述**
点击hdc\_std.exe文件无法运行。
- **可能原因和解决方法**
hdc\_std.exe不需要安装,直接放到磁盘上就能使用,也可以添加到环境变量中。通过打开cmd执行hdc\_std命令直接使用。
......@@ -10,4 +10,6 @@
- **[真机运行](真机运行-9.md)**
- **[常见问题](常见问题-10.md)**
......@@ -52,13 +52,12 @@ sudo apt-get install binutils git-core git-lfs gnupg flex bison gperf build-esse
### 获取prebuilts<a name="section16453104219209"></a>
1. 在源码根目录下执行脚本。
1. 在源码根目录下执行脚本。
```
build/prebuilts_download.sh
```
下载的prebuilts二进制默认存放在与OpenHarmony同目录下的OpenHarmony\_2.0\_canary\_prebuilts下。
```
build/prebuilts_download.sh
```
下载的prebuilts二进制默认存放在与OpenHarmony同目录下的OpenHarmony\_2.0\_canary\_prebuilts下。
# Ubuntu编译环境准备<a name="ZH-CN_TOPIC_0000001105407498"></a>
- [获取软件](#section1897711811517)
- [获取OpenHarmony源码](#section1545225464016)
- [获取源码](#section1545225464016)
- [安装和配置Python](#section1238412211211)
- [安装gn](#section29216201423)
- [安装ninja](#section8762358731)
- [安装hc-gen](#section4924165316437)
- [安装LLVM](#section12202192215415)
- [安装hb](#section15794154618411)
- [前提条件](#section1083283711515)
......@@ -21,9 +20,8 @@
2. 安装和配置python
3. 安装gn
4. 安装ninja
5. 安装hc-gen
6. 安装LLVM
7. 安装hb
5. 安装LLVM
6. 安装hb
>![](public_sys-resources/icon-notice.gif) **须知:**
>- 针对Ubuntu编译环境我们提供了对应的Docker,该Docker封装了相关编译工具,选择使用Docker的开发者可跳过此章节。Docker使用可参考[Docker方式获取编译环境](../get-code/获取工具.md)。
......@@ -73,13 +71,6 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示
<td class="cellrowborder" valign="top" width="62%" headers="mcps1.2.4.1.3 "><p id="p1923373393515"><a name="p1923373393515"></a><a name="p1923373393515"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar</a></p>
</td>
</tr>
<tr id="row18800428194715"><td class="cellrowborder" valign="top" width="13.350000000000001%" headers="mcps1.2.4.1.1 "><p id="p280042884712"><a name="p280042884712"></a><a name="p280042884712"></a>hc-gen</p>
</td>
<td class="cellrowborder" valign="top" width="24.65%" headers="mcps1.2.4.1.2 "><p id="p15800428174711"><a name="p15800428174711"></a><a name="p15800428174711"></a>驱动编译工具</p>
</td>
<td class="cellrowborder" valign="top" width="62%" headers="mcps1.2.4.1.3 "><p id="p10800828174712"><a name="p10800828174712"></a><a name="p10800828174712"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar</a></p>
</td>
</tr>
<tr id="row7531362055"><td class="cellrowborder" rowspan="2" valign="top" width="13.350000000000001%" headers="mcps1.2.4.1.1 "><p id="p1467122152710"><a name="p1467122152710"></a><a name="p1467122152710"></a></p>
<p id="p15217227174016"><a name="p15217227174016"></a><a name="p15217227174016"></a>LLVM</p>
<p id="p689515112108"><a name="p689515112108"></a><a name="p689515112108"></a></p>
......@@ -109,7 +100,7 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装gn、ninja编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装gn、ninja、LLVM编译工具。安装gn、ninja、LLVM编译工具时,请确保编译工具的环境变量路径唯一。
## 获取OpenHarmony源码<a name="section1545225464016"></a>
## 获取源码<a name="section1545225464016"></a>
开发者需要在Linux服务器上下载并解压一套源代码,请参见[源码获取](../get-code/源码获取.md)
......@@ -247,35 +238,6 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示
```
## 安装hc-gen<a name="section4924165316437"></a>
1. 打开Linux编译服务器终端。
2. [下载hc-gen工具](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar)
3. 解压hc-gen安装包到Linux服务器\~/hc-gen路径下。
```
tar -xvf hc-gen-0.65-linux.tar -C ~/
```
4. 设置环境变量。
```
vim ~/.bashrc
```
将以下命令拷贝到.bashrc文件的最后一行,保存并退出。
```
export PATH=~/hc-gen:$PATH
```
5. 生效环境变量。
```
source ~/.bashrc
```
## 安装LLVM<a name="section12202192215415"></a>
1. 打开Linux编译服务器终端。
......
......@@ -7,8 +7,7 @@
- [安装Linux服务器工具](#section182916865219)
- [将Linux shell改为bash](#section1715027152617)
- [安装编译依赖基础软件(仅Ubuntu 20+需要)](#section45512412251)
- [安装文件打包工具](#section1969111820270)
- [安装Java 虚拟机环境](#section1692618112713)
- [安装文件打包工具及Java虚拟机环境](#section16199102083717)
## Hi3516工具要求<a name="section179175261196"></a>
......@@ -108,44 +107,16 @@ sudo ln -s /bin/bash /bin/sh
执行以下命令进行安装:
```
sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
sudo apt-get install build-essential gcc g++ make zlib* libffi-dev
```
### 安装文件打包工具<a name="section1969111820270"></a>
### 安装文件打包工具及Java虚拟机环境<a name="section16199102083717"></a>
1. 打开Linux编译服务器终端
2. 运行如下命令,安装dosfstools。
1. 打开Linux编译服务器终端
2. 运行如下命令,安装dosfstools,mtools,mtd-utils,Java运行时环境(JRE)和Java sdk 开发工具包
```
sudo apt-get install dosfstools
```
3. 运行如下命令,安装mtools。
```
sudo apt-get install mtools
```
4. 运行如下命令,安装mtd-utils。
```
sudo apt-get install mtd-utils
```
### 安装Java 虚拟机环境<a name="section1692618112713"></a>
1. 打开Linux编译服务器终端。
2. 安装Java运行时环境(JRE)。
```
sudo apt-get install default-jre
```
3. 安装Java sdk开发工具包。
```
sudo apt-get install default-jdk
sudo spt-get install dosftools mtools mtd-utils default-jre default-jdk
```
......@@ -5,10 +5,9 @@
- [软件要求](#section17315193935817)
- [安装Linux服务器工具](#section8831868501)
- [将Linux shell改为bash](#section1715027152617)
- [安装编译依赖基础软件(仅Ubuntu 20+需要)](#section45512412251)
- [安装文件打包工具](#section1686964015274)
- [安装hc-gen](#section18706403274)
- [将Linux shell改为bash](#section434110241084)
- [安装编译依赖基础软件(仅Ubuntu 20+需要)](#section25911132141020)
- [安装文件打包工具](#section390214473129)
## Hi3518环境搭建<a name="section1724111409282"></a>
......@@ -72,7 +71,7 @@ Hi3518开发板对Linux服务器通用环境配置需要的工具及其获取途
>- 如果通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装hc-gen编译工具。
>- (推荐)如果通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装hc-gen编译工具。安装hc-gen编译工具时,请确保编译工具的环境变量路径唯一。
### 将Linux shell改为bash<a name="section1715027152617"></a>
### 将Linux shell改为bash<a name="section434110241084"></a>
查看shell是否为bash,在终端运行如下命令
......@@ -95,62 +94,21 @@ sudo rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh
```
### 安装编译依赖基础软件(仅Ubuntu 20+需要)<a name="section45512412251"></a>
### 安装编译依赖基础软件(仅Ubuntu 20+需要)<a name="section25911132141020"></a>
执行以下命令进行安装:
```
sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
sudo apt-get install build-essential gcc g++ make zlib* libffi-dev
```
### 安装文件打包工具<a name="section1686964015274"></a>
### 安装文件打包工具<a name="section390214473129"></a>
1. 打开Linux编译服务器终端。
2. 运行如下命令,安装dosfstools。
2. 运行如下命令,安装dosfstools,mtools,mtd-utils
```
sudo apt-get install dosfstools
```
3. 运行如下命令,安装mtools。
```
sudo apt-get install mtools
```
4. 运行如下命令,安装mtd-utils。
```
sudo apt-get install mtd-utils
```
### 安装hc-gen<a name="section18706403274"></a>
1. 打开Linux编译服务器终端。
2. [下载hc-gen工具](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar)
3. 解压hc-gen安装包到Linux服务器\~/hc-gen路径下。
```
tar -xvf hc-gen-0.65-linux.tar -C ~/
```
4. 设置环境变量。
```
vim ~/.bashrc
```
将以下命令拷贝到.bashrc文件的最后一行,保存并退出。
```
export PATH=~/hc-gen:$PATH
```
5. 生效环境变量。
```
source ~/.bashrc
sudo apt-get install dosfstools mtools mtd-utils
```
......@@ -105,7 +105,7 @@ Hi3861开发板需要的工具如下表所示。
执行以下命令进行安装:
```
sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev
sudo apt-get install build-essential gcc g++ make zlib* libffi-dev
```
### 安装Scons<a name="section7438245172514"></a>
......@@ -320,7 +320,7 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
>如果直接采用编译好的riscv32 gcc包,请参照如下步骤设置环境变量:
>1. 将压缩包解压到根目录
> ```
> tar -xvf gcc_riscv32-linux-7.3.0.tar.gz -C /opt
> tar -xvf gcc_riscv32-linux-7.3.0.tar.gz -C ~
> ```
>2. 设置环境变量。
> ```
......
......@@ -242,5 +242,5 @@ Hi3516DV300开发板使用USB烧录方式,支持Windows系统。如果采用
## 示例开发<a name="section5600113114323"></a>
恭喜!您已经完成了OpenHarmony标准系统的快速入门,接下来可[开发一个小示例](../guide/概述-10.md),进一步熟悉OpenHarmony的开发。
恭喜!您已经完成了OpenHarmony标准系统的快速入门,接下来可[开发一个小示例](../guide/概述-11.md),进一步熟悉OpenHarmony的开发。
# hdc\_std常见问题<a name="ZH-CN_TOPIC_0000001119447290"></a>
- [hdc\_std连接不到设备](#section1221016541119)
- [hdc\_std运行不了](#section219185710311)
## hdc\_std连接不到设备<a name="section1221016541119"></a>
- **现象描述**
执行 "hdc\_std list targets"命令后结果为:\[Empty\]
- **可能原因和解决方法**
1. 设备没有被识别:
在设备管理器中查看是否有hdc设备,在通用串行总线设备中会有“HDC Device”信息。如果没有,hdc无法连接。此时需要插拔设备,或者烧写最新的镜像。
2. hdc\_std工作异常:
可以执行"hdc kill"或者"hdc start -r"杀掉hdc服务或者重启hdc服务,然后再执行hdc list targets查看是否已经可以获取设备信息。
如果一直获取不到设备信息,请在任务管理器中查询是否有adb进程,该进程可能会对hdc产生干扰,可以将其杀掉后重复执行上面的步骤。
3. hdc\_std与设备不匹配:
如果设备烧写的是最新镜像,hdc\_std也需要使用最新版本。由于hdc\_std会持续更新,请从开源仓developtools\_hdc\_standard中获取,具体位置在该开源仓的prebuilt目录。
## hdc\_std运行不了<a name="section219185710311"></a>
- **现象描述**
点击hdc\_std.exe文件无法运行。
- **可能原因和解决方法**
hdc\_std.exe不需要安装,直接放到磁盘上就能使用,也可以添加到环境变量中。通过打开cmd执行hdc\_std命令直接使用。
......@@ -4,4 +4,6 @@
- **[hdc\_std 使用指导](hdc_std-使用指导.md)**
- **[hdc\_std常见问题](hdc_std常见问题.md)**
......@@ -45,6 +45,8 @@
- [DFX](device-dev/subsystems/DFX.md)
- [研发工具链](device-dev/subsystems/研发工具链.md)
- [XTS认证](device-dev/subsystems/XTS认证子系统开发指南.md)
- bundles:[组件开发](device-dev/bundles/Readme-CN.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册