FAQs are used to help developers solve problems frequently encountered during development. They cover a wide range of topics.
...
...
@@ -9,25 +9,25 @@ FAQs are used to help developers solve problems frequently encountered during de
### Mini and Small Systems
-[What should I do if garbled characters and segmentation faults occur during hb installation?](../faqs/faqs-environment-building.md)
-[What should I do if garbled characters and segmentation faults occur during hb installation?](../faqs/faqs-environment-setup.md)
-[What should I do if the message "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation?](../faqs/faqs-environment-building.md)
-[What should I do if the message "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation?](../faqs/faqs-environment-setup.md)
-[What should I do if the message "module 'platform' has no attribute 'linux_distribution'" is displayed during hb installation?](../faqs/faqs-environment-building.md)
-[What should I do if the message "module 'platform' has no attribute 'linux_distribution'" is displayed during hb installation?](../faqs/faqs-environment-setup.md)
-[What should I do if the message "Could not find a version that satisfies the requirement ohos-build" is displayed during hb installation?](../faqs/faqs-environment-building.md)
-[What should I do if the message "Could not find a version that satisfies the requirement ohos-build" is displayed during hb installation?](../faqs/faqs-environment-setup.md)
-[What should I do if the message "configure: error: no acceptable C compiler found in $PATH" is displayed during Python 3 installation?](../faqs/faqs-environment-building.md)
-[What should I do if the message "configure: error: no acceptable C compiler found in $PATH" is displayed during Python 3 installation?](../faqs/faqs-environment-setup.md)
-[What should I do if the message "-bash: make: command not found" is displayed during Python 3 installation?](../faqs/faqs-environment-building.md)
-[What should I do if the message "-bash: make: command not found" is displayed during Python 3 installation?](../faqs/faqs-environment-setup.md)
-[What should I do if the message "zlib not available" is displayed during Python 3 installation?](../faqs/faqs-environment-building.md)
-[What should I do if the message "zlib not available" is displayed during Python 3 installation?](../faqs/faqs-environment-setup.md)
-[What should I do if the message "No module named 'Crypto'" is displayed during the build process?](../faqs/faqs-environment-building.md)
-[What should I do if the message "No module named 'Crypto'" is displayed during the build process?](../faqs/faqs-environment-setup.md)
-[What should I do when an error with lsb_release occurs during kconfiglib installation?](../faqs/faqs-environment-building.md)
-[What should I do when an error with lsb_release occurs during kconfiglib installation?](../faqs/faqs-environment-setup.md)
-[What should I do if the message "ImportError: No module named apt_pkg" is displayed during the execution of an unidentifiable command?](../faqs/faqs-environment-building.md)
-[What should I do if the message "ImportError: No module named apt_pkg" is displayed during the execution of an unidentifiable command?](../faqs/faqs-environment-setup.md)
## Compilation and Building
...
...
@@ -116,16 +116,16 @@ FAQs are used to help developers solve problems frequently encountered during de
## Porting
-[How Do I Mount the Heap Memory to the Kernel?](../faqs/faqs-transplant.md)
-[How Do I Mount the Heap Memory to the Kernel?](../faqs/faqs-porting.md)
## Startup and Recovery
-[System Startup Interrupted Due to "parse failed!" Error](../faqs/faqs-init.md)
-[System Startup Interrupted Due to "parse failed!" Error](../faqs/faqs-startup.md)
-[Failed to Call the SetParameter or GetParameter API with Correct Parameter Values](../faqs/faqs-init.md)
-[Failed to Call the SetParameter or GetParameter API with Correct Parameter Values](../faqs/faqs-startup.md)
## System Applications
...
...
@@ -133,46 +133,46 @@ FAQs are used to help developers solve problems frequently encountered during de
### Utils
-[Failure in running the KV store on the LiteOS-A kernel (Hi3516 or Hi3518) due to incorrect path setting for the KV store](../faqs/faqs-system-using.md)
-[Failure in running the KV store on the LiteOS-A kernel (Hi3516 or Hi3518) due to incorrect path setting for the KV store](../faqs/faqs-system-applications.md)
### Visual Applications
-[Is there a global variable that can be accessed by all pages?](../faqs/faqs-system-using.md)
-[Is there a global variable that can be accessed by all pages?](../faqs/faqs-system-applications.md)
-[How do I obtain DOM elements?](../faqs/faqs-system-using.md)
-[How do I obtain DOM elements?](../faqs/faqs-system-applications.md)
-[How do I pass values between pages?](../faqs/faqs-system-using.md)
-[How do I pass values between pages?](../faqs/faqs-system-applications.md)
-[How do I scroll a list to an item?](../faqs/faqs-system-using.md)
-[How do I scroll a list to an item?](../faqs/faqs-system-applications.md)
-[Does the <text> component support multiple lines?](../faqs/faqs-system-using.md)
-[Does the <text> component support multiple lines?](../faqs/faqs-system-applications.md)
-[Why is a component not displayed?](../faqs/faqs-system-using.md)
-[Why is a component not displayed?](../faqs/faqs-system-applications.md)
-[How do I implement scrolling on a page?](../faqs/faqs-system-using.md)
-[How do I implement scrolling on a page?](../faqs/faqs-system-applications.md)
-[Why do not the left and top attributes take effect?](../faqs/faqs-system-using.md)
-[Why do not the left and top attributes take effect?](../faqs/faqs-system-applications.md)
-[Why does not dynamic binding take effect?](../faqs/faqs-system-using.md)
-[Why does not dynamic binding take effect?](../faqs/faqs-system-applications.md)
-[How do I implement relative and absolute positioning?](../faqs/faqs-system-using.md)
-[How do I implement relative and absolute positioning?](../faqs/faqs-system-applications.md)
-[How do I display or hide a component?](../faqs/faqs-system-using.md)
-[How do I display or hide a component?](../faqs/faqs-system-applications.md)
-[What are the precautions for using the Margin attribute?](../faqs/faqs-system-using.md)
-[What are the precautions for using the Margin attribute?](../faqs/faqs-system-applications.md)
-[What are the precautions for event subscription?](../faqs/faqs-system-using.md)
-[What are the precautions for event subscription?](../faqs/faqs-system-applications.md)
-[What are the precautions for using dynamic binding?](../faqs/faqs-system-using.md)
-[What are the precautions for using dynamic binding?](../faqs/faqs-system-applications.md)
-[How does the loop attribute take effect for <swiper>?](../faqs/faqs-system-using.md)
-[How does the loop attribute take effect for <swiper>?](../faqs/faqs-system-applications.md)
-[What are the precautions for using an array?](../faqs/faqs-system-using.md)
-[What are the precautions for using an array?](../faqs/faqs-system-applications.md)
### hdc
-[Why does hdc_std fail to connect to a device?](../faqs/faqs-system-using.md)
-[Why does hdc_std fail to connect to a device?](../faqs/faqs-system-applications.md)
-[hdc_std fail to run](../faqs/faqs-system-using.md)
-[hdc_std fail to run](../faqs/faqs-system-applications.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.
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.
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:
@@ -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>
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:
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.
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).
- 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.
@@ -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<aname="fig91631652715"></a>
@@ -218,12 +218,12 @@ The following steps show how to configure and modify the toolchains for cross-co
1. Set up the OpenHarmony environment.
Using Hi3518EV300 as an example, compile the OpenHarmony image and burn it to the development board. For details, see [Developing the First Example Program Running on Hi3518](../quick-start/quickstart-lite-steps-hi3518-running.md).
Using Hi3516D V300 as an example, compile the OpenHarmony image and burn it to the development board. For details, see [Developing the First Example Program Running on Hi3518](../quick-start/quickstart-lite-steps-hi3516-running.md).
The following screen is displayed after a successful login to the OS.
**Figure 1** Successful startup of OpenHarmony<a name="fig13279524162418"></a>
2. Mount the **nfs** directory and put the executable file **cctest** into the **test** directory \(listed in [Table 2](#table1452412391911)\) to the **nfs** directory.
@@ -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.
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**.
@@ -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.
@@ -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.