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

update folder

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 307c5ff1
......@@ -12,7 +12,7 @@
- [Burning](quickstart-ide-lite-steps-hi3861-burn.md)
- [Networking](quickstart-ide-lite-steps-hi3861-netconfig.md)
- [Debugging and Verification](quickstart-ide-lite-steps-hi3861-debug.md)
- [Running](quickstart-ide-lite-steps-hi3816-running.md)
- [Running](quickstart-ide-lite-steps-hi3861-running.md)
- Hi3516 Development Board
- [Writing a Hello World Program](quickstart-ide-lite-steps-hi3516-application-framework.md)
- [Building](quickstart-ide-lite-steps-hi3516-building.md)
......
......@@ -24,7 +24,7 @@ The setup procedure varies, depending on whether you need a GUI. If you need a G
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
```
ls -l /bin/sh
```
......@@ -32,7 +32,7 @@ The setup procedure varies, depending on whether you need a GUI. If you need a G
![en-us_image_0000001226764302](figures/en-us_image_0000001226764302.png)
2. Start the command-line tool, run the following command, enter your password, and select **No** to set **Ubuntu shell** to **bash**.
```
sudo dpkg-reconfigure dash
```
......@@ -44,13 +44,13 @@ The setup procedure varies, depending on whether you need a GUI. If you need a G
3. Decompress the DevEco Device Tool software package and assign permission on the folder obtained from the decompression.
1. Go to the directory where the DevEco Device Tool software package is stored and run the following command to decompress the software package. In the command, change **devicetool-linux-tool-3.0.0.400.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.400.zip
```
2. Open the folder of the decompressed software package and run the following command to grant the execute permission on the installation file. In the command, change **devicetool-linux-tool-3.0.0.400.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.400.sh
```
......@@ -60,7 +60,7 @@ The setup procedure varies, depending on whether you need a GUI. If you need a G
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> During the installation, the setup wizard automatically checks whether Python 3.8 or 3.9 is installed. If Python 3.8 or 3.9 is not installed, the setup wizard displays the "Do you want to continue?" message; enter **Y** to allow the setup wizard to automatically install Python.
```
sudo ./devicetool-linux-tool-3.0.0.400.sh
```
......@@ -126,19 +126,19 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the command fails to be executed and the system displays a message indicating that the openssh-server and openssh-client depend on different versions, install the openssh-client of the required version (for example, **sudo apt-get install openssh-client=1:8.2p1-4**) as prompted on the command-line interface (CLI) and run the command again to install the openssh-server.
```
sudo apt-get install openssh-server
```
2. Run the following command to start the SSH service:
```
sudo systemctl start ssh
```
3. Run the following command to obtain the IP address of the current user for remote access to the Ubuntu environment from Windows:
```
ifconfig
```
......@@ -148,7 +148,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
### Installing Remote SSH
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us-cn_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
![en-us_image_0000001193920448](figures/en-us_image_0000001193920448.png)
......@@ -187,7 +187,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
After the preceding operations are complete, you can remotely connect to the Ubuntu environment through Windows for development. However, you need to frequently enter the remote connection password. To eliminate this need, you can use the SSH public key.
1. Open the Git bash CLI and run the following command to generate an SSH public key. During command execution, perform operations as prompted. Set **username** and **ip** to the user name and IP address you use for connecting to the Ubuntu system.
```
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub username@ip
......
......@@ -53,4 +53,4 @@ Hi3861 V100 supports burning through the serial port. To burn source code throug
10. Wait until the burning is complete. When the following message is displayed, the burning is successful.
![en-us_image_0000001216761476](figures/en-us_image_0000001216761476.png)
![en-us_image_0000001216761476](figures/en-us_image_0000001216761476.png)
\ No newline at end of file
......@@ -12,4 +12,4 @@
- **[Debugging and Verification](quickstart-ide-lite-steps-hi3861-debug.md)**
- **[Running](quickstart-ide-lite-steps-hi3816-running.md)**
- **[Running](quickstart-ide-lite-steps-hi3861-running.md)**
......@@ -25,7 +25,7 @@ The setup procedure varies, depending on whether you need a GUI. If you need a G
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
```
ls -l /bin/sh
```
......@@ -33,7 +33,7 @@ The setup procedure varies, depending on whether you need a GUI. If you need a G
![en-us_image_0000001226764302](figures/en-us_image_0000001226764302.png)
2. Start the command-line tool, run the following command, enter your password, and select **No** to set **Ubuntu shell** to **bash**.
```
sudo dpkg-reconfigure dash
```
......@@ -45,12 +45,12 @@ The setup procedure varies, depending on whether you need a GUI. If you need a G
3. Decompress the DevEco Device Tool software package and assign permission on the folder obtained from the decompression.
1. Go to the directory where the DevEco Device Tool software package is stored and run the following command to decompress the software package. In the command, change **devicetool-linux-tool-3.0.0.400.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.400.zip
```
2. Open the folder of the decompressed software package and run the following command to grant the execute permission on the installation file. In the command, change **devicetool-linux-tool-3.0.0.400.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.400.sh
```
......@@ -60,7 +60,7 @@ The setup procedure varies, depending on whether you need a GUI. If you need a G
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> During the installation, the setup wizard automatically checks whether Python 3.8 or 3.9 is installed. If Python 3.8 or 3.9 is not installed, the setup wizard displays the "Do you want to continue?" message; enter **Y** to allow the setup wizard to automatically install Python.
```
sudo ./devicetool-linux-tool-3.0.0.400.sh
```
......@@ -126,19 +126,19 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the command fails to be executed and the system displays a message indicating that the openssh-server and openssh-client depend on different versions, install the openssh-client of the required version (for example, **sudo apt-get install openssh-client=1:8.2p1-4**) as prompted on the command-line interface (CLI) and run the command again to install the openssh-server.
```
sudo apt-get install openssh-server
```
2. Run the following command to start the SSH service:
```
sudo systemctl start ssh
```
3. Run the following command to obtain the IP address of the current user for remote access to the Ubuntu environment from Windows:
```
ifconfig
```
......@@ -148,7 +148,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
### Installing Remote SSH
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us-cn_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
![en-us_image_0000001193920448](figures/en-us_image_0000001193920448.png)
......@@ -187,7 +187,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
After the preceding operations are complete, you can remotely connect to the Ubuntu environment through Windows for development. However, you need to frequently enter the remote connection password. To eliminate this need, you can use the SSH public key.
1. Open the Git bash CLI and run the following command to generate an SSH public key. During command execution, perform operations as prompted. Set **username** and **ip** to the user name and IP address you use for connecting to the Ubuntu system.
```
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub username@ip
......
# Setting Up Ubuntu Development Environment<a name="EN-US_TOPIC_0000001174350605"></a>
Operating system: 64-bit version of Ubuntu 16.04 or later.
Perform the following steps to set up the development environment:
1. Obtain source code.
2. Install necessary libraries and tools.
3. Install Python3.
4. Install LLVM \(required only for OpenHarmony\_v1.x\).
5. Install hb.
>![](../public_sys-resources/icon-notice.gif) **NOTICE:**
>- Docker is provided for the Ubuntu build environment, which encapsulates related build tools. If you use Docker to prepare the build environment, you do not need to perform the following steps in this section. For details, see [Using Docker to Prepare the Build Environment](../get-code/gettools-acquire.md#section107932281315).
>- By default, basic software, such as Samba and Vim, is installed in the system. Adaptation on the software is required to support file sharing between the Linux server and the Windows workstation.
>- For details about the compilation and building subsystem of OpenHarmony, see [Compilation and Building Overview](../subsystems/subsys-build-mini-lite.md).
## Obtaining Source Code and Tools<a name="section1897711811517"></a>
The following table describes the tools and source code required for setting up the general environment for a Linux server and how to obtain these tools and the source code.
**Table 1** Source code and development tools and their obtaining methods
<a name="table6299192712513"></a>
<table><thead align="left"><tr id="row122993276512"><th class="cellrowborder" valign="top" width="25.779999999999998%" id="mcps1.2.4.1.1"><p id="p1829914271858"><a name="p1829914271858"></a><a name="p1829914271858"></a>Item</p>
</th>
<th class="cellrowborder" valign="top" width="30.819999999999997%" 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="43.4%" 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="row45863354112"><td class="cellrowborder" valign="top" width="25.779999999999998%" headers="mcps1.2.4.1.1 "><p id="p3587173513117"><a name="p3587173513117"></a><a name="p3587173513117"></a>Source code</p>
</td>
<td class="cellrowborder" valign="top" width="30.819999999999997%" headers="mcps1.2.4.1.2 "><p id="p258713581118"><a name="p258713581118"></a><a name="p258713581118"></a>Develops functions.</p>
</td>
<td class="cellrowborder" valign="top" width="43.4%" headers="mcps1.2.4.1.3 "><p id="p16587835171114"><a name="p16587835171114"></a><a name="p16587835171114"></a>See <a href="../get-code/sourcecode-acquire.md">Source Code Acquisition</a>.</p>
</td>
</tr>
<tr id="row020505735919"><td class="cellrowborder" valign="top" width="25.779999999999998%" headers="mcps1.2.4.1.1 "><p id="p1220513576596"><a name="p1220513576596"></a><a name="p1220513576596"></a>Necessary libraries and tools</p>
</td>
<td class="cellrowborder" valign="top" width="30.819999999999997%" headers="mcps1.2.4.1.2 "><p id="p2206157145919"><a name="p2206157145919"></a><a name="p2206157145919"></a>Used for compilation (such as packaging and image creation).</p>
</td>
<td class="cellrowborder" valign="top" width="43.4%" headers="mcps1.2.4.1.3 "><p id="p920675719597"><a name="p920675719597"></a><a name="p920675719597"></a>Internet</p>
</td>
</tr>
<tr id="row430016273514"><td class="cellrowborder" valign="top" width="25.779999999999998%" 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="30.819999999999997%" headers="mcps1.2.4.1.2 "><p id="p43003270510"><a name="p43003270510"></a><a name="p43003270510"></a>Executes script compilation.</p>
</td>
<td class="cellrowborder" valign="top" width="43.4%" headers="mcps1.2.4.1.3 "><p id="p34760459518"><a name="p34760459518"></a><a name="p34760459518"></a>Internet</p>
</td>
</tr>
<tr id="row7531362055"><td class="cellrowborder" valign="top" width="25.779999999999998%" headers="mcps1.2.4.1.1 "><p id="p1467122152710"><a name="p1467122152710"></a><a name="p1467122152710"></a>LLVM (required only for OpenHarmony_v1.x)</p>
</td>
<td class="cellrowborder" valign="top" width="30.819999999999997%" headers="mcps1.2.4.1.2 "><p id="p1739432372718"><a name="p1739432372718"></a><a name="p1739432372718"></a>Functions as the compiler toolchain.</p>
</td>
<td class="cellrowborder" valign="top" width="43.4%" headers="mcps1.2.4.1.3 "><p id="p59711534202610"><a name="p59711534202610"></a><a name="p59711534202610"></a>Internet</p>
</td>
</tr>
<tr id="row1644079184919"><td class="cellrowborder" valign="top" width="25.779999999999998%" 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="30.819999999999997%" 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="43.4%" headers="mcps1.2.4.1.3 "><p id="p1463918124619"><a name="p1463918124619"></a><a name="p1463918124619"></a>Internet</p>
</td>
</tr>
</tbody>
</table>
>![](../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 **gn** and **ninja**.
>- \(Recommended\) If you obtain the source code via the mirror site or code repository, install compilation tools such as **gn**, **ninja**, and LLVM. When installing these tools, ensure that their environment variable paths are unique.
## Obtaining Source Code<a name="section1545225464016"></a>
You need to acquire [source code](../get-code/sourcecode-acquire.md), download it on a Linux server, and decompress it.
## Installing Necessary Libraries and Tools<a name="section108201740181219"></a>
Run the following command to install the libraries and tools required for compilation:
```
sudo apt-get install build-essential gcc g++ make zlib* libffi-dev e2fsprogs pkg-config flex bison perl bc openssl libssl-dev libelf-dev libc6-dev-amd64 binutils binutils-dev libdwarf-dev u-boot-tools mtd-utils gcc-arm-linux-gnueabi cpio device-tree-compiler
```
## Installing Python3<a name="section1238412211211"></a>
1. Start a Linux server.
2. Run the following command to check the Python version:
```
python3 --version
```
If Python version is earlier than 3.7, reinstall Python. Do as follows to install Python, for example, Python 3.8.
1. Check the Ubuntu version.
```
cat /etc/issue
```
2. Install Python based on the Ubuntu version.
- If the Ubuntu version is 18 or later, run the following command:
```
sudo apt-get install python3.8
```
- If the Ubuntu version is 16, perform the following steps:
a. Install dependency packages.
```
sudo apt update && sudo apt install software-properties-common
```
b. Add the source of deadsnakes PPA and press **Enter**.
```
sudo add-apt-repository ppa:deadsnakes/ppa
```
c. Install Python 3.8.
```
sudo apt upgrade && sudo apt install python3.8
```
3. Set the soft link of **python** and **python3** to **python3.8**.
```
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
```
4. Install and upgrade the Python package management tool \(pip3\) using either of the following methods:
- **Command line:**
```
sudo apt-get install python3-setuptools python3-pip -y
sudo pip3 install --upgrade pip
```
- **Installation package:**
```
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
```
## Installing LLVM \(Required only for OpenHarmony\_v1.x\)<a name="section12202192215415"></a>
>![](../public_sys-resources/icon-notice.gif) **NOTICE:**
>When downloading source code under the OpenHarmony\_v1.x branches or tags, perform the operation procedure described in this section to install LLVM 9.0.0.
>When downloading source code under the Master and OpenHarmony\_v2.x branches or tags, skip this section. The hb automatically downloads the latest version of LLVM.
1. Start a Linux server.
2. [Download LLVM](https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar).
3. Decompress the LLVM installation package to **\~/llvm**.
```
tar -zxvf llvm.tar -C ~/
```
4. Set an environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the **.bashrc** file, save the file, and exit.
```
export PATH=~/llvm/bin:$PATH
```
5. Validate the environment variable.
```
source ~/.bashrc
```
## Installing hb<a name="section15794154618411"></a>
### Prerequisites<a name="section1083283711515"></a>
Python 3.7.4 or later has been installed. For details, see [Installing Python3](#section1238412211211).
### Installation Procedure<a name="section11518484814"></a>
1. Install **hb**.
```
python3 -m pip install --user ohos-build
```
2. Set an environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the **.bashrc** file, save the file, and exit.
```
export PATH=~/.local/bin:$PATH
```
Update the environment variable.
```
source ~/.bashrc
```
3. Run the **hb -h** command. If the following information is displayed, the installation is successful:
```
usage: hb
OHOS build system
positional arguments:
{build,set,env,clean}
build Build source code
set OHOS build settings
env Show OHOS build env
clean Clean output
optional arguments:
-h, --help Show this help message and exit
```
### Uninstalling hb<a name="section3512551574"></a>
```
python3 -m pip uninstall ohos-build
```
>![](../public_sys-resources/icon-notice.gif) **NOTICE:**
>If you encounter any problem during the installation, resort to the [FAQs](quickstart-lite-env-setup-faqs.md).
# Overview<a name="EN-US_TOPIC_0000001128470854"></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.
# Setting Up Windows Development Environment<a name="EN-US_TOPIC_0000001216018805"></a>
System requirements:
- OS: 64-bit Windows 10
- User name: cannot contain Chinese characters
## Installing DevEco Device Tool<a name="en-us_topic_0000001058091994_section10761564496"></a>
DevEco Device Tool is installed in Visual Studio Code as a plug-in and depends on Python, Node.js, and HPM for running.
DevEco Device Tool supports integrated installation. The DevEco Device Tool setup wizard checks whether the adaptation versions of Visual Studio Code, Python, Node.js and HPM tools have been installed. If any of the tools is not installed, you'll be prompted to select the tool to be automatically installed.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>Before installing DevEco Device Tool, make sure the user name of the host does not contain Chinese characters. Otherwise, the **DevEco Home** page will be stuck loading and the DevEco Device Tool cannot work.
1. Log in to the [HarmonyOS Device website](https://device.harmonyos.com/cn/ide#download_beta) with your HUAWEI ID and download DevEco Device Tool V3.0 Beta1 or a later version. If you do not have a HUAWEI ID, [register](https://developer.huawei.com/consumer/en/doc/start/registration-and-verification-0000001053628148) one first.
2. Decompress the DevEco Device Tool package, double-click the installer, and then click **Next**.
3. Set the installation path of DevEco Device Tool and click **Next**.
4. When prompted, select the tools to be automatically installed and click **Next**.
![](figures/snap28.png)
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>When the setup wizard detects that a compatible Python version has been installed, it prompts you to select the installed Python version or download the recommended Python version.
5. In the dialog box shown below, click **Next** to download and install the tools.
![](figures/snap8.png)
6. In the displayed Python setup wizard, select **Add Python 3.8 to PATH** and click **Install Now**. After the installation is complete, click **Close**.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you have selected the compatible Python version installed on your device, the Python setup wizard will not be displayed. In this case, you skip this step.
>If DevEco Device Tool 2.1 Release is installed, the Python version must be 3.8.x. If DevEco Device Tool V3.0 Beta1 or a later version is installed, the Python version must be 3.8.x or 3.9.x.
![](figures/snap34.png)
7. In the Visual Studio Code setup wizard, install Visual Studio Code as prompted. During the installation, select **Add to PATH \(requires shell restart\)**.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you are using the correct version of Visual Studio Code, the Visual Studio Code setup wizard will not be displayed. In this case, you skip this step.
![](figures/snap33.png)
8. In the Node.js setup wizard, retain the default settings 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**.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you are using the correct version of Node.js, the Node.js setup wizard will not be displayed. In this case, you skip this step.
9. Wait for the DevEco Device Tool setup wizard to automatically install the HPM and DevEco Device Tool. After the installation is complete, click **Finish** to close the setup wizard.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you are using the correct version of HPM, the setup wizard does not download or install HPM.
10. Start Visual Studio Code. The C/C++ and CodeLLDB plug-ins on which DevEco Device Tool depends will be automatically installed. After the installation is complete, click ![](figures/button.png) on the left of Visual Studio Code to check whether C/C++, CodeLLDB, and DevEco Device Tool are included in the **INSTALLED** list.
>![](../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/deveco-device-tool-install-sucessful.png)
......@@ -19,7 +19,7 @@ To install the necessary libraries and tools, perform the following steps.
On Ubuntu:
1. Run the following **apt-get** command:
```
sudo apt-get update && sudo apt-get install binutils binutils-dev git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib gcc-arm-linux-gnueabi libc6-dev-i386 libc6-dev-amd64 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3.8 python3-pip ruby genext2fs device-tree-compiler make libffi-dev e2fsprogs pkg-config perl openssl libssl-dev libelf-dev libdwarf-dev u-boot-tools mtd-utils cpio doxygen liblz4-tool openjdk-8-jre gcc g++ texinfo dosfstools mtools default-jre default-jdk libncurses5 apt-utils wget scons python3.8-distutils tar rsync git-core libxml2-dev lib32z-dev grsync xxd libglib2.0-dev libpixman-1-dev kmod jfsutils reiserfsprogs xfsprogs squashfs-tools pcmciautils quota ppp libtinfo-dev libtinfo5 libncurses5-dev libncursesw5 libstdc++6 gcc-arm-none-eabi vim ssh locales
```
......@@ -35,13 +35,13 @@ On Ubuntu:
Check the location of Python 3.8:
```
which python3.8
```
Change python and python3 to python3.8.
```
sudo update-alternatives --install /usr/bin/python python {python3.8 path} 1 #{Python3.8 path} is the location of Python 3.8 obtained in the previous step.
sudo update-alternatives --install /usr/bin/python3 python3 {python3.8 path} 1 #{Python3.8 path} is the location of Python 3.8 obtained in the previous step.
......@@ -104,14 +104,14 @@ To remotely access the Ubuntu environment through Windows to perform operations
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
```
ls -l /bin/sh
```
![en-us_image_0000001226764302](figures/en-us_image_0000001226764302.png)
2. Start the command-line tool, run the following command, enter your password, and select **No** to set **Ubuntu shell** to **bash**.
```
sudo dpkg-reconfigure dash
```
......@@ -123,12 +123,12 @@ To remotely access the Ubuntu environment through Windows to perform operations
3. Decompress the DevEco Device Tool software package and assign permission on the folder obtained from the decompression.
1. Go to the directory where the DevEco Device Tool software package is stored and run the following command to decompress the software package. In the command, change **devicetool-linux-tool-3.0.0.400.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.400.zip
```
2. Open the folder of the decompressed software package and run the following command to grant the execute permission on the installation file. In the command, change **devicetool-linux-tool-3.0.0.400.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.400.sh
```
......@@ -138,7 +138,7 @@ To remotely access the Ubuntu environment through Windows to perform operations
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> During the installation, the setup wizard automatically checks whether Python 3.8 or 3.9 is installed. If Python 3.8 or 3.9 is not installed, the setup wizard displays the "Do you want to continue?" message; enter **Y** to allow the setup wizard to automatically install Python.
```
sudo ./devicetool-linux-tool-3.0.0.400.sh
```
......@@ -158,19 +158,19 @@ To remotely access the Ubuntu environment through Windows to perform operations
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the command fails to be executed and the system displays a message indicating that the openssh-server and openssh-client depend on different versions, install the openssh-client of the required version (for example, **sudo apt-get install openssh-client=1:8.2p1-4**) as prompted on the command-line interface (CLI) and run the command again to install the openssh-server.
```
sudo apt-get install openssh-server
```
2. Run the following command to start the SSH service:
```
sudo systemctl start ssh
```
3. Run the following command to obtain the IP address of the current user for remote access to the Ubuntu environment from Windows:
```
ifconfig
```
......@@ -180,7 +180,7 @@ To remotely access the Ubuntu environment through Windows to perform operations
### Installing Remote SSH
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us-cn_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
![en-us_image_0000001193920448](figures/en-us_image_0000001193920448.png)
......@@ -219,7 +219,7 @@ To remotely access the Ubuntu environment through Windows to perform operations
After the preceding operations are complete, you can remotely connect to the Ubuntu environment through Windows for development. However, you need to frequently enter the remote connection password. To eliminate this need, you can use the SSH public key.
1. Open the Git bash CLI and run the following command to generate an SSH public key. During command execution, perform operations as prompted. Set **username** and **ip** to the user name and IP address you use for connecting to the Ubuntu system.
```
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub username@ip
......@@ -256,13 +256,13 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
```
Run the following command to install the tools:
```
sudo apt-get install git git-lfs
```
4. Configure user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
......@@ -270,7 +270,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
```
5. Run the following commands to install the **repo** tool:
```
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
chmod a+x /usr/local/bin/repo
......@@ -295,7 +295,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
......@@ -310,7 +310,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
### Running prebuilts
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
```
bash build/prebuilts_download.sh
```
......@@ -326,34 +326,34 @@ Perform the following steps in Ubuntu:
### Install hb.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> To install a proxy, see [Configuring a Proxy](../quick-start/quickstart-lite-reference.md#configuring-a-proxy).
> To install a proxy, see [Configuring the Proxy](../quick-start/quickstart-lite-reference.md#section6204129143010).
1. Run the following command to install hb and update it to the latest version:
```
pip3 install --user build/lite
```
2. Set the environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
export PATH=~/.local/bin:$PATH
```
Update the environment variable.
```
source ~/.bashrc
```
3. Run the **hb -h** command in the source code directory. If the following information is displayed, the installation is successful:
```
usage: hb
......@@ -372,7 +372,7 @@ Perform the following steps in Ubuntu:
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
> - Run the following command to uninstall hb:
>
>
> ```
> pip3 uninstall ohos-build
> ```
......@@ -392,26 +392,26 @@ Perform the following steps in Ubuntu:
2. [Download LLVM](https://repo.huaweicloud.com/harmonyos/compiler/clang/9.0.0-36191/linux/llvm-linux-9.0.0-36191.tar)
3. Decompress the LLVM installation package to **~/llvm**.
```
tar -zxvf llvm.tar -C ~/
```
4. Set the environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
export PATH=~/llvm/bin:$PATH
```
5. Validate the environment variable.
```
source ~/.bashrc
```
......@@ -11,7 +11,7 @@
- [Burning](quickstart-ide-lite-steps-hi3861-burn.md)
- [Networking](quickstart-ide-lite-steps-hi3861-netconfig.md)
- [Debugging and Verification](quickstart-ide-lite-steps-hi3861-debug.md)
- [Running](quickstart-ide-lite-steps-hi3816-running.md)
- [Running](quickstart-ide-lite-steps-hi3861-running.md)
- Hi3516 Development Board
- [Writing a Hello World Program](quickstart-ide-lite-steps-hi3516-application-framework.md)
- [Building](quickstart-ide-lite-steps-hi3516-building.md)
......
# Hi3518 Development Board<a name="EN-US_TOPIC_0000001174270693"></a>
## Introduction<a name="section14815247616"></a>
Hi3518E V300 is a next-generation system on chip \(SoC\) designed for the industry-dedicated smart HD IP camera. It introduces a next-generation image signal processor \(ISP\), the H.265 video compression encoder, and the advanced low-power process and architecture design, leading the industry in terms of low bit rate, high image quality, and low power consumption.
**Figure 1** Hi3518E V300 front view<a name="fig73059502010"></a>
![](figures/hi3518e-v300-front-view.png "hi3518e-v300-front-view")
**Figure 2** Hi3518E V300 rear view<a name="fig14828141713116"></a>
![](figures/hi3518e-v300-rear-view.png "hi3518e-v300-rear-view")
## Development Board Specifications<a name="section765112478446"></a>
**Table 1** Specifications of the Hi3518 development board
<a name="t88739bdd7be845fab34087af8ab692f7"></a>
<table><thead align="left"><tr id="r7d87cdc7a09d445c824000228ae4a3b0"><th class="cellrowborder" valign="top" width="28.749999999999996%" id="mcps1.2.3.1.1"><p id="a8ea7b45c00a54e7abd826c3b2bc934dc"><a name="a8ea7b45c00a54e7abd826c3b2bc934dc"></a><a name="a8ea7b45c00a54e7abd826c3b2bc934dc"></a><strong id="b18619196194114"><a name="b18619196194114"></a><a name="b18619196194114"></a>Type</strong></p>
</th>
<th class="cellrowborder" valign="top" width="71.25%" id="mcps1.2.3.1.2"><p id="aac42bd02e83846b187c02d3e976c0b09"><a name="aac42bd02e83846b187c02d3e976c0b09"></a><a name="aac42bd02e83846b187c02d3e976c0b09"></a><strong id="b591334418397"><a name="b591334418397"></a><a name="b591334418397"></a>Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="r9c0a0b643fd7495ab799c1eab9fbe1ec"><td class="cellrowborder" valign="top" width="28.749999999999996%" headers="mcps1.2.3.1.1 "><p id="a1a129c845a45444f9d0b7dcc3aabf4c3"><a name="a1a129c845a45444f9d0b7dcc3aabf4c3"></a><a name="a1a129c845a45444f9d0b7dcc3aabf4c3"></a>Processor core</p>
</td>
<td class="cellrowborder" valign="top" width="71.25%" headers="mcps1.2.3.1.2 "><a name="ul12459548104218"></a><a name="ul12459548104218"></a><ul id="ul12459548104218"><li>Hi3518E V300</li></ul>
</td>
</tr>
<tr id="row1527851224210"><td class="cellrowborder" valign="top" width="28.749999999999996%" headers="mcps1.2.3.1.1 "><p id="p1327911123424"><a name="p1327911123424"></a><a name="p1327911123424"></a>Imaging device</p>
</td>
<td class="cellrowborder" valign="top" width="71.25%" headers="mcps1.2.3.1.2 "><a name="ul49841342134210"></a><a name="ul49841342134210"></a><ul id="ul49841342134210"><li>1/2.9 F23</li></ul>
</td>
</tr>
<tr id="r79097125b7f64c189f67ac280cdacae9"><td class="cellrowborder" valign="top" width="28.749999999999996%" headers="mcps1.2.3.1.1 "><p id="a2bf783139e304d0f9bfeefc56a55dc66"><a name="a2bf783139e304d0f9bfeefc56a55dc66"></a><a name="a2bf783139e304d0f9bfeefc56a55dc66"></a>External interfaces</p>
</td>
<td class="cellrowborder" valign="top" width="71.25%" headers="mcps1.2.3.1.2 "><a name="u6a04d9aa22f6410f91bbcdaf902d0e5f"></a><a name="u6a04d9aa22f6410f91bbcdaf902d0e5f"></a><ul id="u6a04d9aa22f6410f91bbcdaf902d0e5f"><li>External microphone</li><li>External 8 Ω/1.5 W speaker</li></ul>
</td>
</tr>
<tr id="r785d104d71f6426aa9aab25d14a7581b"><td class="cellrowborder" valign="top" width="28.749999999999996%" headers="mcps1.2.3.1.1 "><p id="a59fb5f9ca2004dd2abeb636b2d4c04fa"><a name="a59fb5f9ca2004dd2abeb636b2d4c04fa"></a><a name="a59fb5f9ca2004dd2abeb636b2d4c04fa"></a>External memory interface</p>
</td>
<td class="cellrowborder" valign="top" width="71.25%" headers="mcps1.2.3.1.2 "><a name="u8f323b7322a14e109e2937b9660af0c4"></a><a name="u8f323b7322a14e109e2937b9660af0c4"></a><ul id="u8f323b7322a14e109e2937b9660af0c4"><li>TF card<p id="p167481654192716"><a name="p167481654192716"></a><a name="p167481654192716"></a>A maximum file size of 128 GB is allowed (FAT32 format).</p>
</li></ul>
</td>
</tr>
<tr id="rae3f8ef812894db3951e01b4a1b85438"><td class="cellrowborder" valign="top" width="28.749999999999996%" headers="mcps1.2.3.1.1 "><p id="a81cd5d5655a44c4cbfc0a35b9f65450a"><a name="a81cd5d5655a44c4cbfc0a35b9f65450a"></a><a name="a81cd5d5655a44c4cbfc0a35b9f65450a"></a>WLAN protocol</p>
</td>
<td class="cellrowborder" valign="top" width="71.25%" headers="mcps1.2.3.1.2 "><a name="ul1311935314215"></a><a name="ul1311935314215"></a><ul id="ul1311935314215"><li>802.11 b/g/n</li></ul>
</td>
</tr>
</tbody>
</table>
# Introduction<a name="EN-US_TOPIC_0000001181550103"></a>
- **[Hi3861 Development Board](quickstart-lite-introduction-hi3861.md)**
- **[Hi3516 Development Board](quickstart-lite-introduction-hi3516.md)**
- **[Hi3518 Development Board](quickstart-lite-introduction-hi3518.md)**
......@@ -5,7 +5,7 @@
1. Go to the root directory of the source code and run the build command.
```
./build.sh --product-name name --ccache
```
......@@ -14,7 +14,7 @@
> _name_ indicates the product name, for example, **Hi3516D V300** and **rk3568**.
2. Check the build result. After the build is complete, the following information is displayed in the log:
```
post_process
=====build name successful.
......@@ -25,19 +25,19 @@
> For details about other modular compilation operations, see [Building a Standard System](../subsystems/subsys-build-standard-large.md).
## Configuring the Proxy
## Configuring the Proxy<a name="section6204129143010"></a>
### Setting Up the Python Proxy
1. Create a proxy configuration file.
```
mkdir ~/.pipvim ~/.pip/pip.conf
```
2. Add the following proxy information to the file, save the file, and exit:
```
[global]
index-url = http:// Proxy URL
......@@ -49,20 +49,20 @@
### Setting Up the npm Proxy
1. Create a proxy configuration file.
```
vim ~/.npmrc
```
2. Add the following proxy information to the file, save the file, and exit:
```
Registry=http:// Proxy URL
strict-ssl=false
```
3. Add the following content to the **.bashrc** file, save the file, and exit:
```
export NPM_REGISTRY=http:// Proxy URL
source .bashrc
......
# Obtaining Source Code<a name="EN-US_TOPIC_0000001177086414"></a>
## Prerequisites<a name="section21887149017"></a>
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
3. Install the [git client](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure basic user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
```
4. Run the following commands to install the **repo** tool:
```
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
## How to Obtain<a name="section349724435812"></a>
>![](../public_sys-resources/icon-note.gif) **NOTE**<br/>
>Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities.
- **Obtaining OpenHarmony master code**
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
```
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
- **Obtaining OpenHarmony release code**
For details about how to obtain the source code of an OpenHarmony release, see the [Release-Notes](../get-code/../../release-notes/Readme.md).
# FAQs<a name="EN-US_TOPIC_0000001128470856"></a>
## "Error: Opening COMxx: Access denied" Is Displayed After a Serial Port Is Selected for Burning<a name="section627268185113"></a>
- **Symptom**
**Error: Opening COMxx: Access denied** is displayed after clicking **Burn** and selecting a serial port.
![](figures/failed-to-open-the-serial-port.png)
- **Possible Causes**
The serial port has been used.
- Solution
The serial port may be in use. Perform the following steps to troubleshoot:
1. Search for the serial port from the drop-down list in the **TERMINAL** panel.
![](figures/terminal-list.png)
2. Click the dustbin for the terminal using the serial port to disable the terminal.
## 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 1** Failed to obtain the image file due to unavailable connection<a name="fig135261439195819"></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**.
![](figures/hi3516-network-and-firewall-setting.png)
3. Click **Firewall & network protection**, and on the displayed page, click **Allow applications to communicate through Windows Firewall**.
![](figures/hi3516-firewall-and-network-protection.png)
4. Select the Visual Studio Code application.
![](figures/hi3516-selecting-the-visual-studio-code-application.png)
5. Select the **Private** and **Public** network access rights for the Visual Studio Code application.
![](figures/hi3516-allowing-the-visual-studio-code-application-to-access-the-network.png)
## 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/symptom-for-not-finding-python.png)
- **Possible Cause 1**: Python is not installed.
- **Solutions**
[Install Python](../quick-start/quickstart-lite-env-setup-linux.md).
- **Possible Cause 2**: The soft link that points to the Python does not exist in the usr/bin directory.
![](figures/reason-for-not-finding-python.png)
- **Solutions**
Run the following commands:
```
# cd /usr/bin/
# which python3
# ln -s /usr/local/bin/python3 python
# python --version
```
Example:
![](figures/solution.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 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 2** 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_0000001128311064"></a>
## "Error: Opening COMxx: Access denied" Is Displayed After a Serial Port Is Selected for Burning<a name="section1498892119619"></a>
- **Symptom**
**Error: Opening COMxx: Access denied** is displayed after clicking **Burn** and selecting a serial port.
![](figures/failed-to-open-the-serial-port.png)
- **Possible Causes**
The serial port has been used.
- Solution
The serial port may be in use. Perform the following steps to troubleshoot:
1. Search for the serial port from the drop-down list in the **TERMINAL** panel.
![](figures/terminal-list.png)
2. Click the dustbin for the terminal using the serial port to disable the terminal.
## 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 1** 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-0.png "failed-to-obtain-the-image-file-due-to-unavailable-connection-0")
- **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**.
![](figures/hi3518-network-and-firewall-setting.png)
3. Click **Firewall & network protection**, and on the displayed page, click **Allow applications to communicate through Windows Firewall**.
![](figures/hi3518-firewall-and-network-protection.png)
4. Select the Visual Studio Code application.
![](figures/hi3518-selecting-the-visual-studio-code-application.png)
5. Select the **Private** and **Public** network access rights for the Visual Studio Code application.
![](figures/hi3518-allowing-the-visual-studio-code-application-to-access-the-network.png)
## 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/hi3518-error-for-not-finding-python.png)
- **Possible Cause 1**
Python is not installed.
- **Solutions**
[Install Python](../quick-start/quickstart-lite-env-setup-linux.md).
- **Possible Cause 2**: The soft link that points to the Python does not exist in the usr/bin directory.
![](figures/hi3518-reason-no-python-soft-link.png)
- **Solutions**
Run the following commands:
```
# cd /usr/bin/
# which python3
# ln -s /usr/local/bin/python3 python
# python --version
```
Example:
![](figures/hi3518-solution-set-python-soft-link.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 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/login-serial-port.png)
# Running a Hello OHOS Program<a name="EN-US_TOPIC_0000001174350607"></a>
This section describes how to create, compile, burn, and run the first program, and finally print **Hello OHOS!** on the develop board.
## Creating a Program<a name="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 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/gettools-acquire.md#section107932281315). If the Linux environment is installed using a software package, go to the root directory of the source code and run the following commands for source code compilation:
```
hb set (Set the building path.)
. (Select the current path.)
Select ipcamera_hispark_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** Hi3518 settings<a name="fig12982192583111"></a>
![](figures/hi3518-settings.png "hi3518-settings")
>![](../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>
Burning is the process of downloading compiled program files to a chipset development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn development boards quickly and efficiently.
You can burn the Hi3518E V300 development board through the USB port or serial port.
- **Windows system: Supports burning through the USB port or serial port**
- **Linux system: Supports burning through the serial port \(Linux+Windows dual system: Supports burning through the serial port or USB port\)**
Except for environment setup, the operations of burning are the same for Windows and Linux.
The following uses the USB port burning as an example.
1. Connect the PC and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3518 Development Board](https://device.harmonyos.com/en/docs/start/introduce/oem_minitinier_des_3518-0000001105201138).
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/hi3518-record-the-serial-port-number.png)
3. Open DevEco Device Tool, choose **QUICK ACCESS** \> **DevEco Home** \> **Projects**, and then click **Settings**.
![](figures/hi3518-deveco-device-tool-setting.png)
4. On the **Partition Configuration** tab page, modify the settings. In general cases, you can leave the fields at their default settings.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If the file to be burnt is obtained by copying, you must manually change the path of the file to be burnt: Click the tab of the file to be burnt, select **Partition\_bin** from the **New Option** drop-down list box in **Partition Settings**, and set the path of the file to be burnt in **Partition\_bin**.
5. On the **hi3518ev300** tab page, set the burning options.
- **upload\_port**: Select the serial port number obtained in step [2](#en-us_topic_0000001057313128_li46411811196).
- **upload\_protocol**: Select the burning protocol **hiburn-usb**.
- **upload\_partitions**: Select the files to be burnt. By default, the **fastboot**, **kernel**, **rootfs**, and **userfs** files are burnt at the same time.
![](figures/upload-options.png)
6. When you finish modifying, click **Save** in the upper right corner.
7. Open the project file, go to ![](figures/hi3518-deveco-device-tool-logo.png) \> **PROJECT TASKS** \> **hi3518ev300\_fastboot** \> **Erase** to erase U-Boot.
![](figures/erase-u-boot.png)
8. When the following message is displayed, power off the development board and then power it on.
![](figures/hi3518-restart-the-development-board.png)
9. If the following message is displayed, it indicates that U-Boot is erased successfully.
![](figures/u-boot-erased-successfully.png)
10. Go to **hi3518ev300** \> **Upload** to start burning.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If this is the first time you burn the Hi3516D V300 or Hi3518E V300 board, the message "not find the Devices" may be displayed. In this case, follow the steps in [Installing the USB Driver on the Hi3516 or Hi3518 Series Development Boards](https://device.harmonyos.com/en/docs/ide/user-guides/usb_driver-0000001058690393) and start burning again.
![](figures/hi3518-upload.png)
11. If the following message is displayed, it indicates that the burning is successful.
![](figures/hi3518-burning-succeeded.png)
12. When the burning is successful, perform the operations in Running an Image to start the system.
## Running an Image<a name="section17612105814480"></a>
After burning is completed, you need to configure the bootloader to run the OpenHarmony system.
1. In the Hi3518E V300 task, click **Configure bootloader \(Boot OS\)** to configure the bootloader.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>The bootloader configuration in DevEco Device Tool has been adapted to Hi3518E V300. Therefore, no manual modification is needed.
![](figures/hi3518-bootloader.png)
2. When the message shown below is displayed, restart the development board. If **SUCCESS** is displayed, it indicates that the configuration is successful.
![](figures/hi3518-reset-success.png)
3. Click **Monitor** on the taskbar to start the serial port tool.
![](figures/hi3518-monitor.png)
4. Follow the onscreen instructions until **OHOS \#** is displayed, indicating that the system is started successfully.
![](figures/hi3518-reboot-success.png)
## 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/device-iotcamera.md).
# Setting Up the Environment<a name="EN-US_TOPIC_0000001128470862"></a>
## 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** Hi3518 hardware connections<a name="fig145521530134016"></a>
![](figures/hi3518-hardware-connections.png "hi3518-hardware-connections")
### Software<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="section434110241084"></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="section25911132141020"></a>
Install the software.
```
sudo apt-get install build-essential gcc g++ make zlib* libffi-dev
```
### Installing File Packing Tools<a name="section390214473129"></a>
1. Start a Linux server.
2. Install dosfstools, mtools, and mtd-utils.
```
sudo apt-get install dosfstools mtools mtd-utils
```
# Hi3518<a name="EN-US_TOPIC_0000001128311052"></a>
- **[Setting Up the Environment](quickstart-lite-steps-hi3518-setting.md)**
- **[Running a Hello OHOS Program](quickstart-lite-steps-hi3518-running.md)**
- **[FAQs](quickstart-lite-steps-hi3518-faqs.md)**
......@@ -87,4 +87,4 @@ After the source code is imported, perform the following steps:
10. Wait until the burning is complete. When the following message is displayed, the burning is successful.
![en-us_image_0000001216761476](figures/en-us_image_0000001216761476.png)
![en-us_image_0000001216761476](figures/en-us_image_0000001216761476.png)
\ No newline at end of file
# Setting Up WLAN Connection<a name="EN-US_TOPIC_0000001174350611"></a>
This example shows how to connect the WLAN module to the gateway using attention \(AT\) commands.
## Building Source Code<a name="section191121332125319"></a>
This section describes how to perform the WLAN module building on a Linux server.
If the Linux environment is installed using Docker, perform the building by referring to [Using Docker to Prepare the Build Environment](../get-code/gettools-acquire.md#section107932281315). If the Linux environment is installed using a software package, perform the following steps:
1. Open the HUAWEI DevEco Device Tool and choose **View** \> **Terminal**.
**Figure 1** Starting the IDE terminal tool<a name="fig755583241511"></a>
![](figures/starting-the-ide-terminal-tool.png "starting-the-ide-terminal-tool")
On the **TERMINAL** panel, run the ssh command, for example, **ssh** **_user_@_ipaddr_**, to connect to the Linux server.
**Figure 2** TERMINAL panel<a name="fig14407256101510"></a>
![](figures/terminal-panel.png "terminal-panel")
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="fig191035701814"></a>
![](figures/selecting-the-target-build-version.png "selecting-the-target-build-version")
3. Run the **hb build** command to start building.
**Figure 4** Running commands on the TERMINAL panel<a name="fig10635942111916"></a>
![](figures/running-commands-on-the-terminal-panel.png "running-commands-on-the-terminal-panel")
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="fig195291328182015"></a>
![](figures/successful-building.png "successful-building")
5. Check whether the following files are generated in the **./out/wifiiot/** directory.
```
ls -l out/hispark_pegasus/wifiiot_hispark_pegasus/
```
**Figure 6** Directory for storing the generated files<a name="fig112257131214"></a>
![](figures/directory-for-storing-the-generated-files.png "directory-for-storing-the-generated-files")
## Burning Images<a name="section3288165814218"></a>
Burning is the process of downloading compiled program files to a chipset development board to provide a basis for subsequent debugging. With the one-click burning function of DevEco Device Tool, you can burn development boards quickly and efficiently.
**You can burn to the Hi3861 V100 development board through the serial port using the burn-serial or hiburn-serial protocol. The hiburn-serial protocol is applicable to both Windows and Linux systems, while the burn-serial is applicable to Linux only.**
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>The burn-serial protocol is used for compatibility with the projects of historical versions. It does not differ from hiburn-serial in operations.
The operations for burning in Windows and Linux are the same. The only difference lies in the environment setup for DevEco Device Tool.
1. Connect the PC and the target development board through the USB port. For details, see [Introduction to the Hi3861 Development Board](https://device.harmonyos.com/en/docs/start/introduce/oem_minitinier_des_3861-0000001105041324).
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.
>![](../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 Board](https://device.harmonyos.com/en/docs/ide/user-guides/hi3861-drivers-0000001058153433).
![](figures/hi3861-record-the-serial-port-number.png)
3. Open DevEco Device Tool, choose **QUICK ACCESS** \> **DevEco Home** \> **Projects**, and then click **Settings**.
![](figures/hi3861-deveco-device-tool-setting.png)
4. On the **Partition Configuration** tab page, modify the settings. In general cases, you can leave the fields at their default settings.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If the file to be burnt is obtained by copying, you must manually change the path of the file to be burnt: Click the tab of the file to be burnt, select **Partition\_bin** from the **New Option** drop-down list box in **Partition Settings**, and set the path of the file to be burnt in **Partition\_bin**.
5. On the **hi3861** tab page, set the burning options.
- **upload\_port**: Select the serial port number obtained in step [2](#en-us_topic_0000001056563976_li848662117291).
- **upload\_protocol**: Select the burning protocol. For Windows, set this parameter to **burn-serial** or **hiburn-serial**. For Linux, set this parameter to **hiburn-serial**.
- **upload\_partitions**: Select the files to be burnt. **hi3861\_app** is selected by default.
![](figures/options.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 burning.
![](figures/hi3861-upload.png)
8. When the following information is displayed, press the RST button on the development board to restart it.
![](figures/hi3861-restart-the-development-board.png)
9. If the following message is displayed, it indicates that the burning is successful.
![](figures/hi3861-burning-succeeded.png)
## Connecting WLAN Module to the Internet.<a name="section194671619167"></a>
After completing version building and burning, do as follows to connect the WLAN module to the Internet using AT commands.
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.
**Figure 7** Opening the DevEco serial port<a name="fig464411253297"></a>
![](figures/opening-the-deveco-serial-port.png "opening-the-deveco-serial-port")
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 8** Successful resetting of the WLAN module <a name="fig3327108143016"></a>
![](figures/successful-resetting-of-the-wlan-module.png "successful-resetting-of-the-wlan-module")
3. Run the following AT commands in sequence via the DevEco serial port terminal to start the STA mode, connect to the specified AP, and enable Dynamic Host Configuration Protocol \(DHCP\).
```
AT+STARTSTA # Start the STA mode.
AT+SCAN # Scan for available APs.
AT+SCANRESULT # Display the scanning result.
AT+CONN="SSID",,2,"PASSWORD" # Connect to the specified AP. (SSID and PASSWORD represent the name and password of the hotspot to be connected, respectively.)
AT+STASTAT # View the connection result.
AT+DHCP=wlan0,1 # Request the IP address of wlan0 from the AP using DHCP.
```
4. Check whether the 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 9** Successful networking of the WLAN module<a name="fig7672858203010"></a>
![](figures/successful-networking-of-the-wlan-module.png "successful-networking-of-the-wlan-module")
# FAQs<a name="EN-US_TOPIC_0000001128311054"></a>
## 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>
- **Symptom**
The following error occurs during Python 3 installation:
```
configure: error: no acceptable C compiler found in $PATH. See 'config.log' for more details
```
- **Possible Causes**
**GCC** is not installed.
- **Solutions**
1. Run the **apt-get install gcc** command to install **GCC** online.
2. After the installation, reinstall Python 3.
## What should I do when the message **-bash: make: command not found** is displayed during Python 3 installation?<a name="section1913477181213"></a>
- **Symptom**
The following error occurs during Python 3 installation:
```
-bash: make: command not found
```
- **Possible Causes**
**Make** is not installed.
- **Solutions**
1. Run the **apt-get install make** command to install **Make** online.
2. After the installation, reinstall Python 3.
## What should I do when the message **zlib not available** is displayed during Python 3 installation?<a name="section108211415131210"></a>
- **Symptom**
The following error occurs during Python 3 installation:
```
zipimport.ZipImportError: can't decompress data; zlib not available
```
- **Possible Causes**
**zlib** is not installed.
- **Solutions**
Solution 1: Run the **apt-get install zlib** command to install **zlib** online.
Solution 2: If the software source does not contain **zlib**, download the source code from [http://www.zlib.net/](http://www.zlib.net/).
![](figures/download-zlib.png)
Then run the following commands to install **zlib** offline:
```
# tar xvf zlib-1.2.11.tar.gz
# cd zlib-1.2.11
# ./configure
# make && make install
```
After the installation, reinstall Python 3.
## What should I do when the message **No module named '\_ctypes'** is displayed during Python 3 installation?<a name="section2062268124"></a>
- **Symptom**
The following error occurs during Python 3 installation:
```
ModuleNotFoundError: No module named '_ctypes'
```
- **Possible Causes**
**libffi** and **libffi-devel** are not installed.
- **Solutions**
1. Run the **apt-get install libffi\* -y** command to install **libffi** and **libffi-devel** online.
2. After the installation, reinstall Python 3.
## What should I do when the message **No module named 'Crypto'** is displayed during compilation and building?<a name="section982315398121"></a>
- **Symptom**
The following error occurs during compilation and building:
```
ModuleNotFoundError: No module named 'Crypto'
```
- **Possible Causes**
**Crypto** is not installed.
- **Solutions**
Solution 1: Run the **pip3 install Crypto** command to install **Crypto** online.
Solution 2: Install **Crypto** offline.
- Download the source code from [https://pypi.org/project/pycrypto/\#files](https://pypi.org/project/pycrypto/#files).
![](figures/download-the-source-code.png)
- Save the source code package to the Linux server, decompress the package, and run the **python3 setup.py install** command to install **Crypto**.
- Rebuild an environment.
## What should I do when the message **No module named 'ecdsa'** is displayed during compilation and building?<a name="section102035451216"></a>
- **Symptom**
The following error occurs during compilation and building:
```
ModuleNotFoundError: No module named 'ecdsa'
```
- **Possible Causes**
**ecdsa** is not installed.
- **Solutions**
Solution 1: Run the **pip3 install ecdsa** command to install **ecdsa** online.
Solution 2: Install **ecdsa** offline.
- Download the installation package from [https://pypi.org/project/ecdsa/\#files](https://pypi.org/project/ecdsa/#files).
![](figures/download-ecdsa.png)
- Save the installation package to the Linux server and run the **pip3 install ecdsa-0.15-py2.py3-none-any.whl** command to install **ecdsa**.
- Rebuild an environment.
## What should I do when the message **Could not find a version that satisfies the requirement six\>=1.9.0** is displayed during compilation and building?<a name="section4498158162320"></a>
- **Symptom**
The following error occurs during compilation and building:
```
Could not find a version that satisfies the requirement six>=1.9.0
```
- **Possible Causes**
**six** is not installed.
- **Solutions**
Solution 1: Run the **pip3 install six** command to install **six** online.
Solution 2: Install **six** offline.
- Download the installation package from [https://pypi.org/project/six/\#files](https://pypi.org/project/six/#files).
![](figures/download-six.png)
- Save the source code to the Linux server and run the **pip3 install six-1.14.0-py2.py3-none-any.whl** command to install **six**.
- Rebuild an environment.
## What should I do when the message **cannot find -lgcc** is displayed during compilation and building?<a name="section11181036112615"></a>
- **Symptom**
The following error occurs during compilation and building:
```
riscv32-unknown-elf-ld: cannot find -lgcc
```
- **Possible Causes**
The PATH is incorrectly written by **gcc\_riscv32**. There is an extra slash \(/\).
```
~/gcc_riscv32/bin/:/data/toolchain/
```
- **Solutions**
Modify the PATH by deleting the slash \(/\).
```
~/gcc_riscv32/bin:/data/toolchain/
```
## What should I do when the message indicating Python cannot be found is displayed during compilation and building?<a name="section1571810194619"></a>
- **Symptom**
The following error occurs during compilation and building:
```
-bash: /usr/bin/python: No such file or directory
```
- **Possible Cause 1:** Python is not installed.
- **Solutions**
[Install Python](../quick-start/quickstart-lite-env-setup-linux.md).
- **Possible Cause 2:** The soft link that points to the Python does not exist in the **usr/bin** directory.
![](figures/reason-no-python-soft-link.png)
- **Solutions**
Run the following commands to add a soft link:
```
# cd /usr/bin/
# which python3
# ln -s /usr/local/bin/python3 python
# python --version
```
Example:
![](figures/solution-add-soft-link.png)
## What should I do when the message indicating Python3 cannot be found is displayed during compilation and building?<a name="section108385316482"></a>
- **Symptom**
![](figures/11.png)
- **Possible Causes**
Python 3 is not installed.
- **Solutions**
[Install Python](../quick-start/quickstart-lite-env-setup-linux.md).
## What should I do when an error with **lsb\_release** occurs during **kconfiglib** installation?<a name="section691681635814"></a>
- **Symptom**
The following error occurs during **kconfiglib** installation:
```
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.
```
- **Possible Causes**
The Python version matched with the **lsb\_release** module is different from the current Python version.
- **Solutions**
Run the **find / -name lsb\_release** command, for example, **sudo rm -rf /usr/bin/lsb\_release** to locate and delete **lsb\_release**.
# Running a Hello World Program<a name="EN-US_TOPIC_0000001128311062"></a>
This example shows how to compile a simple service and print **Hello World** to help you preliminarily understand how to run OpenHarmony on Hi3861.
## Modifying Source Code<a name="section79601457101015"></a>
The source code needs to be modified when fixing bugs or compiling a new service. The following describes how to modify the source code when compiling a new service, for example, **my\_first\_app**.
1. Determine the directory structure.
Before compiling a service, you must create a directory \(or a directory structure\) in **./applications/sample/wifi-iot/app** to store source code files.
For example, add the **my\_first\_app** service to the **app** directory, where **hello\_world.c** is the service code and **BUILD.gn** is the compilation script. The directory structure is shown as follows:
```
.
└── applications
└── sample
└── wifi-iot
└── app
│── my_first_app
│ │── hello_world.c
│ └── BUILD.gn
└── BUILD.gn
```
2. Compile the service code.
Create the **hello\_world.c** file in **./applications/sample/wifi-iot/app/my\_first\_app**. Then, create the service entry function **HelloWorld** in **hello\_world.c** and implement service logic. Use the SYS\_RUN\(\) of the OpenHarmony **bootstrap** module to start services. \(**SYS\_RUN** is defined in the **ohos\_init.h** file.\)
```
#include <stdio.h>
#include "ohos_init.h"
#include "ohos_types.h"
void HelloWorld(void)
{
printf("[DEMO] Hello world.\n");
}
SYS_RUN(HelloWorld);
```
3. Compile the **BUILD.gn** file for building services into a static library.
Create the **BUILD.gn** file in **./applications/sample/wifi-iot/app/my\_first\_app** and fill in three parts \(target, source file, and header file path\) of the **BUILD.gn** file.
```
static_library("myapp") {
sources = [
"hello_world.c"
]
include_dirs = [
"//utils/native/lite/include"
]
}
```
- Specify the compilation result named libmyapp.a in **static\_library**. You can fill in this part based on your need.
- Specify the .c file on which a file depends and its path in **sources**. The path that contains **//** represents an absolute path \(the code root path\), otherwise it is a relative path.
- Specify the path of .h file on which **sources** depends in **include\_dirs**.
4. Compile the **BUILD.gn** file and specify the feature modules to be built.
Configure the **./applications/sample/wifi-iot/app/BUILD.gn** file and add an index to the **features** field to enable the target to be involved in compilation. Specify the path and target of a service module in **features**. The following uses **my\_first\_app** as an example and the **features** is configured as follows:
```
import("//build/lite/config/component/lite_component.gni")
lite_component("app") {
features = [
"my_first_app:myapp",
]
}
```
- **my\_first\_app** is a relative path that points to **./applications/sample/wifi-iot/app/my\_first\_app/BUILD.gn**.
- **myapp** represents the **static\_library\("myapp"\)** in **./applications/sample/wifi-iot/app/my\_first\_app/BUILD.gn**.
## Debugging and Verification<a name="section1621064881419"></a>
Currently, there are two debugging and verification methods: using printf to print logs and using ASM files to locate **panic** problems. You can select one of them based on your need.
As the service shown is simple, use the printf method. The following describes the two debugging methods.
### printf<a name="section5204547123316"></a>
Add the **printf** function to the code, which helps print data to the serial port. You can add log printing in key service paths or service exception locations, as shown in the following figure.
```
void HelloWorld(void)
{
printf("[DEMO] Hello world.\n");
}
```
### Locating Exceptions Using the ASM File<a name="section15919111423416"></a>
When the system exits abnormally, the call stack information about the abnormal exit is displayed on the serial port. The following is an example: You can locate the exception by parsing the exception stack information.
```
=======KERNEL PANIC=======
**********************Call Stack*********************
Call Stack 0 -- 4860d8 addr:f784c
Call Stack 1 -- 47b2b2 addr:f788c
Call Stack 2 -- 3e562c addr:f789c
Call Stack 3 -- 4101de addr:f78ac
Call Stack 4 -- 3e5f32 addr:f78cc
Call Stack 5 -- 3f78c0 addr:f78ec
Call Stack 6 -- 3f5e24 addr:f78fc
********************Call Stack end*******************
```
To parse the call stack information, the **Hi3861\_wifiiot\_app.asm** file is required. This file records the symbol addresses of the functions in the code in the flash memory and the disassembly information. The ASM file is built and output together with the version software package and is stored in the **./out/wifiiot/** directory.
1. \(Optional\) Save the call stack information to a TXT file for later editing.
2. Open the ASM file, search for the function address in each call stack, and list the corresponding function. Generally, you only need to find the functions matching the first several stacks to locate exceptions.
```
Call Stack 0 -- 4860d8 addr:f784c -- WadRecvCB
Call Stack 1 -- 47b2b2 addr:f788c -- wal_sdp_process_rx_data
Call Stack 2 -- 3e562c addr:f789c
Call Stack 3 -- 4101de addr:f78ac
Call Stack 4 -- 3e5f32 addr:f78cc
Call Stack 5 -- 3f78c0 addr:f78ec
Call Stack 6 -- 3f5e24 addr:f78fc
```
3. Based on the above call stack information, it can be determined that an exception occurs in the **WadRecvCB** function.
![](figures/wadrecvcb-function.png)
4. Check and modify the code.
## Viewing Execution Result<a name="section18115713118"></a>
After the sample code is compiled, burnt, run, and debugged, the following information is displayed on the serial port interface:
```
ready to OS start
FileSystem mount ok.
wifi init success!
[DEMO] Hello world.
```
## Follow-up Learning<a name="section9712145420182"></a>
Congratulations! You have finished all steps! You are advised to go on learning how to develop [WLAN-connected products](../guide/device-wlan.md).
# Burning Images<a name="EN-US_TOPIC_0000001153557088"></a>
Burning of a regular system requires DevEco Device Tool v2.2 Beta1 or later.
Hi3516D V300 supports burning of the standard system through the USB port, network port, or serial port, where:
- **Windows system: Supports burning through the USB port, serial port, or network port**
- **Linux system: Supports burning through the network port or serial port**
Except for environment setup, the operations of burning are the same for Windows and Linux.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>Currently, the Hi3516D V300 development board supports programming flash memory of the standard system through the USB port, network port, or serial port. This document uses the network port as an example. For details about programming flash memory over other ports, see [Programming Flash Memory on Hi3516D V300](https://device.harmonyos.com/en/docs/ide/user-guides/hi3516_upload-0000001052148681).
## Prerequisites<a name="section18547185418328"></a>
In DevEco Device Tool, select **Import Project** to open the folder where the target file is located. Set **MCU** to **Hi3516DV300** under **HiSilicon\_Arm\_Linux** and **Framework** to **Ohos-sources** or **Hpm**.
![](figures/hisilicon-arm-linux.png)
## Programming Flash Memory Through the Network Port<a name="section1965361953312"></a>
The Hi3516DV300 supports burning through the network port in Windows or Linux.
1. Connect the PC and the target development board through the serial port, network port, and power port. For details, see [Introduction to the Hi3516 Development Board](https://device.harmonyos.com/en/docs/start/introduce/oem_minitinier_des_3516-0000001152041033).
2. <a name="en-us_topic_0000001056443961_li1050616379507"></a>Open Device Manager, then check and record the serial port number corresponding to the development board.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If the serial port number is not displayed correctly, follow the steps described in [Installing the Serial Port Driver on the Hi3516 or Hi3518 Series Development Boards](https://device.harmonyos.com/en/docs/ide/user-guides/hi3516_hi3518-drivers-0000001050743695).
![](figures/hi3516-record-the-serial-port-number.png)
3. Open DevEco Device Tool, choose **QUICK ACCESS** \> **DevEco Home** \> **Projects**, and then click **Settings**.
![](figures/hi3516-deveco-device-tool-setting.png)
4. On the **hi3516dv300** tab page, configure the burning options.
- **upload\_port**: Select the serial port number obtained in step [2](#en-us_topic_0000001056443961_li1050616379507).
- **upload\_protocol**: Select the burning protocol **hiburn-net**.
- **upload\_partitions**: Select the files to be burnt. By default, **fastboot**, **boot**, **updater**, **misc**, **system**, **vendor**, and **userdata** are burnt at the same time.
![](figures/upload-options-2.png)
5. <a name="en-us_topic_0000001056443961_li85106114532"></a>Check and set the IP address of the network adapter connected to the development board. For details, see [Setting the IP Address of the Network Port for Burning to Hi3516](https://device.harmonyos.com/en/docs/ide/user-guides/set_ipaddress-0000001141825075).
6. Set the IP address of the network port for burning:
- **upload\_net\_server\_ip**: Select the IP address set in step [5](#en-us_topic_0000001056443961_li85106114532), 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. Example: 255.255.255.0.
- **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. Example: 192.168.1.1.
- **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. Example: 192.168.1.3.
![](figures/ip-address-information-3.png)
7. When you finish modifying, click **Save** in the upper right corner.
8. Open the project file and go to ![](figures/2021-01-27_170334.png) \> **PROJECT TASKS** \> **hi3516dv300** \> **Upload** to start burning.
![](figures/en-us_image_0000001215342695.png)
9. When the following message is displayed, power off the development board and then power it on.
![](figures/hi3516-restart-the-development-board.png)
10. If the following message is displayed, it indicates that the burning is successful.
![](figures/hi3516-burning-succeeded-net.png)
11. When the burning is successful, perform the operations in [Running an Image](https://device.harmonyos.com/en/docs/start/introduce/quickstart-standard-running-0000001142160948) to start the system.
# Setting Up a Ubuntu Development Environment in Docker Mode<a name="EN-US_TOPIC_0000001119805112"></a>
The standard OpenHarmony system provides a Docker environment which encapsulates build tools.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>- Before using Docker, install it by following instructions in [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/).
>- You can also use the [installation package](quickstart-standard-package-environment.md) to set up the Ubuntu development environment.
## Obtaining Standard-System Source Code<a name="section8761819202511"></a>
### Prerequisites<a name="section102871547153314"></a>
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
3. Install the [git client](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure basic user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
```
4. Run the following commands to install the **repo** tool:
```
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
### Procedure<a name="section429012478331"></a>
Two methods are provided for you to obtain the OpenHarmony master code. You are advised to create a new folder and run the related commands in this folder to download the source code. This folder will then be the root directory of the source code.
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
```
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
## Running prebuilts<a name="section0495320152619"></a>
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
```
bash build/prebuilts_download.sh
```
By default, the downloaded prebuilts binary file is stored in **OpenHarmony\_2.0\_canary\_prebuilts** \(which is in the same directory as **OpenHarmony**\).
## Obtaining the Docker Environment<a name="section181431248132513"></a>
1. Obtain the Docker image.
```
docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:1.0.0
```
2. Go to the root directory of source code and run the following command to access the Docker build environment:
```
docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:1.0.0
```
## Building Source Code<a name="section92391739152318"></a>
1. Run the following script to start building for standard-system devices \(reference memory ≥ 128 MB\).
```
./build.sh --product-name {product_name} --ccache
```
**product\_name** indicates the platform supported by the current distribution, for example, Hi3516DV300 and rk3568.
Files generated during building are stored in the **out/{device_name}/** directory, and the generated image is stored in the **out/{device_name}/packages/phone/images/** directory.
2. Burn the image. For details, see [Burning Images](quickstart-standard-burn.md).
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>You can exit Docker by simply running the **exit** command.
......@@ -19,7 +19,7 @@ To install the necessary libraries and tools, perform the following steps.
In Ubuntu:
1. Run the following **apt-get** command:
```
sudo apt-get update && sudo apt-get install binutils binutils-dev git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib gcc-arm-linux-gnueabi libc6-dev-i386 libc6-dev-amd64 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3.8 python3-pip ruby genext2fs device-tree-compiler make libffi-dev e2fsprogs pkg-config perl openssl libssl-dev libelf-dev libdwarf-dev u-boot-tools mtd-utils cpio doxygen liblz4-tool openjdk-8-jre gcc g++ texinfo dosfstools mtools default-jre default-jdk libncurses5 apt-utils wget scons python3.8-distutils tar rsync git-core libxml2-dev lib32z-dev grsync xxd libglib2.0-dev libpixman-1-dev kmod jfsutils reiserfsprogs xfsprogs squashfs-tools pcmciautils quota ppp libtinfo-dev libtinfo5 libncurses5-dev libncursesw5 libstdc++6 gcc-arm-none-eabi vim ssh locales
```
......@@ -34,13 +34,13 @@ In Ubuntu:
2. Set Python 3.8 as the default Python version.
Check the location of Python 3.8:
```
which python3.8
```
Change python and python3 to python3.8.
```
sudo update-alternatives --install /usr/bin/python python {python3.8 path} 1 #{Python3.8 path} is the location of Python 3.8 obtained in the previous step.
sudo update-alternatives --install /usr/bin/python3 python3 {python3.8 path} 1 #{Python3.8 path} is the location of Python 3.8 obtained in the previous step.
......@@ -98,14 +98,14 @@ To remotely access the Ubuntu environment through Windows to perform operations
1. Make sure the Ubuntu shell environment is **bash**.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
```
ls -l /bin/sh
```
![en-us_image_0000001226764302](figures/en-us_image_0000001226764302.png)
2. Start the command-line tool, run the following command, enter your password, and select **No** to set **Ubuntu shell** to **bash**.
```
sudo dpkg-reconfigure dash
```
......@@ -116,12 +116,12 @@ To remotely access the Ubuntu environment through Windows to perform operations
3. Decompress the DevEco Device Tool software package and assign permission on the folder obtained from the decompression.
1. Go to the directory where the DevEco Device Tool software package is stored and run the following command to decompress the software package. In the command, change **devicetool-linux-tool-3.0.0.400.zip** to the actual software package name.
```
unzip devicetool-linux-tool-3.0.0.400.zip
```
2. Open the folder of the decompressed software package and run the following command to grant the execute permission on the installation file. In the command, change **devicetool-linux-tool-3.0.0.400.sh** to the actual installation file name.
```
chmod u+x devicetool-linux-tool-3.0.0.400.sh
```
......@@ -130,7 +130,7 @@ To remotely access the Ubuntu environment through Windows to perform operations
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> During the installation, the setup wizard automatically checks whether Python 3.8 or 3.9 is installed. If Python 3.8 or 3.9 is not installed, the setup wizard displays the "Do you want to continue?" message; enter **Y** to allow the setup wizard to automatically install Python.
```
sudo ./devicetool-linux-tool-3.0.0.400.sh
```
......@@ -149,19 +149,19 @@ To remotely access the Ubuntu environment through Windows to perform operations
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> If the command fails to be executed and the system displays a message indicating that the openssh-server and openssh-client depend on different versions, install the openssh-client of the required version (for example, **sudo apt-get install openssh-client=1:8.2p1-4**) as prompted on the command-line interface (CLI) and run the command again to install the openssh-server.
```
sudo apt-get install openssh-server
```
2. Run the following command to start the SSH service:
```
sudo systemctl start ssh
```
3. Run the following command to obtain the IP address of the current user for remote access to the Ubuntu environment from Windows:
```
ifconfig
```
......@@ -171,7 +171,7 @@ To remotely access the Ubuntu environment through Windows to perform operations
### Installing Remote SSH
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us-cn_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
1. Open Visual Studio Code in Windows, click ![en-us_image_0000001239080359](figures/en-us_image_0000001239080359.png), and search for **remote-ssh** in the Extension Marketplace.
![en-us_image_0000001193920448](figures/en-us_image_0000001193920448.png)
......@@ -210,7 +210,7 @@ To remotely access the Ubuntu environment through Windows to perform operations
After the preceding operations are complete, you can remotely connect to the Ubuntu environment through Windows for development. However, you need to frequently enter the remote connection password. To eliminate this need, you can use the SSH public key.
1. Open the Git bash CLI and run the following command to generate an SSH public key. During command execution, perform operations as prompted. Set **username** and **ip** to the user name and IP address you use for connecting to the Ubuntu system.
```
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub username@ip
......@@ -245,13 +245,13 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
```
Run the following command to install the tools:
```
sudo apt-get install git git-lfs
```
4. Configure user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
......@@ -259,7 +259,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
```
5. Run the following commands to install the **repo** tool:
```
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
chmod a+x /usr/local/bin/repo
......@@ -284,7 +284,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
......@@ -299,7 +299,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
### Running prebuilts
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
```
bash build/prebuilts_download.sh
```
......@@ -311,35 +311,35 @@ hb is a compilation tool of OpenHarmony. To install hb in Ubuntu, perform the fo
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> To install a proxy, see [Configuring a Proxy](../quick-start/quickstart-standard-reference.md#configuring-a-proxy).
> To install a proxy, see [Configuring the Proxy](../quick-start/quickstart-standard-reference.md#section6204129143012).
1. Run the following command to install hb and update it to the latest version:
```
pip3 install --user build/lite
```
2. Set the environment variable.
```
vim ~/.bashrc
```
Copy the following command to the last line of the .bashrc file, save the file, and exit.
```
export PATH=~/.local/bin:$PATH
```
Update the environment variable.
```
source ~/.bashrc
```
3. Run the **hb -h** command in the source code directory. If the following information is displayed, the installation is successful:
```
usage: hb
......@@ -359,7 +359,7 @@ hb is a compilation tool of OpenHarmony. To install hb in Ubuntu, perform the fo
> ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE**
> - Run the following command to uninstall hb:
>
>
> ```
> pip3 uninstall ohos-build
> ```
......
# Setting Up a Ubuntu Development Environment Using the Installation Package<a name="EN-US_TOPIC_0000001119804790"></a>
## Installing Dependent Tools<a name="section18431165519244"></a>
The installation command is as follows:
```
sudo apt-get update && sudo apt-get install binutils git git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 bc gnutls-bin python3.8 python3-pip ruby
```
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>The preceding command is applicable to Ubuntu 18.04. For other Ubuntu versions, modify the preceding installation command based on the installation package name. Python 3.7 or later is required. Python 3.8 is used as an example.
## Obtaining Standard-System Source Code<a name="section113751052102517"></a>
### Prerequisites<a name="section102871547153314"></a>
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
3. Install the [git client](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure basic user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
```
4. Run the following commands to install the **repo** tool:
```
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
### Procedure<a name="section429012478331"></a>
Two methods are provided for you to obtain the OpenHarmony master code. You are advised to create a new folder and run the related commands in this folder to download the source code. This folder will then be the root directory of the source code.
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
```
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
## Running prebuilts<a name="section0495320152619"></a>
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
```
bash build/prebuilts_download.sh
```
By default, the downloaded prebuilts binary file is stored in **OpenHarmony\_2.0\_canary\_prebuilts** \(which is in the same directory as **OpenHarmony**\).
## Building Source Code<a name="section1664835963517"></a>
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.
```
./build.sh --product-name {product_name}
```
**product\_name** indicates the product supported by the current distribution, for example, **Hi3516DV300**.
2. Check the build result. After the build is complete, the following information is displayed in the log:
```
build system image successful.
=====build Hi3516DV300 successful.
```
Files generated during the build are stored in the **out/{device_name}/** directory, and the generated image is stored in the **out/{device_name}/packages/phone/images/** directory.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details about module-specific build operations, see [Building Guidelines](../subsystems/subsys-build-standard-large.md).
3. Burn the image. For details, see [Burning Images](quickstart-standard-burn.md).
......@@ -5,7 +5,7 @@
1. Go to the root directory of the source code and run the build command.
```
./build.sh --product-name name --ccache
```
......@@ -14,7 +14,7 @@
> _name_ indicates the product name, for example, **Hi3516D V300** and **rk3568**.
2. Check the build result. After the build is complete, the following information is displayed in the log:
```
post_process
=====build name successful.
......@@ -31,13 +31,13 @@
### Setting Up the Python Proxy
1. Create a proxy configuration file.
```
mkdir ~/.pipvim ~/.pip/pip.conf
```
2. Add the following proxy information to the file, save the file, and exit:
```
[global]
index-url = http:// Proxy URL
......@@ -46,23 +46,23 @@
```
### Setting Up the npm Proxy
### Setting Up the npm Proxy<a name="section6204129143012"></a>
1. Create a proxy configuration file.
```
vim ~/.npmrc
```
2. Add the following proxy information to the file, save the file, and exit:
```
Registry=http:// Proxy URL
strict-ssl=false
```
3. Add the following content to the **.bashrc** file, save the file, and exit:
```
export NPM_REGISTRY=http:// Proxy URL
source .bashrc
......
# Obtaining Source Code<a name="EN-US_TOPIC_0000001188523654"></a>
### Prerequisites<a name="section1787412417496"></a>
1. Register your account with Gitee.
2. Register an SSH public key for access to Gitee.
3. Install the [git client](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading), and configure basic user information.
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
```
4. Run the following commands to install the **repo** tool:
```
curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable.
chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
### How to Obtain<a name="section1715918316415"></a>
>![](../public_sys-resources/icon-note.gif) **NOTE**<br/>
>Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities.
- **Obtaining OpenHarmony master code**
Method 1 \(recommended\): Use the **repo** tool to download the source code over SSH. \(You must have registered an SSH public key for access to Gitee.\)
```
repo init -u git@gitee.com:openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
Method 2: Use the **repo** tool to download the source code over HTTPS.
```
repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
- **Obtaining OpenHarmony release code**
For details about how to obtain the source code of an OpenHarmony release, see the [Release-Notes](../get-code/../../release-notes/Readme.md).
# Setting Up a Windows Development Environment<a name="EN-US_TOPIC_0000001216019037"></a>
System requirements:
- OS: 64-bit Windows 10
- User name: cannot contain Chinese characters
## Installing DevEco Device Tool<a name="en-us_topic_0000001058091994_section10761564496"></a>
DevEco Device Tool is installed in Visual Studio Code as a plug-in and depends on Python, Node.js, and HPM for running.
DevEco Device Tool supports integrated installation. The DevEco Device Tool setup wizard checks whether the adaptation versions of Visual Studio Code, Python, Node.js and HPM tools have been installed. If any of the tools is not installed, you'll be prompted to select the tool to be automatically installed.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>Before installing DevEco Device Tool, make sure the user name of the host does not contain Chinese characters. Otherwise, the **DevEco Home** page will be stuck loading and the DevEco Device Tool cannot work.
1. Log in to the [HarmonyOS Device website](https://device.harmonyos.com/cn/ide#download_beta) with your HUAWEI ID and download DevEco Device Tool V3.0 Beta1 or a later version. If you do not have a HUAWEI ID, [register](https://developer.huawei.com/consumer/en/doc/start/registration-and-verification-0000001053628148) one first.
2. Decompress the DevEco Device Tool package, double-click the installer, and then click **Next**.
3. Set the installation path of DevEco Device Tool and click **Next**.
4. When prompted, select the tools to be automatically installed and click **Next**.
![](figures/snap28.png)
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>When the setup wizard detects that a compatible Python version has been installed, it prompts you to select the installed Python version or download the recommended Python version.
5. In the dialog box shown below, click **Next** to download and install the tools.
![](figures/snap8.png)
6. In the displayed Python setup wizard, select **Add Python 3.8 to PATH** and click **Install Now**. After the installation is complete, click **Close**.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you have selected the compatible Python version installed on your device, the Python setup wizard will not be displayed. In this case, you skip this step.
>If DevEco Device Tool 2.1 Release is installed, the Python version must be 3.8.x. If DevEco Device Tool V3.0 Beta1 or a later version is installed, the Python version must be 3.8.x or 3.9.x.
![](figures/snap34.png)
7. In the Visual Studio Code setup wizard, install Visual Studio Code as prompted. During the installation, select **Add to PATH \(requires shell restart\)**.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you are using the correct version of Visual Studio Code, the Visual Studio Code setup wizard will not be displayed. In this case, you skip this step.
![](figures/snap33.png)
8. In the Node.js setup wizard, retain the default settings 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**.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you are using the correct version of Node.js, the Node.js setup wizard will not be displayed. In this case, you skip this step.
9. Wait for the DevEco Device Tool setup wizard to automatically install the HPM and DevEco Device Tool. After the installation is complete, click **Finish** to close the setup wizard.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you are using the correct version of HPM, the setup wizard does not download or install HPM.
10. Start Visual Studio Code. The C/C++ and CodeLLDB plug-ins on which DevEco Device Tool depends will be automatically installed. After the installation is complete, click ![](figures/button.png) on the left of Visual Studio Code to check whether C/C++, CodeLLDB, and DevEco Device Tool are included in the **INSTALLED** list.
>![](../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/deveco-device-tool-install-sucessful.png)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册