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

fixed bugs

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 a7222996
......@@ -3,7 +3,7 @@
- [Device Development Overview](device-dev-guide.md)
- Learn About OpenHarmony
- [OpenHarmony Community](../OpenHarmony-Overview.md)
- [Glossary](glossary.md)
- [Glossary](../glossary.md)
- [Release Notes](../release-notes/Readme.md)
- Quick Start
- [Mini and Small Systems](quick-start/quickstart-lite.md)
......
......@@ -73,11 +73,11 @@ kernel_version = "3.0.0" --- Kernel version, which corresponds to
Run the `hb set` command, enter the project root directory, and press `Enter`. The `hb` command traverses all `config.json` files in the `//vendor/<product_company>/<product_name>` directory and provides product compilation options. In the `config.json` file, `product_name` indicates the product name, `device_company` and `board` are used to locate the `//device/board/<device_company>/<board>` directory and find the matching `<any_dir_name>/config.gni` file. If multiple file matches are found, it indicates that the board has been adapted to multiple kernels. In this case, `kernel_type` and `kernel_version` in the `config.json` file can be used to uniquely match the `config.gni` file and thereby determine the board with which kernel needs to be compiled and adapted. If the information shown below is displayed, the `hb set` configuration is correct.
![hb set](figure/bes2600_hb_set.png)
![hb set](figures/bes2600_hb_set.png)
​ You can run the `hb env` command to view the selected precompilation environment variables.
![hb env](figure/bes2600_hb_env.png)
![hb env](figures/bes2600_hb_env.png)
Before running the `hb build` command, complete the LiteOS-M kernel adaptation. For details, see [Kernel Porting](https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/porting/porting-bes2600w-on-minisystem-display-demo.md#%E5%86%85%E6%A0%B8%E7%A7%BB%E6%A4%8D).
......@@ -263,7 +263,7 @@ In this example, the configuration file of `defconfig` is saved in `$(PRODUCT_PA
When the configuration is complete, run the `make menuconfig` command in the `kernel/liteos_m` directory to select `SoC Series`/`SoC`/`Board`.
![board make menuconfig](figure/bes2600_board_make_menuconfig.png)
![board make menuconfig](figures/bes2600_board_make_menuconfig.png)
The result is automatically saved in `$(PRODUCT_PATH)/kernel_configs/debug.config` and will be exported when `make menuconfig` is executed.
......@@ -432,7 +432,7 @@ static int32_t FsDriverInit(struct HdfDeviceObject *object)
In the mini system, adapting the C library is a complex process. For details, see *Solution to Smooth Switchover Between musl and newlib for LiteOS-M Kernel*. The toolchain uses the `newlib` C library of the [gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2](https://gitee.com/link?target=https%3A%2F%2Fdeveloper.arm.com%2F-%2Fmedia%2FFiles%2Fdownloads%2Fgnu-rm%2F10.3-2021.10%2Fgcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2). In light of this, the `newlib` C library is used for system porting. Select `newlib` in `make menuconfig` of the kernel, as shown below.
![image-20211212191013553](figure/bes2600_newlib_make_menuconfig.png)
![image-20211212191013553](figures/bes2600_newlib_make_menuconfig.png)
#### malloc Adaptation
......
......@@ -10,7 +10,7 @@ After the minimum system is ported, you can port the board-level system by:
4. Verifying service functions
**Figure 1** Process for board-level driver adaptation<a name="fig14619153362215"></a>
![process-for-board-level-driver-adaptation](figures/process-for-board-level-driver-adaptation)
![process-for-board-level-driver-adaptation](figures/process-for-board-level-driver-adaptation.png)
## Board-Level Directory Specifications<a name="section6204129143013"></a>
......
......@@ -12,7 +12,7 @@ Basic adaptation consists of the following steps:
**Figure 1** Startup process<a name="fig10838105524917"></a>
![](figure/startup-process.png)
![](figures/startup-process.png)
In the **startup.S** file, you must ensure that the entry function \(for example, **reset\_vector**\) of the interrupt vector table is stored in the RAM start address specified by the link configuration files. The link configuration files of IAR, Keil, and GCC projects are **xxx.icf**, **xxx.sct**, and **xxx.ld**, respectively. The startup file provided by the vendor does not need to be modified if the **startup.S** file has initialized the system clock and returned to the **main** function. Otherwise, the preceding functions need to be implemented.
......@@ -34,6 +34,7 @@ The following table shows some typical configuration items:
**Table 1** Typical configuration items
<a name="table1343954214199"></a>
<table><thead align="left"><tr id="row1244014425196"><th class="cellrowborder" valign="top" width="34.81%" id="mcps1.2.3.1.1"><p id="p1544044212197"><a name="p1544044212197"></a><a name="p1544044212197"></a>Item</p>
</th>
<th class="cellrowborder" valign="top" width="65.19%" id="mcps1.2.3.1.2"><p id="p7440194281913"><a name="p7440194281913"></a><a name="p7440194281913"></a>Description</p>
......
......@@ -16,8 +16,7 @@ The kernel used by module chips is LiteOS Cortex-M, which consists of four modul
**Figure 1** Architecture of the LiteOS Cortex-M kernel<a name="fig10838105524917"></a>
![](figure/architecture-of-the-liteos-cortex-m-kernel.png)
<img src="figures/architecture-of-the-liteos-cortex-m-kernel.png" style="zoom:75%;" />
The directory structure of the kernel is described as follows:
......
......@@ -12,7 +12,7 @@ For easy description, we divide the OpenHarmony architecture into two parts:
OpenHarmony = Kernel mode layer + User mode layer
![](figure/technical-architecture.png)
![](figures/technical-architecture.png)
The kernel mode layer is the OpenHarmony kernel layer \(purple part in the figure\). It consists of the kernel, such as Linux Kernel and LiteOS, and features, such as Hardware Driver Foundation \(HDF\), running in the kernel mode.
......@@ -35,7 +35,7 @@ Therefore, the OpenHarmony kernel mode layer includes the following:
- OpenHarmony basic kernel-mode code
- OpenHarmony kernel-mode features, such as HDF
![](figure/openharmony_kernel.png)
![](figures/openharmony_kernel.png)
The standard LTS Linux kernel and third-party SoC chip platform code constitute the basis of a third-party Linux kernel. The OpenHarmony kernel mode layer can be composed of either of the following:
......@@ -175,7 +175,7 @@ For details about how to use the logs, see [Hilog\_lite](https://gitee.com/open
The configuration \(in **Device Drivers** \> **HDF driver framework support**\) is as follows:
![](figure/menuconfig.png)
![](figures/menuconfig.png)
### Building the Image<a name="section1681965561911"></a>
......
......@@ -157,7 +157,7 @@ The WLAN driver is divided into two parts. One of the parts manages WLAN devices
**Figure 1** OpenHarmony WLAN driver architecture<a name="fig155920160203"></a>
![](figure/hdf_wifi.png)
![](figures/hdf_wifi.png)
As shown in [Figure 1](#fig155920160203), the part on the left manages WLAN devices, and the part on the right manages WLAN traffic. The HDF WLAN framework abstracts these two parts. The porting process of the driver can be considered as the implementation of the APIs required by the two parts. These APIs are described as follows:
......
......@@ -3,7 +3,7 @@
Drivers can be classified as platform drivers or device drivers. The platform drivers are generally in the SoC, such as the GPIO, I2C, and SPI drivers. The device drivers are typically outside of the SoC, such as the LCD, TP, and WLAN drivers.
**Figure 1** OpenHarmony driver classification<a name="fig08631434121"></a>
![](figure/openharmony-driver-classification.png "openharmony-driver-classification")
![](figures/openharmony-driver-classification.png "openharmony-driver-classification")
The Hardware Driver Foundation \(HDF\) is designed to work across OSs. The HDF driver framework provides strong support for drivers to achieve this goal. During HDF driver development, you are advised to use only the APIs provided by the HDF driver framework. Otherwise, the driver cannot be used across OSs. Before driver development, familiarize yourself with the [HDF](../driver/driver-hdf-overview.md).
......@@ -27,7 +27,7 @@ The LiteOS Cortex-A initialization process consists of seven steps:
The figure below shows the overall initialization process.
**Figure 1** Overall initialization process<a name="fig68283211926"></a>
![](figure/overall-initialization-process.png "overall-initialization-process")
![](figures/overall-initialization-process.png "overall-initialization-process")
As can be seen from preceding figure, kernel basic adaptation involves the following parts:
......@@ -108,7 +108,7 @@ As can be seen from preceding figure, kernel basic adaptation involves the follo
- Implementing the **SystemInit** function to initialize services in the user space. Figure 2 shows a typical initialization scenario.
**Figure 2** Service startup process<a name="fig1919217914418"></a>
![](figure/service-startup-process.png "service-startup-process")
![](figures/service-startup-process.png "service-startup-process")
- Implementing the **main** function for basic kernel initialization and initialization of services in the board kernel space. [Figure 3](#fig32611728133919) shows the initialization process, where the kernel startup framework takes the lead in the initialization process. The light blue part in the figure indicates the phase in which external modules can be registered and started in the startup framework.
......@@ -116,7 +116,7 @@ As can be seen from preceding figure, kernel basic adaptation involves the follo
>Modules at the same layer cannot depend on each other.
**Figure 3** Kernel startup framework<a name="fig32611728133919"></a>
![](figure/kernel-startup-framework.jpg "kernel-startup-framework")
![](figures/kernel-startup-framework.jpg "kernel-startup-framework")
**Table 2** Startup framework layers
......
......@@ -54,7 +54,7 @@ You can use the Bootloader provided by the chipset vendor or open-source U-Boot
Debug the **init** process, start shell, and run a simple program in the user space to check whether the kernel porting is successful. Below is the OS image structure of the OpenHarmony [small system](../quick-start/quickstart-lite-overview.md) and the Linux user-space program startup process.
**Figure 1** OS image structure and user-space program startup process based on the Linux kernel<a name="fig91631652715"></a>
![](figure/os-image-structure-and-user-space-program-startup-process-based-on-the-linux-kernel.png "os-image-structure-and-user-space-program-startup-process-based-on-the-linux-kernel")
![](figures/os-image-structure-and-user-space-program-startup-process-based-on-the-linux-kernel.png "os-image-structure-and-user-space-program-startup-process-based-on-the-linux-kernel")
Based on the preceding process, the recommended verification procedure is as follows:
......@@ -91,12 +91,12 @@ Based on the preceding process, the recommended verification procedure is as fol
If the init startup log contains the version number, the init program is started properly:
**Figure 2** Log indicating that the init process is started properly<a name="fig1111661083719"></a>
![](figure/log-indicating-that-the-init-process-is-started-properly.png "log-indicating-that-the-init-process-is-started-properly")
![](figures/log-indicating-that-the-init-process-is-started-properly.png "log-indicating-that-the-init-process-is-started-properly")
After entering the shell, run the **ls** command. The following figure shows the information printed over the serial port.
**Figure 3** Information printed after the ls command is executed in the shell<a name="fig64571257103717"></a>
![](figure/information-printed-after-the-ls-command-is-executed-in-the-shell.png "information-printed-after-the-ls-command-is-executed-in-the-shell")
![](figures/information-printed-after-the-ls-command-is-executed-in-the-shell.png "information-printed-after-the-ls-command-is-executed-in-the-shell")
3. Configure the NFS.
......
......@@ -223,7 +223,7 @@ The following steps show how to configure and modify the toolchains for cross-co
The following screen is displayed after a successful login to the OS.
**Figure 1** Successful startup of OpenHarmony<a name="fig13279524162418"></a>
![](figure/successful-startup-of-openharmony.png "successful-startup-of-openharmony")
![](figures/successful-startup-of-openharmony.png "successful-startup-of-openharmony")
2. Mount the **nfs** directory and put the executable file **cctest** into the **test** directory \(listed in [Table 2](#table1452412391911)\) to the **nfs** directory.
3. Perform the test cases.
......
......@@ -277,7 +277,7 @@ For details about driver development, see [TOUCHSCREEN](../driver/driver-periph
The WLAN driver is divided into two parts. One of the parts manages WLAN devices, and the other part manages WLAN traffic. HDF WLAN provides abstraction for the two parts. Currently, only the WLAN with the SDIO interface is supported.
**Figure 1** WLAN chip<a name="fig16997123013494"></a>
![](figure/wlan-chip.png "wlan-chip")
![](figures/wlan-chip.png "wlan-chip")
To support a chip, implement a **ChipDriver** for it. The major task is to implement the following interfaces provided by **HDF\_WLAN\_CORE** and **NetDevice**.
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册