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

!299 update quick start images and steps

Merge pull request !299 from NEEN/master
# Getting Started
- [Environment Setup](environment-setup.md)
- [Basic OS Environment Setup](basic-os-environment-setup.md)
- [Basic OS Environment Setup](basic-os-environment-setup.md)
- [Hi3861 Development Board](hi3861-development-board.md)
- [Introduction to the Hi3861 Development Board](introduction-to-the-hi3861-development-board.md)
......
......@@ -78,7 +78,7 @@ Before setting up the environment for a development board, you must set up the b
</td>
<td class="cellrowborder" valign="top" 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" headers="mcps1.2.5.1.3 "><p id="ace724e00c9094eccb8c600d6ad426ed8"><a name="ace724e00c9094eccb8c600d6ad426ed8"></a><a name="ace724e00c9094eccb8c600d6ad426ed8"></a>Ubuntu 16.04 64-bit or later is used for the Linux OS, and bash is used as the shell.</p>
<td class="cellrowborder" valign="top" headers="mcps1.2.5.1.3 "><p id="ace724e00c9094eccb8c600d6ad426ed8"><a name="ace724e00c9094eccb8c600d6ad426ed8"></a><a name="ace724e00c9094eccb8c600d6ad426ed8"></a>Ubuntu 16.04 64-bit or later is used for the Linux OS.</p>
<div class="note" id="note124531828194919"><a name="note124531828194919"></a><a name="note124531828194919"></a><span class="notetitle"> NOTE: </span><div class="notebody"><p id="p1244243142810"><a name="p1244243142810"></a><a name="p1244243142810"></a>Common software such as samba and vim is installed in the OS by default. Adaptation is required to support Linux file sharing.</p>
</div></div>
</td>
......@@ -170,7 +170,7 @@ The following table describes the tools required for setting up the general envi
</tr>
<tr id="row1644079184919"><td class="cellrowborder" valign="top" width="25.562556255625562%" headers="mcps1.2.4.1.1 "><p id="p744115914493"><a name="p744115914493"></a><a name="p744115914493"></a>hb</p>
</td>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p1244114913492"><a name="p1244114913492"></a><a name="p1244114913492"></a>Compiles the source code.</p>
<td class="cellrowborder" valign="top" width="20.7020702070207%" headers="mcps1.2.4.1.2 "><p id="p1244114913492"><a name="p1244114913492"></a><a name="p1244114913492"></a>Compiles the <span id="text344823833918"><a name="text344823833918"></a><a name="text344823833918"></a>OpenHarmony</span> source code.</p>
</td>
<td class="cellrowborder" valign="top" width="53.73537353735374%" headers="mcps1.2.4.1.3 "><p id="p1463918124619"><a name="p1463918124619"></a><a name="p1463918124619"></a>Internet</p>
</td>
......@@ -189,8 +189,8 @@ You can use Docker to quickly install the Linux environment. For details, see *
## Using an Installation Package to Install the Linux Environment<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, compilation tools like **gn** and **ninja** are not required.
>- \(Recommended\) If you obtain the source code via the mirror site or code repository, install compilation tools such as **gn** and **ninja**. When installing **gn** and **ninja**, ensure that the environment variable paths of the compilation tools are unique.
>- If you acquire the source code using an HPM component or HPM CLI tool, compilation tools like **gn**, **ninja**, **LLVM**, and **hb** are not required.
>- \(Recommended\) If you obtain the source code via the mirror site or code repository, install compilation tools such as **gn**, **ninja**, **LLVM**, and **hb**. When installing a compilation tool, ensure that its environment variable path is unique.
### Connecting to a Linux Server<a name="section723115618340"></a>
......@@ -380,8 +380,7 @@ Using PuTTY to log in to a Linux server from a PC running Windows
**Prerequisites**
- Python 3.7.4 or later has been installed. For details, see [Installing and Configuring Python](#section11255767343).
- The source code has been downloaded. For details, see [Source Code Acquisition](../get-code/source-code-acquisition.md).
Python 3.7.4 or later has been installed. For details, see [Installing and Configuring Python](#section11255767343).
**Installation**
......@@ -439,7 +438,7 @@ python3 -m pip uninstall ohos-build
## Obtaining OpenHarmony Source Code<a name="section1545225464016"></a>
You need to acquire OpenHarmony [source code](https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz), download it on a Linux server, and decompress it. For more obtaining methods, see [Source Code Acquisition](../get-code/source-code-acquisition.md).
You need to acquire [source code](../get-code/源码获取.md), download it on a Linux server, and decompress it.
## FAQ<a name="section19253140111619"></a>
......@@ -521,7 +520,7 @@ The message "module 'platform' has no attribute 'linux\_distribution'" is displa
```
sudo apt-get remove python3-apt
sduo apt-get install python3-apt
sudo apt-get install python3-apt
```
......@@ -437,14 +437,14 @@ Compile and burn images by referring to [Building](developing-the-first-example
![](figures/chuankou1.png)
1. Click **Serial port** to enable it.
2. Enter the serial port number queried in the "Burning" section \(COM11 is used in this example\) and press **Enter** until **hisillicon** is displayed.
1. Click **Monitor** to enable the serial port.
2. Press **Enter** repeatedly until **hisilicon** displays.
3. Go to step [2](developing-the-first-example-program-running-on-hi3516.md#l5b42e79a33ea4d35982b78a22913b0b1) if the board is started for the first time or the startup parameters need to be modified; go to step [3](developing-the-first-example-program-running-on-hi3516.md#ld26f18828aa44c36bfa36be150e60e49) otherwise.
2. \(Mandatory when the board is started for the first time\) Modify the bootcmd and bootargs parameters of U-boot. You need to perform this step only once if the parameters need not to be modified during the operation. The board automatically starts after it is reset.
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>The default waiting time in the U-boot is 2s. You can press **Enter** to interrupt the waiting and run the **reset** command to restart the system after "hisillicon" is displayed.
>The default waiting time in the U-boot is 2s. You can press **Enter** to interrupt the waiting and run the **reset** command to restart the system after "hisilicon" is displayed.
**Table 1** Parameters of the U-boot
......
# Developing the First Example Program Running on Hi3516<a name="EN-US_TOPIC_0000001052906247"></a>
- [Modifying a Program](#s8efc1952ebfe4d1ea717182e108c29bb)
- [Creating a Program](#s8efc1952ebfe4d1ea717182e108c29bb)
- [Building](#section1077671315253)
- [Burning](#section08153912587)
- [Running an Image](#section380511712615)
- [Running a Program](#section5276734182615)
This section describes how to modify, compile, burn, and run the first program, and finally print **Hello OHOS!** on the develop board.
This section describes how to create, compile, burn, and run the first program, and finally print **Hello OHOS!** on the develop board.
## Modifying a Program<a name="s8efc1952ebfe4d1ea717182e108c29bb"></a>
## Creating a Program<a name="s8efc1952ebfe4d1ea717182e108c29bb"></a>
The code of **helloworld.c** in the **applications/sample/camera/app/src** directory 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.
1. Create a directory and the program source code.
```
#include <stdio.h>
#include "los_sample.h"
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.
int main(int argc, char **argv)
{
printf("\n************************************************\n");
printf("\n\t\tHello OHOS!\n");
printf("\n************************************************\n\n");
```
#include <stdio.h>
int main(int argc, char **argv)
{
printf("\n************************************************\n");
printf("\n\t\tHello OHOS!\n");
printf("\n************************************************\n\n");
return 0;
}
```
2. Create a build file.
Create the **applications/sample/camera/apps/BUILD.gn** file. The file content is as follows:
```
import("//build/lite/config/component/lite_component.gni")
lite_component("hello-OHOS") {
features = [ ":helloworld" ]
}
executable("helloworld") {
output_name = "helloworld"
sources = [ "src/helloworld.c" ]
include_dirs = []
defines = []
cflags_c = []
ldflags = []
}
```
3. Add a new component.
Add the configuration of the **hello\_world\_app** component to the **build/lite/components/applications.json** file. The sample code below shows some configurations defined in the **applications.json** file, and the code between **\#\#start\#\#** and **\#\#end\#\#** is the new configuration \(Delete the rows where **\#\#start\#\#** and **\#\#end\#\#** are located after the configurations are added.\)
```
{
"components": [
{
"component": "camera_sample_communication",
"description": "Communication related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/communication"
],
"targets": [
"//applications/sample/camera/communication:sample"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##start##
{
"component": "hello_world_app",
"description": "Communication related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/apps"
],
"targets": [
"//applications/sample/camera/apps:hello-OHOS"
],
"rom": "",
"ram": "",
"output": [],
"adapted_kernel": [ "liteos_a" ],
"features": [],
"deps": {
"components": [],
"third_party": []
}
},
##end##
{
"component": "camera_sample_app",
"description": "Camera related samples.",
"optional": "true",
"dirs": [
"applications/sample/camera/launcher",
"applications/sample/camera/cameraApp",
"applications/sample/camera/setting",
"applications/sample/camera/gallery",
"applications/sample/camera/media"
],
```
4. Modify the board configuration file.
Add the **hello\_world\_app** component to the **vendor/hisilicon/hispark\_taurus/config.json** file. The sample code below shows the configurations of the **applications** subsystem, and the code between **\#\#start\#\#** and **\#\#end\#\#** is the new configuration \(Delete the rows where **\#\#start\#\#** and **\#\#end\#\#** are located after the configurations are added.\)
```
{
"subsystem": "applications",
"components": [
{ "component": "camera_sample_app", "features":[] },
{ "component": "camera_sample_ai", "features":[] },
##start##
{ "component": "hello_world_app", "features":[] },
##end##
{ "component": "camera_screensaver_app", "features":[] }
]
},
```
LOS_Sample(g_num);
return 0;
}
```
## Building<a name="section1077671315253"></a>
......@@ -45,7 +144,7 @@ hb build -f (Start building.)
The result files are generated in the **out/hispark\_taurus/ipcamera\_hispark\_taurus** directory.
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>The U-boot file of the Hi3516 development board can be obtained from the following path: vendor\\hisi\\hi35xx\\hi3516dv300\\uboot\\out\\boot\\u-boot-hi3516dv300.bin
>The U-boot file of the Hi3516D V300 development board can be obtained from the following path: device/hisilicon/hispark\_taurus/sdk\_liteos/uboot/out/boot/u-boot-hi3516dv300.bin
## Burning<a name="section08153912587"></a>
......@@ -71,32 +170,33 @@ The Hi3516 development board allows you to burn flash memory over the USB port,
![](figures/en-us_image_0000001078081434.png)
5. Set the IP address of the network port. You are advised to set the local TCP/IPv4 address on your PC and then set the following options:
5. <a name="en-us_topic_0000001056443961_li1558813168234"></a>Check and set the IP address of the network adapter connected to the development board. For details, see [Setting the IP Address of the Network Port for Programming on Hi3516](https://device.harmonyos.com/en/docs/ide/user-guides/set_ipaddress-0000001141825075).
6. Set the IP address of the network port for programming:
- **upload\_net\_server\_ip**: Select the IP address of your PC, such as 192.168.1.2.
- **upload\_net\_server\_ip**: Select the IP address set in [5](#en-us_topic_0000001056443961_li1558813168234), such as 192.168.1.2.
- **upload\_net\_client\_mask**: Set the subnet mask of the development board, such as 255.255.255.0. Once the **upload\_net\_server\_ip** field is set, this field will be automatically populated.
- **upload\_net\_client\_gw**: Set the gateway of the development board, such as 192.168.1.1. Once the **upload\_net\_server\_ip** field is set, this field will be automatically populated.
- **upload\_net\_client\_ip**: Set the IP address of the development board, such as 92.168.1.3. Once the **upload\_net\_server\_ip** field is set, this field will be automatically populated.
![](figures/en-us_image_0000001078096426.png)
6. Switch between the **hi3516dv300\_fastboothi3516dv300\_kernel**, **hi3516dv300\_rootfs**, and **hi3516dv300\_userfs** tab pages, and modify the settings. 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.
7. Switch between the **hi3516dv300\_fastboothi3516dv300\_kernel**, **hi3516dv300\_rootfs**, and **hi3516dv300\_userfs** tab pages, and modify the settings. 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/2021-01-28_112953.png)
7. When you finish modifying, click **Save** in the upper right corner.
8. When you finish modifying, click **Save** in the upper right corner.
![](figures/2021-01-27_170334-0.png)
![](figures/2021-01-27_170334-2.png)
8. Open the project file and go to ![](figures/2021-01-27_170334-1.png) \> **PROJECT TASKS** \> **env:hi3516dv300** \> **Upload** to start programming.
9. Open the project file and go to ![](figures/2021-01-27_170334-3.png) \> **PROJECT TASKS** \> **env:hi3516dv300** \> **Upload** to start programming.
![](figures/2021-01-27_181244.png)
9. When the following message is displayed, power off the development board and then power it on.
10. When the following message is displayed, power off the development board and then power it on.
![](figures/en-us_image_0000001097124071.png)
10. Start programming. When the following message is displayed, it indicates that the programming is successful.
11. Start programming. When the following message is displayed, it indicates that the programming is successful.
![](figures/en-us_image_0000001072956053.png)
......@@ -113,14 +213,14 @@ The Hi3516 development board allows you to burn flash memory over the USB port,
![](figures/chuankou1.png)
1. Click **Serial port** to enable it.
2. Enter the serial port number queried in the "Burning" section \(COM11 is used in this example\) and press **Enter** until **hisillicon** is displayed.
1. Click **Monitor** to enable the serial port.
2. Press **Enter** repeatedly until **hisilicon** displays.
3. Go to step [2](#l5b42e79a33ea4d35982b78a22913b0b1) if the board is started for the first time or the startup parameters need to be modified; go to step [3](#ld26f18828aa44c36bfa36be150e60e49) otherwise.
2. <a name="l5b42e79a33ea4d35982b78a22913b0b1"></a>\(Mandatory when the board is started for the first time\) Modify the bootcmd and bootargs parameters of U-boot. You need to perform this step only once if the parameters need not to be modified during the operation. The board automatically starts after it is reset.
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>The default waiting time in the U-boot is 2s. You can press **Enter** to interrupt the waiting and run the **reset** command to restart the system after "hisillicon" is displayed.
>The default waiting time in the U-boot is 2s. You can press **Enter** to interrupt the waiting and run the **reset** command to restart the system after "hisilicon" is displayed.
**Table 1** Parameters of the U-boot
......@@ -168,10 +268,8 @@ The Hi3516 development board allows you to burn flash memory over the USB port,
## Running a Program<a name="section5276734182615"></a>
In the root directory, run the **./bin/camera\_app** command to operate the demo program. The compilation result is shown in the following example.
**Figure 4** Program started successfully<a name="fig36537913815"></a>
In the root directory, run the **./bin/helloworld** command to operate the demo program. The compilation result is shown in the following example.
![](figures/qidong.png)
**Figure 4** Successful system startup and program execution<a name="fig1341618411997"></a>
![](figures/successful-system-startup-and-program-execution.png "successful-system-startup-and-program-execution")
# Developing the First Example Program Running on Hi3518<a name="EN-US_TOPIC_0000001053422339"></a>
- [Modifying a Program](#s8efc1952ebfe4d1ea717182e108c29bb)
- [Creating a Program](#section20460103116446)
- [Building](#section234175193114)
- [Burning](#section57955241588)
- [Running an Image](#section62131033183710)
- [Follow-up Learning](#section9712145420182)
This section describes how to modify, compile, burn, and run the first program on the board, and finally print **Hello OHOS!**.
This section describes how to create, compile, burn, and run the first program, and finally print **Hello OHOS!** on the develop board.
## Modifying a Program<a name="s8efc1952ebfe4d1ea717182e108c29bb"></a>
## Creating a Program<a name="section20460103116446"></a>
The following example shows the **helloworld.c** code in the **applications/sample/camera/app/src** directory. You can customize the content to be printed. For example, you can change OHOS to World. You can use either ISO C or C++ to develop a program.
1. Create a directory and the program source code.
```
#include <stdio.h>
#include "los_sample.h"
int main(int argc, char **argv)
{
printf("\n************************************************\n");
printf("\n\t\tHello OHOS!\n");
printf("\n************************************************\n\n");
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.
LOS_Sample(g_num);
```
#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":[] }
]
},
```
return 0;
}
```
## Building<a name="section234175193114"></a>
......@@ -42,10 +140,10 @@ 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-2.png "settings-2")
![](figures/settings-4.png "settings-4")
>![](public_sys-resources/icon-notice.gif) **NOTICE:**
>The U-boot file of the Hi3518 development board can be obtained from the following path: vendor\\hisi\\hi35xx\\hi3518ev300\\uboot\\out\\boot\\u-boot-hi3518ev300.bin
>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="section57955241588"></a>
......@@ -73,13 +171,13 @@ The USB port is the only burning mode supported by the Hi3518 development board.
5. Switch between the **hi3518ev300\_fastboot**, **hi3518ev300\_kernel**, **hi3518ev300\_rootfs**, and **hi3518ev300\_userfs** tab pages, and modify the settings. 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/2021-01-28_112953-3.png)
![](figures/2021-01-28_112953-5.png)
6. When you finish modifying, click **Save** in the upper right corner.
![](figures/2021-01-27_170334-4.png)
![](figures/2021-01-27_170334-6.png)
7. Open the project file, go to ![](figures/2021-01-27_170334-5.png) \> **PROJECT TASKS** \> **partition:hi3518ev300\_fastboot** \> **Erase** to erase U-boot.
7. Open the project file, go to ![](figures/2021-01-27_170334-7.png) \> **PROJECT TASKS** \> **partition:hi3518ev300\_fastboot** \> **Erase** to erase U-boot.
![](figures/2021-01-27_181047.png)
......@@ -110,10 +208,10 @@ The USB port is the only burning mode supported by the Hi3518 development board.
**Figure 2** Serial port connection<a name="fig056645018495"></a>
![](figures/chuankou1-6.png)
![](figures/chuankou1-8.png)
1. Click **Serial port** to enable it.
2. Enter the serial port number queried in the "Burning" section \(COM11 is used in this example\) and press **Enter** until **hisillicon** is displayed.
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.
......@@ -158,10 +256,10 @@ The USB port is the only burning mode supported by the Hi3518 development board.
>![](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/camera\_app** command and then press **Enter**. The system is started successfully if information shown in the following figure is displayed.
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="fig11838403383"></a>
![](figures/successful-system-startup-and-program-execution.png "successful-system-startup-and-program-execution")
**Figure 3** Successful system startup and program execution<a name="fig265662981319"></a>
![](figures/successful-system-startup-and-program-execution-9.png "successful-system-startup-and-program-execution-9")
## Follow-up Learning<a name="section9712145420182"></a>
......
# Developing the First Example Program Running on Hi3861<a name="EN-US_TOPIC_0000001053302600"></a>
- [Building](#section1736014117148)
- [Building](#section191121332125319)
- [Burning Images](#section1610612214150)
- [Connecting WLAN Module to the Internet](#section168257461059)
This example shows how to connect the WLAN module to the gateway using attention \(AT\) commands.
## Building<a name="section1736014117148"></a>
## Building<a name="section191121332125319"></a>
This section describes how to perform the WLAN module building on a Linux server.
......@@ -17,35 +17,35 @@ If the Linux environment is installed using Docker, perform the building by refe
**Figure 1** Starting the IDE terminal tool<a name="fig1975813338510"></a>
![](figures/en-us_image_0000001055040538.png)
![](figures/1.png)
On the TERMINAL page, run the ssh command, for example, **ssh** **_user_@_ipaddr_**, to connect to the Linux server.
On the **TERMINAL** panel, run the ssh command, for example, **ssh** **_user_@_ipaddr_**, to connect to the Linux server.
**Figure 2** TERMINAL page<a name="fig91165301546"></a>
**Figure 2** TERMINAL panel<a name="fig91165301546"></a>
![](figures/en-us_image_0000001054599199.png)
![](figures/2.png)
2. Go to the root directory of the code, run the **hb set** and **.** commands on TERMINAL page, and select the **wifiiot\_hispark\_pegasus@hisilicon** version.
2. Go to the root directory of the code, run the **hb set** and **.** commands on the **TERMINAL** panel, and select the **wifiiot\_hispark\_pegasus** version.
**Figure 3** Selecting the target build version<a name="fig17727115215612"></a>
![](figures/en-us_image_0000001078527924.png)
![](figures/3.png)
3. Run the **hb build** command to start building.
**Figure 4** Running commands on TERMINAL page<a name="fig5493164414573"></a>
**Figure 4** Running commands on the TERMINAL panel<a name="fig5493164414573"></a>
![](figures/en-us_image_0000001123445553.png)
![](figures/4.png)
4. Check whether the building is successful. If yes, **wifiiot\_hispark\_pegasus build success** will be displayed, as shown in the following figure.
**Figure 5** Successful building<a name="fig1262101218463"></a>
![](figures/en-us_image_0000001123361875.png)
![](figures/5.png)
5. Check whether the following files are generated in the **./out/wifiiot/** directory.
......@@ -56,82 +56,73 @@ If the Linux environment is installed using Docker, perform the building by refe
**Figure 6** Directory for storing the generated files<a name="fig38521346164618"></a>
![](figures/en-us_image_0000001078528390.png)
![](figures/3-0.png)
## Burning Images<a name="section1610612214150"></a>
You can use the DevEco tool to perform the image burning of the Hi3861 WLAN module. For details about how to use the tool, see [HUAWEI DevEco Device Tool User Guide](https://device.harmonyos.com/en/docs/ide/user-guides/service_introduction-0000001050166905).
1. Use a USB cable to connect the Windows workstation to the Hi3861 development board.
2. Download and install the [USB-to-Serial port driver](http://www.wch-ic.com/downloads/CH341SER_EXE.html).
3. Query the COM port on the device manager, for example, CH340\(COM11\). The serial port integrates functions such as code burning, log printing, and AT commands execution.
1. Connect the PC and the target development board through the USB port. For details, please refer to [Introduction to the Hi3861 Development Board](https://device.harmonyos.com/en/docs/start/introduce/oem_wifi_start_des-0000001050168548).
2. <a name="en-us_topic_0000001056563976_li848662117291"></a>Open Device Manager, then check and record the serial port number corresponding to the development board.
**Figure 7** COM port of the device manager<a name="fig85905394917"></a>
![](figures/com-port-of-the-device-manager.png "com-port-of-the-device-manager")
>![](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 Hi3861 Series Development Boards](https://device.harmonyos.com/cn/docs/ide/user-guides/hi3861-drivers-0000001058153433).
4. Enter the burning configuration page.
![](figures/en-us_image_0000001073388838.png)
**Figure 8** Basic configurations for image burning<a name="fig16939203111472"></a>
3. Open DevEco Device Tool and go to **Projects** \> **Settings**.
![](figures/en-us_image_0000001054877726.png)
![](figures/en-us_image_0000001078404538.png)
5. Set basic parameters.
4. On the **hi3861** tab page, set the programming options.
1. Set a proper baud rate. A higher baud rate indicates a faster burning speed. Here the default value **921600** is recommended.
2. Select a data bit. The default value of **Data bit** for the WLAN module is **8**.
3. Select the version package path **./out/wifiiot/Hi3861\_wifiiot\_app\_allinone.bin** and **Hiburn** mode.
4. Click **Save** to save configurations.
- **upload\_port**: Select the serial port number obtained in step [2](#en-us_topic_0000001056563976_li848662117291).
- **upload\_protocol**: Select the programming protocol **burn-serial**.
- **upload\_partitions**: Select the file to be programmed. **hi3861\_app** is selected by default.
**Figure 9** Baud rate and data bit configurations<a name="fig4315145184815"></a>
![](figures/baud-rate-and-data-bit-configurations.png "baud-rate-and-data-bit-configurations")
![](figures/en-us_image_0000001078244328.png)
**Figure 10** Path of the burning package<a name="fig105491550185115"></a>
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_0000001055427138.png)
![](figures/en-us_image_0000001120802173.png)
6. On the DevEco, click **Burn** ![](figures/en-us_image_0000001054443694.png) and select the serial port **COM11**.
6. When you finish modifying, click **Save** in the upper right corner.
**Figure 11** Starting a burning<a name="fig051518341529"></a>
![](figures/starting-a-burning.png "starting-a-burning")
![](figures/en-us_image_0000001078313582.png)
7. After the serial port is selected, **Connecting, please reset device...** is shown below the **TERMINAL** tab, indicating that the module is in the to-be-burnt state.
7. Open the project file. In the DevEco Device Tool window, go to **PROJECT TASKS** \> **env:hi3861** \> **Upload** to start programming.
**Figure 12** Burning process<a name="fig233565715549"></a>
![](figures/burning-process.png "burning-process")
![](figures/en-us_image_0000001120802383.png)
8. Press the **Reset** key on the module to start burning. **Execution Successful** displayed below the **TERMINAL** tab indicates the burning is complete.
8. When the following information is displayed, press the RST button on the development board to restart it.
**Figure 13** Burning completed<a name="fig191921618564"></a>
![](figures/en-us_image_0000001074285712.png)
![](figures/en-us_image_0000001054802306.png)
9. Start programming. When the following message is displayed, it indicates that the programming is successful.
![](figures/en-us_image_0000001074445364.png)
## Connecting WLAN Module to the Internet<a name="section168257461059"></a>
After completing version building and burning, do as follows to connect the WLAN module to the Internet using AT commands.
1. Keep Windows workstation connected to the WLAN module and click **Serial port** at the bottom of DevEco to view the configuration page.
**Figure 14** Opening the DevEco serial port<a name="fig12489182991119"></a>
![](figures/opening-the-deveco-serial-port.png "opening-the-deveco-serial-port")
1. Click the icon of **DevEco: Serial Monitor** at the bottom of DevEco Studio to keep the connection between the Windows workstation and the WLAN module.
2. Select the serial port and set parameters. Enter the actual serial port number. Here the serial port number is **COM11**; the default values of Baud rate, Data bit, and Stop bit are used; **1** is used as the end-line character since a valid input AT command must end with **\\r\\n**.
**Figure 7** Opening the DevEco serial port<a name="fig12489182991119"></a>
**Figure 15** Setting serial port parameters<a name="fig192312048131213"></a>
![](figures/setting-serial-port-parameters.png "setting-serial-port-parameters")
![](figures/5-1.png)
3. Reset the WLAN module. The message **ready to OS start** is displayed on the terminal page, indicating that the WLAN module is started successfully.
2. Reset the WLAN module. The message **ready to OS start** is displayed on the **TERMINAL** panel, indicating that the WLAN module is started successfully.
**Figure 16** Successful resetting of the WLAN module <a name="fig496084516332"></a>
**Figure 8** Successful resetting of the WLAN module <a name="fig496084516332"></a>
![](figures/3.png)
![](figures/6.png)
4. Run the following AT commands in sequence via the DevEco serial port terminal to start the STA mode, connect to the specified AP, and enable Dynamic Host Configuration Protocol \(DHCP\).
3. Run the following AT commands in sequence via the DevEco serial port terminal to start the STA mode, connect to the specified AP, and enable Dynamic Host Configuration Protocol \(DHCP\).
```
AT+STARTSTA # Start the STA mode.
......@@ -142,16 +133,16 @@ After completing version building and burning, do as follows to connect the WLAN
AT+DHCP=wlan0,1 # Request the IP address of wlan0 from the AP using DHCP.
```
5. Check whether the WLAN module is properly connected to the gateway, as shown in the following figure.
4. Check whether the WLAN module is properly connected to the gateway, as shown in the following figure.
```
AT+IFCFG # View the IP address assigned to an interface of the module.
AT+PING=X.X.X.X # Check the connectivity between the module and the gateway. Replace X.X.X.X with the actual gateway address.
```
**Figure 17** Successful networking of the WLAN module<a name="fig1166371318339"></a>
**Figure 9** Successful networking of the WLAN module<a name="fig1166371318339"></a>
![](figures/4.png)
![](figures/截图.png)
......@@ -157,8 +157,8 @@
>![](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: vendor\\hisi\\hi35xx\\hi3516dv300\\uboot\\out\\boot\\u-boot-hi3516dv300.bin
>- Hi3518E V300: vendor\\hisi\\hi35xx\\hi3518ev300\\uboot\\out\\boot\\u-boot-hi3518ev300.bin
>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.
......
......@@ -160,8 +160,8 @@
>![](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: vendor\\hisi\\hi35xx\\hi3516dv300\\uboot\\out\\boot\\u-boot-hi3516dv300.bin
>- Hi3518E V300: vendor\\hisi\\hi35xx\\hi3518ev300\\uboot\\out\\boot\\u-boot-hi3518ev300.bin
>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.
......
# FAQ on Hi3861<a name="EN-US_TOPIC_0000001053143860"></a>
- [What should I do when the message is displayed during Python 3 installation?](#section1221016541119)
- [What should I do when the message is displayed during Python 3 installation?](#section1913477181213)
- [What should I do when the message is displayed during Python 3 installation?](#section108211415131210)
- [What should I do when the message is displayed during Python 3 installation?](#section2062268124)
- [What should I do when the message is displayed during compilation and building?](#section982315398121)
- [What should I do when the message is displayed during compilation and building?](#section102035451216)
- [What should I do when the message is displayed during compilation and building?](#section4498158162320)
- [What should I do when the message is displayed during compilation and building?](#section11181036112615)
- [What should I do when the message configure: error: no acceptable C compiler found in $PATH is displayed during Python 3 installation?](#section1221016541119)
- [What should I do when the message -bash: make: command not found is displayed during Python 3 installation?](#section1913477181213)
- [What should I do when the message zlib not available is displayed during Python 3 installation?](#section108211415131210)
- [What should I do when the message No module named '\_ctypes' is displayed during Python 3 installation?](#section2062268124)
- [What should I do when the message No module named 'Crypto' is displayed during compilation and building?](#section982315398121)
- [What should I do when the message No module named 'ecdsa' is displayed during compilation and building?](#section102035451216)
- [What should I do when the message Could not find a version that satisfies the requirement six\>=1.9.0 is displayed during compilation and building?](#section4498158162320)
- [What should I do when the message cannot find -lgcc is displayed during compilation and building?](#section11181036112615)
- [What should I do when the message indicating Python cannot be found is displayed during compilation and building?](#section1571810194619)
- [What should I do when an error with occurs during installation?](#section691681635814)
- [What should I do when an error with lsb\_release occurs during kconfiglib installation?](#section691681635814)
## What should I do when the message **configure: error: no acceptable C compiler found in $PATH** is displayed during Python 3 installation?<a name="section1221016541119"></a>
......
......@@ -90,8 +90,8 @@ The following table describes the tools required for setting up the general envi
## Installing the Linux Compilation Environment<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, compilation tools like **LLVM** and **hc-gen** are not required.
>- \(Recommended\) If you obtain the source code through an image site or a code repository, install compilation tools like **LLVM** and **hc-gen**. When installing **LLVM** and **hc-gen**, ensure that the environment variable paths of the compilation tools are unique.
>- If you acquire the source code using an HPM component or HPM CLI tool, the compilation tool **hc-gen** is not required.
>- \(Recommended\) If you obtain the source code through an image site or a code repository, you should install the compilation tool **hc-gen**. When installing **hc-gen**, ensure that the environment variable paths of the compilation tools are unique.
### Changing Linux Shell to Bash<a name="section1715027152617"></a>
......
......@@ -81,8 +81,8 @@ The following table describes the tools required for setting up the general envi
## Installing the Linux Compilation Environment<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, compilation tools like **gn**, **ninja**, **LLVM**, and **hc-gen** are not required.
>- \(Recommended\) If you obtain the source code through an image site or a code repository, compilation tools like **LLVM** and **hc-gen** need to be installed. When installing **LLVM** and **hc-gen**, ensure that the environment variable paths of the compilation tools are unique.
>- If you acquire the source code using an HPM component or HPM CLI tool, the compilation tool **hc-gen** is not required.
>- \(Recommended\) If you obtain the source code through an image site or a code repository, you should install the compilation tool **hc-gen**. When installing **hc-gen**, ensure that the environment variable path of the compilation tool is unique.
### Changing Linux Shell to Bash<a name="section1715027152617"></a>
......
......@@ -3,6 +3,7 @@
- [Prerequisites](#section2074878255)
- [Requirements Specific to the Hi3861 Development Environment](#section466851916410)
- [Installing the Linux Compilation Environment](#section497484245614)
- [Changing Linux Shell to Bash](#section23838991011)
- [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section45512412251)
- [Installing Scons](#section13515123015279)
- [Installing Python Modules](#section88701892341)
......@@ -87,6 +88,29 @@ The following table describes the environment configuration requirements specifi
>- If you acquire the source code using an HPM component or HPM CLI tool, **gcc\_riscv32** is not required.
>- \(Recommended\) If you obtain the source code via the mirror site or code repository, install **gcc\_riscv32**. When installing **gcc\_riscv32**, ensure that the environment variable paths of the compilation tools are unique.
## Changing Linux Shell to Bash<a name="section23838991011"></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 the shell to bash.
**Method 1:** Run the following command on the terminal and then select **No**.
```
sudo dpkg-reconfigure dash
```
**Method 2:** Run the first command to delete **/bin/sh** and then run the second command to create a new symbolic 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.
......@@ -132,12 +156,12 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
- **Installation package:**
1. Download the **.whl** file \(for example, **kconfiglib-13.2.0-py2.py3-none-any.whl**\).
Download path: [https://pypi.org/project/kconfiglib\#files](https://pypi.org/project/kconfiglib#files)
1. Install the **.whl** file.
```
sudo pip3 install kconfiglib-13.2.0-py2.py3-none-any.whl
```
......@@ -161,7 +185,7 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
1. Install the **.whl** file.
```
sudo pip3 install pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl
```
......@@ -178,12 +202,12 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
- **Installation package:**
1. Download the **.whl** file, for example, **six-1.12.0-py2.py3-none-any.whl**.
Download path: [https://pypi.org/project/six/\#files](https://pypi.org/project/six/#files)
1. Install the **.whl** file.
```
sudo pip3 install six-1.12.0-py2.py3-none-any.whl
```
......@@ -204,7 +228,7 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
1. Install the **.whl** file.
```
sudo pip3 install ecdsa-0.14.1-py2.py3-none-any.whl
```
......@@ -227,7 +251,7 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
3. Download the RISC-V GNU toolchain.
```
git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
git clone --recursive https://gitee.com/mirrors/riscv-gnu-toolchain.git
```
4. Open the **riscv-gnu-toolchain** folder and delete empty folders to prevent conflicts during the download of **Newlib**, **Binutils**, and **GCC**.
......
......@@ -160,8 +160,8 @@
>![](public_sys-resources/icon-notice.gif) **须知:**
>单板的U-boot文件请在开源包中获取:
>Hi3516DV300:vendor\\hisi\\hi35xx\\hi3516dv300\\uboot\\out\\boot\\u-boot-hi3516dv300.bin
>Hi3518EV300:vendor\\hisi\\hi35xx\\hi3518ev300\\uboot\\out\\boot\\u-boot-hi3518ev300.bin
>Hi3516DV300:device\\hisilicon\\hispark\_taurus\\sdk\_liteos\\uboot\\out\\boot\\u-boot-hi3516dv300.bin
>Hi3518EV300:device\\hisilicon\\hispark\_aries\\sdk\_liteos\\uboot\\out\\boot\\u-boot-hi3518ev300.bin
2. 根据USB烧写步骤烧写U-boot文件。
......
......@@ -90,8 +90,8 @@ Hi3516开发板对Linux服务器通用环境配置需要的工具及其获取途
## 安装Linux编译环境<a name="section182916865219"></a>
>![](public_sys-resources/icon-notice.gif) **须知:**
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装LLVM、hc-gen编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装LLVM、hc-gen编译工具。安装LLVM、hc-gen编译工具时,请确保编译工具的环境变量路径唯一。
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装hc-gen编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装hc-gen编译工具。安装时,请确保编译工具的环境变量路径唯一。
### 将Linux shell改为bash<a name="section1715027152617"></a>
......
......@@ -160,8 +160,8 @@
>![](public_sys-resources/icon-notice.gif) **须知:**
>单板的U-boot文件请在开源包中获取:
>- Hi3516DV300:vendor\\hisi\\hi35xx\\hi3516dv300\\uboot\\out\\boot\\u-boot-hi3516dv300.bin
>- Hi3518EV300:vendor\\hisi\\hi35xx\\hi3518ev300\\uboot\\out\\boot\\u-boot-hi3518ev300.bin
>Hi3516DV300:device\\hisilicon\\hispark\_taurus\\sdk\_liteos\\uboot\\out\\boot\\u-boot-hi3516dv300.bin
>Hi3518EV300:device\\hisilicon\\hispark\_aries\\sdk\_liteos\\uboot\\out\\boot\\u-boot-hi3518ev300.bin
2. 根据USB烧写步骤烧写U-boot文件。
......
......@@ -2,7 +2,7 @@
- **[Hi3518开发板介绍](Hi3518开发板介绍.md)**
- **[搭建环境](搭建环境.md)**
- **[Hi3518搭建环境](Hi3518搭建环境.md)**
- **[开发Hi3518第一个示例程序](开发Hi3518第一个示例程序.md)**
......
......@@ -81,8 +81,8 @@ Hi3518开发板对Linux服务器通用环境配置需要的工具及其获取途
## 安装Linux编译环境<a name="section8831868501"></a>
>![](public_sys-resources/icon-notice.gif) **须知:**
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装gn、ninja、LLVM、hc-gen编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装LLVM、hc-gen编译工具。安装LLVM、hc-gen编译工具时,请确保编译工具的环境变量路径唯一。
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装hc-gen编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装hc-gen编译工具。安装时,请确保编译工具的环境变量路径唯一。
### 将Linux shell改为bash<a name="section1715027152617"></a>
......
......@@ -3,7 +3,7 @@
- [开发板简介](#section187215231809)
- [资源和约束](#section82610215014)
- [开发板规格](#section169054431017)
- [关键特性](#section1317173016507)
- [OpenHarmony关键特性](#section1317173016507)
本文档介绍Hi3861 WLAN模组的开发环境搭建、版本编译构建、烧录、源码修改、调试验证等方法。通过学习,开发者会对Hi3861 WLAN模组开发流程有初步认识,并可上手业务开发。
......
......@@ -3,6 +3,7 @@
- [前提条件](#section2074878255)
- [Hi3861环境特有要求](#section466851916410)
- [安装Linux编译环境](#section497484245614)
- [将Linux shell改为bash](#section23838991011)
- [安装编译依赖基础软件(仅Ubuntu 20+需要)](#section45512412251)
- [安装Scons](#section13515123015279)
- [安装python模块](#section88701892341)
......@@ -33,7 +34,16 @@ Hi3861开发板对环境配置的特有要求如下表所示。
</th>
</tr>
</thead>
<tbody><tr id="row935218593572"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p105554418586"><a name="p105554418586"></a><a name="p105554418586"></a>Linux服务器</p>
<tbody><tr id="row1159820486400"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p467443191517"><a name="p467443191517"></a><a name="p467443191517"></a>Linux服务器</p>
</td>
<td class="cellrowborder" valign="top" width="23.62%" headers="mcps1.2.5.1.2 "><p id="p3170154241114"><a name="p3170154241114"></a><a name="p3170154241114"></a>bash</p>
</td>
<td class="cellrowborder" valign="top" width="22.55%" headers="mcps1.2.5.1.3 "><p id="p0674153114151"><a name="p0674153114151"></a><a name="p0674153114151"></a>命令行处理工具</p>
</td>
<td class="cellrowborder" valign="top" width="36.29%" headers="mcps1.2.5.1.4 "><p id="p116746312151"><a name="p116746312151"></a><a name="p116746312151"></a>系统配置</p>
</td>
</tr>
<tr id="row935218593572"><td class="cellrowborder" valign="top" width="17.54%" headers="mcps1.2.5.1.1 "><p id="p105554418586"><a name="p105554418586"></a><a name="p105554418586"></a>Linux服务器</p>
</td>
<td class="cellrowborder" valign="top" width="23.62%" headers="mcps1.2.5.1.2 "><p id="p45551740589"><a name="p45551740589"></a><a name="p45551740589"></a>编译基础软件包(仅ubuntu 20+需要)</p>
</td>
......@@ -87,6 +97,29 @@ Hi3861开发板对环境配置的特有要求如下表所示。
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装gcc\_riscv32编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装gcc\_riscv32编译工具。安装gcc\_riscv32编译工具时,请确保编译工具的环境变量路径唯一。
## 将Linux shell改为bash<a name="section23838991011"></a>
查看shell是否为bash,在终端运行如下命令
```
ls -l /bin/sh
```
如果显示为 "/bin/sh-\>bash" 则为正常,否则请按照以下方式修改
方法一:在终端运行如下命令,然后选择no
```
sudo dpkg-reconfigure dash
```
方法二:先删除sh,再创建软链接
```
sudo rm -rf /bin/sh
sudo ln -s /bin/bash /bin/sh
```
### 安装编译依赖基础软件(仅Ubuntu 20+需要)<a name="section45512412251"></a>
执行以下命令进行安装:
......@@ -132,12 +165,12 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
- **安装包方式:**
1. 下载.whl文件(例如:kconfiglib-13.2.0-py2.py3-none-any.whl)。
下载路径:“[https://pypi.org/project/kconfiglib\#files](https://pypi.org/project/kconfiglib#files)”
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install kconfiglib-13.2.0-py2.py3-none-any.whl
```
......@@ -161,7 +194,7 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install pycryptodome-3.9.9-cp38-cp38-manylinux1_x86_64.whl
```
......@@ -178,12 +211,12 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
- **安装包方式:**
1. 下载.whl文件(例如:six-1.12.0-py2.py3-none-any.whl)。
下载路径:“[https://pypi.org/project/six/\#files](https://pypi.org/project/six/#files)”
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install six-1.12.0-py2.py3-none-any.whl
```
......@@ -204,7 +237,7 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
1. 运行如下命令,安装.whl文件。
```
sudo pip3 install ecdsa-0.14.1-py2.py3-none-any.whl
```
......@@ -215,7 +248,8 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
### 安装gcc\_riscv32(WLAN模组类编译工具链)<a name="section1842910288284"></a>
>![](public_sys-resources/icon-notice.gif) **须知:**
>Hi3861平台仅支持使用libgcc运行时库的静态链接,不建议开发者使用libgcc运行时库的动态链接,会导致商业分发时被GPL V3污染。
>- Hi3861平台仅支持使用libgcc运行时库的静态链接,不建议开发者使用libgcc运行时库的动态链接,会导致商业分发时被GPL V3污染。
>- 通过下述步骤2-15,我们编译好了gcc镜像,提供给开发者[直接下载](https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz)使用。直接下载gcc镜像的开发者可省略下述2-15步。
1. 打开Linux编译服务器终端。
2. 环境准备,请安装"gcc, g++, bison, flex, makeinfo"软件,确保工具链能正确编译。
......@@ -227,7 +261,7 @@ sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get
3. 下载riscv-gnu-toolchain交叉编译工具链。
```
git clone --recursive https://github.com/riscv/riscv-gnu-toolchain
git clone --recursive https://gitee.com/mirrors/riscv-gnu-toolchain.git
```
4. 打开文件夹riscv-gnu-toolchain,先删除空文件夹,以防止下载newlib,binutils,gcc时冲突。
......
......@@ -18,7 +18,7 @@
- [Hi3518开发板](Hi3518开发板.md)
- [Hi3518开发板介绍](Hi3518开发板介绍.md)
- [搭建环境](搭建环境.md)
- [Hi3518搭建环境](Hi3518搭建环境.md)
- [开发Hi3518第一个示例程序](开发Hi3518第一个示例程序.md)
- [Hi3518常见问题](Hi3518常见问题.md)
......@@ -170,32 +170,33 @@ Hi3516开发板的代码烧录支持USB烧录、网口烧录和串口烧录三
![](figures/zh-cn_image_0000001078081434.png)
5. 设置网口烧录的IP地址信息,建议先在本地PC上设置本机的本地TCP/IPv4地址信息,再设置如下选项:
5. <a name="zh-cn_topic_0000001056443961_li1558813168234"></a>检查和设置连接开发板后的网络适配器的IP地址信息,设置方法请参考[设置Hi3516网口烧录的IP地址信息](https://device.harmonyos.com/cn/docs/ide/user-guides/set_ipaddress-0000001141825075)
6. 设置网口烧录的IP地址信息,设置如下选项:
- upload\_net\_server\_ip:选择当前PC的IP地址。例如192.168.1.2
- upload\_net\_server\_ip:选择[5](#zh-cn_topic_0000001056443961_li1558813168234)中设置的IP地址信息。例如192.168.1.2
- upload\_net\_client\_mask:设置开发板的子网掩码,工具会自动根据选择的upload\_net\_server\_ip进行设置。例如255.255.255.0
- upload\_net\_client\_gw:设置开发板的网关,工具会自动根据选择的upload\_net\_server\_ip进行设置。例如192.168.1.1
- upload\_net\_client\_ip:设置开发板的IP地址,工具会自动根据选择的upload\_net\_server\_ip进行设置。例如192.168.1.3
![](figures/zh-cn_image_0000001078096426.png)
6. 修改待烧录文件(对应hi3516dv300\_fastboothi3516dv300\_kernel、hi3516dv300\_rootfs和hi3516dv300\_userfs页签)的设置,默认情况下,DevEco Device Tool已针对Hi3516系列开发板进行适配,无需单独修改。如果需要修改,请在New Option中,选择对应的修改项进行更改。
7. 修改待烧录文件(对应hi3516dv300\_fastboothi3516dv300\_kernel、hi3516dv300\_rootfs和hi3516dv300\_userfs页签)的设置,默认情况下,DevEco Device Tool已针对Hi3516系列开发板进行适配,无需单独修改。如果需要修改,请在New Option中,选择对应的修改项进行更改。
![](figures/2021-01-28_112953.png)
7. 所有的配置都修改完成后,在工程配置页签的顶部,点击**Save**进行保存。
8. 所有的配置都修改完成后,在工程配置页签的顶部,点击**Save**进行保存。
![](figures/2021-01-27_170334-0.png)
![](figures/2021-01-27_170334-2.png)
8. 打开工程文件,点击![](figures/2021-01-27_170334-1.png)图标,打开DevEco Device Tool界面,在“PROJECT TASKS”中,点击env:hi3516dv300下的**Upload**按钮,启动烧录。
9. 打开工程文件,点击![](figures/2021-01-27_170334-3.png)图标,打开DevEco Device Tool界面,在“PROJECT TASKS”中,点击env:hi3516dv300下的**Upload**按钮,启动烧录。
![](figures/2021-01-27_181244.png)
9. 启动烧录后,显示如下提示信息时,请重启开发板(下电再上电)。
10. 启动烧录后,显示如下提示信息时,请重启开发板(下电再上电)。
![](figures/zh-cn_image_0000001097124071.png)
10. 重新上电后,启动烧录,界面提示如下信息时,表示烧录成功。
11. 重新上电后,启动烧录,界面提示如下信息时,表示烧录成功。
![](figures/zh-cn_image_0000001072956053.png)
......@@ -212,8 +213,8 @@ Hi3516开发板的代码烧录支持USB烧录、网口烧录和串口烧录三
![](figures/chuankou1.png)
1. 单击**Serial port**打开串口。
2. 输入串口编号\(按照烧录步骤中查询的串口号,此处以com11举例\),并连续输入回车直到串口显示"hisilicon"。
1. 单击**Monitor**打开串口。
2. 连续输入回车直到串口显示"hisilicon"。
3. 单板初次启动或修改启动参数,请进入[步骤2](#l5b42e79a33ea4d35982b78a22913b0b1),否则进入[步骤3](#ld26f18828aa44c36bfa36be150e60e49)。
2. <a name="l5b42e79a33ea4d35982b78a22913b0b1"></a>(单板初次启动必选)修改U-boot的bootcmd及bootargs内容:该步骤为固化操作,若不修改参数只需执行一次。每次复位单板均会自动进入系统。
......
......@@ -437,8 +437,8 @@
![](figures/chuankou1.png)
1. 单击**Serial port**打开串口。
2. 输入串口编号\(按照烧录步骤中查询的串口号,此处以com11举例\),并连续输入回车直到串口显示"hisilicon"。
1. 单击**Monitor**打开串口。
2. 连续输入回车直到串口显示"hisilicon"。
3. 单板初次启动或修改启动参数,请进入[步骤2](开发Hi3516第一个应用程序示例.md#l5b42e79a33ea4d35982b78a22913b0b1),否则进入[步骤3](开发Hi3516第一个应用程序示例.md#ld26f18828aa44c36bfa36be150e60e49)。
2. (单板初次启动必选)修改U-boot的bootcmd及bootargs内容:该步骤为固化操作,若不修改参数只需执行一次。每次复位单板均会自动进入系统。
......
......@@ -140,7 +140,7 @@ hb build -f(执行编译)
结果文件生成在out/hispark\_aries/ipcamera\_hispark\_aries目录下。
**图 1** 设置图例<a name="fig4305770509"></a>
![](figures/设置图例-2.png "设置图例-2")
![](figures/设置图例-4.png "设置图例-4")
>![](public_sys-resources/icon-notice.gif) **须知:**
>Hi3518EV300单板的U-boot文件获取路径:device/hisilicon/hispark\_aries/sdk\_liteos/uboot/out/boot/u-boot-hi3518ev300.bin
......@@ -171,13 +171,13 @@ Hi3518开发板的代码烧录仅支持USB烧录方式。
5. 修改待烧录文件(对应hi3518ev300\_fastboot、hi3518ev300\_kernel、hi3518ev300\_rootfs和hi3518ev300\_userfs页签)的设置,默认情况下,DevEco Device Tool已针对Hi3518系列开发板进行适配,无需单独修改。如果需要修改,请在New Option中,选择对应的修改项进行更改。
![](figures/2021-01-28_112953-3.png)
![](figures/2021-01-28_112953-5.png)
6. 所有的配置都修改完成后,在工程配置页签的顶部,点击**Save**进行保存。
![](figures/2021-01-27_170334-4.png)
![](figures/2021-01-27_170334-6.png)
7. 打开工程文件,点击![](figures/2021-01-27_170334-5.png)图标,打开DevEco Device Tool界面,在“PROJECT TASKS”中,点击partition:hi3518ev300\_fastboot下的**Erase**按钮,擦除U-Boot。
7. 打开工程文件,点击![](figures/2021-01-27_170334-7.png)图标,打开DevEco Device Tool界面,在“PROJECT TASKS”中,点击partition:hi3518ev300\_fastboot下的**Erase**按钮,擦除U-Boot。
![](figures/2021-01-27_181047.png)
......@@ -208,10 +208,10 @@ Hi3518开发板的代码烧录仅支持USB烧录方式。
**图 2** 连接串口图<a name="fig056645018495"></a>
![](figures/chuankou1-6.png)
![](figures/chuankou1-8.png)
1. 单击**Serial port**打开串口。
2. 输入串口编号\(按照烧录步骤中查询的串口号,此处以com11举例\),并连续输入回车直到串口显示"hisilicon"。
1. 单击**Monitor**打开串口。
2. 连续输入回车直到串口显示"hisilicon"。
3. 单板初次启动或修改启动参数,请进入[步骤2](#li9441185382314),否则进入[步骤3](#li6442853122312)。
2. <a name="li9441185382314"></a>(初次烧写必选)修改U-boot的bootcmd及bootargs内容:该步骤为固化操作,可保存执行结果,但U-boot重新烧入,则需要再次执行下述步骤。
......
# 开发Hi3861第一个示例程序<a name="ZH-CN_TOPIC_0000001053302600"></a>
- [源码编译](#section1736014117148)
- [源码编译](#section191121332125319)
- [镜像烧录](#section1610612214150)
- [WLAN模组联网](#section168257461059)
本示例将演示如何通过AT命令完成WLAN模组与网关联网。
## 源码编译<a name="section1736014117148"></a>
## 源码编译<a name="section191121332125319"></a>
本节描述如何在Linux服务器上进行WLAN模组版本的编译。
......@@ -17,35 +17,35 @@
**图 1** IDE终端工具打开方法<a name="fig1975813338510"></a>
![](figures/zh-cn_image_0000001055040538.png)
![](figures/1.png)
在终端界面使用ssh命令连接linux服务器,如“ssh _user_@_ipaddr_”。
**图 2** 终端界面示意图<a name="fig91165301546"></a>
![](figures/zh-cn_image_0000001054599199.png)
![](figures/2.png)
2. 进入代码根路径,并在终端窗口,执行脚本命令“hb set”、“.”,选择需要编译的版本“wifiiot\_hispark\_pegasus@hisilicon”。
2. 进入代码根路径,并在终端窗口,执行脚本命令“hb set”、“.”,选择需要编译的版本“wifiiot\_hispark\_pegasus”。
**图 3** 在终端界面选择目标构建版本示意图<a name="fig17727115215612"></a>
![](figures/zh-cn_image_0000001078527924.png)
![](figures/3.png)
3. 执行“hb build”启动版本构建。
**图 4** 在终端界面执行编译命令示意图<a name="fig5493164414573"></a>
![](figures/zh-cn_image_0000001123445553.png)
![](figures/4.png)
4. 编译结束后,如果出现“wifiiot\_hispark\_pegasus build success”字样,则证明构建成功,如下图所示。
**图 5** 编译成功示意图<a name="fig1262101218463"></a>
![](figures/zh-cn_image_0000001123361875.png)
![](figures/5.png)
5. 构建成功后,会在./out/wifiiot/路径中生成以下文件,使用如下命令可以查看,至此编译构建流程结束。
......@@ -56,7 +56,7 @@
**图 6** 编译文件存放目录示意图<a name="fig38521346164618"></a>
![](figures/zh-cn_image_0000001078528390.png)
![](figures/3-0.png)
## 镜像烧录<a name="section1610612214150"></a>
......@@ -91,7 +91,7 @@ Hi3861 WLAN模组的镜像烧录可以通过OpenHarmony IDE工具DevEco完成,
![](figures/zh-cn_image_0000001078313582.png)
7. 打开工程文件,点击图标,打开DevEco Device Tool界面,在“PROJECT TASKS”中,点击env:hi3861下的**Upload**按钮,启动烧录。
7. 打开工程文件,在DevEco Device Tool界面的“PROJECT TASKS”中,点击env:hi3861下的**Upload**按钮,启动烧录。
![](figures/zh-cn_image_0000001120802383.png)
......@@ -108,24 +108,21 @@ Hi3861 WLAN模组的镜像烧录可以通过OpenHarmony IDE工具DevEco完成,
完成版本构建及烧录后,下面开始介绍如何在串口终端上执行AT命令,使WLAN模组联网。
1. 保持Windows工作台和WLAN模组的连接状态,在DevEco工具最下方,点击“Serial port”按钮,弹出串口终端的配置界面
1. 保持Windows工作台和WLAN模组的连接状态,在DevEco工具最下方,点击“DevEco:Serial Monitor”按钮
**图 7** 打开DevEco串口终端示意图<a name="fig12489182991119"></a>
![](figures/打开DevEco串口终端示意图.png "打开DevEco串口终端示意图")
2. 选择串口,并完成参数配置。根据实际情况输入串口号,此处为“COM11”;波特率、数据位、停止位使用默认值;由于AT命令输入需要以“\\r\\n”结尾,否则输入无效,所以结束符处输入“1”。
**图 8** 串口参数配置示意图<a name="fig192312048131213"></a>
![](figures/串口参数配置示意图.png "串口参数配置示意图")
![](figures/5-1.png)
3. 复位WLAN模组,终端界面显示“ready to OS start”,则启动成功。
2. 复位WLAN模组,终端界面显示“ready to OS start”,则启动成功。
**图 9** WLAN复位成功示意图<a name="fig496084516332"></a>
**图 8** WLAN复位成功示意图<a name="fig496084516332"></a>
![](figures/3.png)
![](figures/6.png)
4. 在DevEco的串口终端中,依次执行如下AT命令,启动STA模式,连接指定AP热点,并开启DHCP功能。
3. 在DevEco的串口终端中,依次执行如下AT命令,启动STA模式,连接指定AP热点,并开启DHCP功能。
```
AT+STARTSTA # 启动STA模式
......@@ -136,16 +133,16 @@ Hi3861 WLAN模组的镜像烧录可以通过OpenHarmony IDE工具DevEco完成,
AT+DHCP=wlan0,1 # 通过DHCP向AP请求wlan0的IP地址
```
5. 查看WLAN模组与网关联通是否正常,如下图所示。
4. 查看WLAN模组与网关联通是否正常,如下图所示。
```
AT+IFCFG # 查看模组接口IP
AT+PING=X.X.X.X # 检查模组与网关的联通性,其中X.X.X.X需替换为实际的网关地址
```
**图 10** WLAN模组联网成功示意图<a name="fig1166371318339"></a>
**图 9** WLAN模组联网成功示意图<a name="fig1166371318339"></a>
![](figures/4.png)
![](figures/截图.png)
# 搭建环境<a name="ZH-CN_TOPIC_0000001054022306"></a>
- [前提条件](#section2074878255)
- [Hi3518环境特有要求](#section1724111409282)
- [硬件要求](#section487353718276)
- [软件要求](#section17315193935817)
- [安装Linux编译环境](#section8831868501)
- [安装文件打包工具](#section480195453419)
- [安装hc-gen](#section351420104218)
## 前提条件<a name="section2074878255"></a>
Hi3518环境搭建前,请先完成[搭建系统基础环境](搭建系统基础环境.md)
## Hi3518环境特有要求<a name="section1724111409282"></a>
### 硬件要求<a name="section487353718276"></a>
- Hi3518EV300 IoT Camera开发板
- USB转串口线、网线(Windows工作台通过USB转串口线、网线与开发板连接)
各硬件连接关系如下图所示。
**图 1** 硬件连线图<a name="fig8211468392"></a>
![](figures/硬件连线图.png "硬件连线图")
### 软件要求<a name="section17315193935817"></a>
>![](public_sys-resources/icon-notice.gif) **须知:**
>本节描述安装包方式搭建编译环境的操作步骤。如果是Docker方式安装编译环境,请跳过此章节以及下述安装Linux编译环境章节。
Hi3518开发板对Linux服务器通用环境配置需要的工具及其获取途径如下表所示。
**表 1** Linux服务器开发工具及获取途径
<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>开发工具</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>用途</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>获取途径</p>
</th>
</tr>
</thead>
<tbody><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、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>文件打包工具</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>
<tr id="row1548710453586"><td class="cellrowborder" valign="top" width="23.332333233323332%" headers="mcps1.2.4.1.1 "><p id="p15487114585814"><a name="p15487114585814"></a><a name="p15487114585814"></a>hc-gen</p>
</td>
<td class="cellrowborder" valign="top" width="14.65146514651465%" headers="mcps1.2.4.1.2 "><p id="p148719452588"><a name="p148719452588"></a><a name="p148719452588"></a>驱动配置编译工具</p>
</td>
<td class="cellrowborder" valign="top" width="62.016201620162015%" headers="mcps1.2.4.1.3 "><p id="p1487164565819"><a name="p1487164565819"></a><a name="p1487164565819"></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>
</tbody>
</table>
## 安装Linux编译环境<a name="section8831868501"></a>
>![](public_sys-resources/icon-notice.gif) **须知:**
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装gn、ninja、LLVM、hc-gen编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装LLVM、hc-gen编译工具。安装LLVM、hc-gen编译工具时,请确保编译工具的环境变量路径唯一。
### 安装文件打包工具<a name="section480195453419"></a>
1. 打开Linux编译服务器终端。
2. 运行如下命令,安装dosfstools。
```
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="section351420104218"></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
```
......@@ -78,7 +78,7 @@
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.5.1.2 "><p id="a687efa8001f140488dc1da9a2ee8f6d1"><a name="a687efa8001f140488dc1da9a2ee8f6d1"></a><a name="a687efa8001f140488dc1da9a2ee8f6d1"></a>操作系统</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.2.5.1.3 "><p id="ace724e00c9094eccb8c600d6ad426ed8"><a name="ace724e00c9094eccb8c600d6ad426ed8"></a><a name="ace724e00c9094eccb8c600d6ad426ed8"></a>Ubuntu16.04及以上64位系统版本,Shell使用bash</p>
<td class="cellrowborder" valign="top" headers="mcps1.2.5.1.3 "><p id="ace724e00c9094eccb8c600d6ad426ed8"><a name="ace724e00c9094eccb8c600d6ad426ed8"></a><a name="ace724e00c9094eccb8c600d6ad426ed8"></a>Ubuntu16.04及以上64位系统版本。</p>
<div class="note" id="note124531828194919"><a name="note124531828194919"></a><a name="note124531828194919"></a><span class="notetitle"> 说明: </span><div class="notebody"><p id="p1244243142810"><a name="p1244243142810"></a><a name="p1244243142810"></a>通常系统默认安装samba、vim等常用软件,需要做适当适配以支持linux文件共享。</p>
</div></div>
</td>
......@@ -134,45 +134,45 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示
<a name="table6299192712513"></a>
<table><thead align="left"><tr id="row122993276512"><th class="cellrowborder" valign="top" width="13.35133513351335%" id="mcps1.2.4.1.1"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>开发工具</p>
</th>
<th class="cellrowborder" valign="top" width="19.72197219721972%" id="mcps1.2.4.1.2"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>用途</p>
<th class="cellrowborder" valign="top" width="32.12321232123212%" id="mcps1.2.4.1.2"><p id="p429918274517"><a name="p429918274517"></a><a name="p429918274517"></a>用途</p>
</th>
<th class="cellrowborder" valign="top" width="66.92669266926693%" id="mcps1.2.4.1.3"><p id="p12997271757"><a name="p12997271757"></a><a name="p12997271757"></a>获取途径</p>
<th class="cellrowborder" valign="top" width="54.525452545254524%" id="mcps1.2.4.1.3"><p id="p12997271757"><a name="p12997271757"></a><a name="p12997271757"></a>获取途径</p>
</th>
</tr>
</thead>
<tbody><tr id="row430016273514"><td class="cellrowborder" valign="top" width="13.35133513351335%" headers="mcps1.2.4.1.1 "><p id="p330015271158"><a name="p330015271158"></a><a name="p330015271158"></a>Python3.7+</p>
</td>
<td class="cellrowborder" valign="top" width="19.72197219721972%" headers="mcps1.2.4.1.2 "><p id="p43003270510"><a name="p43003270510"></a><a name="p43003270510"></a>编译构建工具</p>
<td class="cellrowborder" valign="top" width="32.12321232123212%" headers="mcps1.2.4.1.2 "><p id="p43003270510"><a name="p43003270510"></a><a name="p43003270510"></a>编译构建工具</p>
</td>
<td class="cellrowborder" valign="top" width="66.92669266926693%" headers="mcps1.2.4.1.3 "><p id="p34760459518"><a name="p34760459518"></a><a name="p34760459518"></a>通过互联网获取</p>
<td class="cellrowborder" valign="top" width="54.525452545254524%" headers="mcps1.2.4.1.3 "><p id="p34760459518"><a name="p34760459518"></a><a name="p34760459518"></a>通过互联网获取</p>
</td>
</tr>
<tr id="row1711946154018"><td class="cellrowborder" valign="top" width="13.35133513351335%" headers="mcps1.2.4.1.1 "><p id="p15588165684216"><a name="p15588165684216"></a><a name="p15588165684216"></a>gn</p>
</td>
<td class="cellrowborder" valign="top" width="19.72197219721972%" headers="mcps1.2.4.1.2 "><p id="p4588135634213"><a name="p4588135634213"></a><a name="p4588135634213"></a>产生ninja编译脚本</p>
<td class="cellrowborder" valign="top" width="32.12321232123212%" headers="mcps1.2.4.1.2 "><p id="p4588135634213"><a name="p4588135634213"></a><a name="p4588135634213"></a>产生ninja编译脚本</p>
</td>
<td class="cellrowborder" valign="top" width="66.92669266926693%" headers="mcps1.2.4.1.3 "><p id="p14131813191712"><a name="p14131813191712"></a><a name="p14131813191712"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz</a></p>
<td class="cellrowborder" valign="top" width="54.525452545254524%" headers="mcps1.2.4.1.3 "><p id="p14131813191712"><a name="p14131813191712"></a><a name="p14131813191712"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz</a></p>
</td>
</tr>
<tr id="row16990164213404"><td class="cellrowborder" valign="top" width="13.35133513351335%" headers="mcps1.2.4.1.1 "><p id="p1858825613428"><a name="p1858825613428"></a><a name="p1858825613428"></a>ninja</p>
</td>
<td class="cellrowborder" valign="top" width="19.72197219721972%" headers="mcps1.2.4.1.2 "><p id="p15844174611816"><a name="p15844174611816"></a><a name="p15844174611816"></a>执行ninja编译脚本</p>
<td class="cellrowborder" valign="top" width="32.12321232123212%" headers="mcps1.2.4.1.2 "><p id="p15844174611816"><a name="p15844174611816"></a><a name="p15844174611816"></a>执行ninja编译脚本</p>
</td>
<td class="cellrowborder" valign="top" width="66.92669266926693%" 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 class="cellrowborder" valign="top" width="54.525452545254524%" 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="row7531362055"><td class="cellrowborder" valign="top" width="13.35133513351335%" headers="mcps1.2.4.1.1 "><p id="p15217227174016"><a name="p15217227174016"></a><a name="p15217227174016"></a>LLVM</p>
</td>
<td class="cellrowborder" valign="top" width="19.72197219721972%" headers="mcps1.2.4.1.2 "><p id="p122171727184019"><a name="p122171727184019"></a><a name="p122171727184019"></a>编译工具链</p>
<td class="cellrowborder" valign="top" width="32.12321232123212%" headers="mcps1.2.4.1.2 "><p id="p122171727184019"><a name="p122171727184019"></a><a name="p122171727184019"></a>编译工具链</p>
</td>
<td class="cellrowborder" valign="top" width="66.92669266926693%" headers="mcps1.2.4.1.3 "><p id="p871055810226"><a name="p871055810226"></a><a name="p871055810226"></a><a href="https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-53907/linux/llvm.tar.gz" target="_blank" rel="noopener noreferrer">https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-53907/linux/llvm.tar.gz</a></p>
</td>
</tr>
<tr id="row1644079184919"><td class="cellrowborder" valign="top" width="13.35133513351335%" headers="mcps1.2.4.1.1 "><p id="p744115914493"><a name="p744115914493"></a><a name="p744115914493"></a>hb</p>
</td>
<td class="cellrowborder" valign="top" width="19.72197219721972%" headers="mcps1.2.4.1.2 "><p id="p1244114913492"><a name="p1244114913492"></a><a name="p1244114913492"></a>编译构建命令行工具</p>
<td class="cellrowborder" valign="top" width="32.12321232123212%" headers="mcps1.2.4.1.2 "><p id="p1244114913492"><a name="p1244114913492"></a><a name="p1244114913492"></a><span id="text344823833918"><a name="text344823833918"></a><a name="text344823833918"></a>OpenHarmony</span>编译构建命令行工具</p>
</td>
<td class="cellrowborder" valign="top" width="66.92669266926693%" headers="mcps1.2.4.1.3 "><p id="p1463918124619"><a name="p1463918124619"></a><a name="p1463918124619"></a>通过互联网获取</p>
<td class="cellrowborder" valign="top" width="54.525452545254524%" headers="mcps1.2.4.1.3 "><p id="p1463918124619"><a name="p1463918124619"></a><a name="p1463918124619"></a>通过互联网获取</p>
</td>
</tr>
</tbody>
......@@ -189,8 +189,8 @@ Linux编译环境可以通过Docker方式快速安装,具体请参见[Docker
## 安装Linux编译环境(方法二:安装包方式)<a name="section497484245614"></a>
>![](public_sys-resources/icon-notice.gif) **须知:**
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装gn、ninja编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装gn、ninja编译工具。安装gn、ninja编译工具时,请确保编译工具的环境变量路径唯一。
>- 如果后续通过“HPM组件方式”或“HPM包管理器命令行工具方式”获取源码,不需要安装gn、ninja、LLVM、hb编译工具。
>- (推荐)如果后续通过“镜像站点方式”或“代码仓库方式”获取源码,需要安装gn、ninja、LLVM、hb编译工具。安装时,请确保编译工具的环境变量路径唯一。
### 连接Linux服务器<a name="section723115618340"></a>
......@@ -380,8 +380,7 @@ Linux编译环境可以通过Docker方式快速安装,具体请参见[Docker
**前提条件**
- 请先安装Python 3.7.4及以上,请见[安装和配置Python](#section11255767343)
- 下载源码,请见[源码获取](../get-code/源码获取.md)
请先安装Python 3.7.4及以上,请见[安装和配置Python](#section11255767343)
**安装方法**
......@@ -439,7 +438,7 @@ python3 -m pip uninstall ohos-build
## 获取OpenHarmony源码<a name="section1545225464016"></a>
开发者需要在Linux服务器上下载并解压一套源代码,获取OpenHarmony 源码([下载链接](https://repo.huaweicloud.com/harmonyos/os/1.0.1/code-1.0.1.tar.gz))。更多源码获取方式,请[源码获取](../get-code/源码获取.md)
开发者需要在Linux服务器上下载并解压一套源代码,请参[源码获取](../get-code/源码获取.md)
## 常见问题<a name="section19253140111619"></a>
......@@ -521,7 +520,7 @@ python3 -m pip uninstall ohos-build
```
sudo apt-get remove python3-apt
sduo apt-get install python3-apt
sudo apt-get install python3-apt
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册