| type | InputType | InputType.Normal | 设置输入框类型。 |
| placeholderColor | Color | - | Placeholder color. |
| placeholderColor | Color | - | 设置placeholder颜色。 |
| placeholderFont | {<br/>size?: Length,<br/>weight?: number\|[FontWeight](ts-universal-attributes-text-style.md),<br/>family?: string,<br/>style?: [FontStyle](ts-universal-attributes-text-style.md)<br/>} | - | Placeholder text style.<br/>- **size**: font size. If the value is of the number type, the unit fp is used.<br/>- **weight**: font weight. For the number type, the value ranges from 100 to 900, at an interval of 100. The default value is **400**. A larger value indicates a larger font weight.<br/>- **family**: font family. Use commas (,) to separate multiple fonts, for example, **'Arial, sans-serif'**. The priority of the fonts is the sequence in which they are placed.<br/>- **style**: font style. |
| caretColor | Color | - | Color of the caret (also known as the text insertion cursor). |
| caretColor | Color | - | 设置输入框光标颜色。 |
| maxLength<sup>8+</sup> | number | - | Maximum number of characters in the text input. |
| maxLength | number | - | 设置文本的最大输入字符数。 |
| inputFilter<sup>8+</sup> | {<br/>value: [ResourceStr](../../ui/ts-types.md)<sup>8+</sup>,<br/>error?: (value: string)<br/>} | - | Regular expression for input filtering. Only inputs that comply with the regular expression can be displayed. Other inputs are ignored. The specified regular expression can match single characters, but not strings. Example: ^(? =.\*\d)(? =.\*[a-z])(? =.\*[A-Z]).{8,10}$. Strong passwords containing 8 to 10 characters cannot be filtered.<br/>- **value**: indicates the regular expression to set.<br/>- **error**: returns the ignored content when regular expression matching fails. |
Implements the controller of the **<TextInput>** component.
TextInput组件的控制器。
| Name | Description |
| -------- | -------- |
| caretPosition(value: number):void | Position of the input cursor.<br/>**value**: indicates the length from the start of the string to the position where the input cursor is located. |
### Objects to Import
#### 导入对象
```
```
controller: TextInputController = new TextInputController()
controller: TextInputController = new TextInputController()
| value | number | Yes | - | Position of the input cursor.<br/>**value**: indicates the length from the start of the string to the position where the input cursor is located. |
## 示例
## Events
| Name | Description |
| -------- | -------- |
| onChange(value: string) => void | Triggered when the input changes. |
| onSubmit(callback: (enterKey: EnterKeyType) => void) | Triggered when the Enter key on the physical or soft keyboard is pressed. |
| onEditChanged(callback: (isEditing: boolean) => void)<sup>(deprecated) </sup> | Triggered when the input status changes. |
| onEditChange(callback: (isEditing: boolean) => void) <sup>8+</sup> | Triggered when the input status changes. |
| onCopy<sup>8+</sup>(callback:(value: string) => void) | Triggered when the copy button on the pasteboard, which displays when the text box is long pressed, is clicked.<br/>**value**: text to be copied. |
| onCut<sup>8+</sup>(callback:(value: string) => void) | Triggered when the cut button on the pasteboard, which displays when the text box is long pressed, is clicked.<br/>**value**: text to be cut. |
| onPaste<sup>8+</sup>(callback:(value: string) => void) | Triggered when the paste button on the pasteboard, which displays when the text box is long pressed, is clicked.<br/>**value**: text to be pasted. |
The @Builder decorated method is used to define the declarative UI description of a component and quickly generate multiple layouts in a custom component. The functionality and syntax of the @Builder decorator are the same as those of the [build Function](ts-function-build.md).
The **@Builder** decorated method is used to define the declarative UI description of a component and quickly generate multiple layouts in a custom component. The functionality and syntax of the **@Builder** decorator are the same as those of the [build Function](ts-function-build.md).
```
```
...
@@ -42,30 +41,29 @@ struct CompA {
...
@@ -42,30 +41,29 @@ struct CompA {
}
}
}
}
```
```
## @BuilderParam<sup>8+<sup>
## @BuilderParam<sup>8+</sup>
The **@BuilderParam** decorator is used to modify the function type attributes (for example, `@BuilderParam content: () => any;`) in a custom component. When the custom component is initialized, the attributes modified by the **@BuilderParam** decorator must be assigned values.
The @BuilderParam decorator is used to modify the function type attributes (for example, @BuilderParam content: () => any) in a custom component. When the custom component is initialized, the attributes modified by the @BuilderParam decorator must be assigned values.
### Background
### Background
In certain circumstances, you may need to add a specific function, such as a click-to-jump action, to a custom component. However, embedding an event method directly inside of the component can add the function to all places where the component is initialized. This is where the @BuilderParam decorator come into the picture. When initializing a custom component, you can assign a @Builder decorated method to the @BuilderParam decorated attribute, thereby adding the specific function to the custom component.
In certain circumstances, you may need to add a specific function, such as a click-to-jump action, to a custom component. However, embedding an event method directly inside of the component will add the function to all places where the component is initialized. This is where the **@BuilderParam** decorator comes into the picture. When initializing a custom component, you can assign a **@Builder** decorated method to the **@BuilderParam** decorated attribute, thereby adding the specific function to the custom component.
### Component Initialization Through Parameters
### Component Initialization Through Parameters
When initializing a custom component through parameters, assign a **@Builder** decorated method to the **@BuilderParam** decorated attribute — **content**, and call the value of **content** in the custom component. If no parameter is passed when assigning a value to the **@BuilderParam** decorated attribute (for example, `content: this.specificParam`), define the type of the attribute as a function without a return value (for example, `@BuilderParam content: () => void`). If any parameter is passed when assigning a value to the **@BuilderParam** decorated attribute (for example, `callContent: this.specificParam1("111")`), define the type of the attribute as `any` (for example,`@BuilderParam callContent: any;`).
When initializing a custom component through parameters, assign a @Builder decorated method to the @BuilderParam decorated attribute —content, and call the value of content in the custom component.
```
```
@Component
@Component
struct CustomContainer {
struct CustomContainer {
header: string = "";
header: string = "";
@BuilderParam content: () => any;
@BuilderParam noParam: () => void;
@BuilderParam withParam: any;
footer: string = "";
footer: string = "";
build() {
build() {
Column() {
Column() {
Text(this.header)
Text(this.header)
.fontSize(50)
.fontSize(50)
this.content()
this.noParam()
this.withParam()
Text(this.footer)
Text(this.footer)
.fontSize(50)
.fontSize(50)
}
}
...
@@ -75,7 +73,12 @@ struct CustomContainer {
...
@@ -75,7 +73,12 @@ struct CustomContainer {
@Entry
@Entry
@Component
@Component
struct CustomContainerUser {
struct CustomContainerUser {
@Builder specificParam(label: string) {
@Builder specificNoParam() {
Column() {
Text("noParam").fontSize(50)
}
}
@Builder SpecificWithParam(label: string) {
Column() {
Column() {
Text(label).fontSize(50)
Text(label).fontSize(50)
}
}
...
@@ -85,25 +88,23 @@ struct CustomContainerUser {
...
@@ -85,25 +88,23 @@ struct CustomContainerUser {
Column() {
Column() {
CustomContainer({
CustomContainer({
header: "Header",
header: "Header",
content: this.specificParam("111")
noParam: this.specificNoParam,
withParam: this.SpecificWithParam("WithParam"),
footer: "Footer",
footer: "Footer",
})
})
}
}
}
}
}
}
```
```
### Component Initialization Through Trailing Closure
### Component Initialization Through Trailing Closure
In a custom component, use the **@BuilderParam** decorated attribute to receive a trailing closure. When the custom component is initialized, the component name is followed by a pair of braces ({}) to form a trailing closure (`CustomComponent(){}`). You can consider a trailing closure as a container and add content to it. For example, you can add a component (`{Column(){Text("content")}`) to a trailing closure. The syntax of the closure is the same as that of [build](../ui/ts-function-build.md). In this scenario, the custom component has one and only one **@BuilderParam** decorated attribute.
In a custom component, use the @BuilderParam decorated attribute to receive a trailing closure. When the custom component is initialized, the component name is followed by a pair of braces ({}) to form a trailing closure (CustomComponent(){}). You can consider a trailing closure as a container and add content to it. For example, you can add a component ({Column(){Text("content")}) to the closure. The syntax of the closure is the same as that of [build](ts-function-build.md). In this scenario, the custom component has one and only one @BuilderParam decorated attribute.
Example: Add a **\<Column>** component and a click event to the closure, and call the **specificParam** method decorated by **@Builder** in the new **\<Column>** component. After the **\<Column>** component is clicked, the value of the component's `header` attribute will change to `changeHeader`. In addition, when the component is initialized, the content of the trailing closure will be assigned to the `closer` attribute decorated by **@BuilderParam**.
Example: Add a <Column> component and a click event to the closure, and call the specificParam method decorated by @Builder in the new <Column> component. After the <Column> component is clicked, the value of the component's header attribute will be changed to changeHeader. In addition, when the component is initialized, the content of the trailing closure will be assigned to the closer attribute decorated by @BuilderParam.
@@ -5,7 +5,7 @@ This use case takes **camera\_sample** \(contained in the source code\) as an
...
@@ -5,7 +5,7 @@ This use case takes **camera\_sample** \(contained in the source code\) as an
- You can obtain source code of the sample from **applications/sample/camera/media/camera\_sample.cpp**.
- You can obtain source code of the sample from **applications/sample/camera/media/camera\_sample.cpp**.
- Before running the sample camera, you need to compile, burn, and run the image. For details, see [Hi3516 Development Board](../quick-start/quickstart-lite-introduction-hi3516#section26131214194212).
- Before running the sample camera, you need to compile, burn, and run the image. For details, see [Hi3516 Development Board](../quick-start/quickstart-lite-introduction-hi3516#section26131214194212).
>After the development board is started, the home screen is loaded and displayed above the media layer by default. To prevent covering **camera\_sample**, you should remove the home screen during compilation or packaging.
>After the development board is started, the home screen is loaded and displayed above the media layer by default. To prevent covering **camera\_sample**, you should remove the home screen during compilation or packaging.
>How to Remove: In **build/lite/components/applications.json**, comment out or delete the **//applications/sample/camera/launcher:launcher\_hap** line from the **target** field of **camera\_sample\_app**.
>How to Remove: In **build/lite/components/applications.json**, comment out or delete the **//applications/sample/camera/launcher:launcher\_hap** line from the **target** field of **camera\_sample\_app**.
...
@@ -18,7 +18,7 @@ This use case takes **camera\_sample** \(contained in the source code\) as an
...
@@ -18,7 +18,7 @@ This use case takes **camera\_sample** \(contained in the source code\) as an
Recompile the source code repository and burn the code into the development board. Then you can find the **camera\_sample** file in the **bin** directory of the board.
Recompile the source code repository and burn the code into the development board. Then you can find the **camera\_sample** file in the **bin** directory of the board.
>You should insert a TF card \(up to 128 GB supported\) for photographing and video recording before system startup. This way, the TF card will be automatically mounted to the **/sdcard** directory. If you insert the TF card after the system is started, you have to manually mount the TF card.
>You should insert a TF card \(up to 128 GB supported\) for photographing and video recording before system startup. This way, the TF card will be automatically mounted to the **/sdcard** directory. If you insert the TF card after the system is started, you have to manually mount the TF card.
>To view the photos and videos in the TF card, copy them to a computer. If you just want to preview photos and videos, you do not need to insert a TF card.
>To view the photos and videos in the TF card, copy them to a computer. If you just want to preview photos and videos, you do not need to insert a TF card.
# Screen and Camera Control Overview<a name="EN-US_TOPIC_0000001055101239"></a>
This document describes how to use the IoT camera development board \(Hi3516D V300\) and its camera and screen to implement photographing, video recording, and video preview.
This document describes how to use the IoT camera development board \(Hi3516D V300\) and its camera and screen to implement photographing, video recording, and video preview.
@@ -247,7 +247,7 @@ To build such an app, we can create a page that has a flexible layout with two r
...
@@ -247,7 +247,7 @@ To build such an app, we can create a page that has a flexible layout with two r
## Signing and Packaging<a name="section10601181101516"></a>
## Signing and Packaging<a name="section10601181101516"></a>
After finishing writing the app code, you need to sign and package the app before running it on a real device. For details, see [Signing and Packaging Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/ohos-debugging-and-running-0000001263040487#section17660437768)).
After finishing writing the app code, you need to sign and package the app before running it on a real device. For details, see [Signing and Packaging Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/ohos-debugging-and-running-0000001263040487#section17660437768).
## Running on the Real Device<a name="section092721731511"></a>
## Running on the Real Device<a name="section092721731511"></a>
# Use Case<a name="EN-US_TOPIC_0000001055686082"></a>
# Use Case<a name="EN-US_TOPIC_0000001055686082"></a>
-A Hi318 compilation result file of sample code is stored in **out/ipcamera\_hi3518ev300/dev\_tools/bin/camera\_sample**. You can copy the file to a TF card, or modify the compilation script of **camera\_sample** to copy the result to **rootfs.img**.
-For details about the development board, compilation, burning, and image running, see [Hi3518 Development Board](../quick-start/quickstart-lite-introduction-hi3518.md#section14815247616). A compilation result file of sample code is stored in **out/ipcamera\_hi3518ev300/dev\_tools/bin/camera\_sample**. You can copy the file to a TF card, or modify the compilation script of **camera\_sample** to copy the result to **rootfs.img**.
Modify **output\_dir** in **applications/sample/camera/media/BUILD.gn**.
Modify **output\_dir** in **applications/sample/camera/media/BUILD.gn**.
# Camera Control Overview<a name="EN-US_TOPIC_0000001055366100"></a>
This document describes how to use the IoT camera development board and the built-in camera of the development kit to implement photographing and video recording.
This document describes how to use the IoT camera development board and the built-in camera of the development kit to implement photographing and video recording.
...
@@ -6,5 +6,5 @@ You can perform operations provided in [Use Case](device-iotcamera-control-exam
...
@@ -6,5 +6,5 @@ You can perform operations provided in [Use Case](device-iotcamera-control-exam
If you want to view the sample effect first, see [Use Case](device-iotcamera-control-example.md). To customize application behavior, modify the sample code by referring to APIs described in the next section.
If you want to view the sample effect first, see [Use Case](device-iotcamera-control-example.md). To customize application behavior, modify the sample code by referring to APIs described in the next section.
For details about basic concepts for camera development, see the [camera development overview](../subsystems/subsys-multimedia-camera-overview.md).
For details about basic concepts for camera development, see [Camera Overview](../subsystems/subsys-multimedia-camera-overview.md).
For details about the compilation and burning processes, see [Building Source Code](../quick-start/quickstart-ide-lite-steps-hi3861-building.md) and [Burning Images](../quick-start/quickstart-ide-lite-steps-hi3861-burn.md) in the _Getting Started with Hi3861_.
For details about the compilation and burning processes, see [Building Source Code](../quick-start/quickstart-lite-steps-hi3861-connection.md#section191121332125319) and [Burning Images](../quick-start/quickstart-lite-steps-hi3861-connection.md#section3288165814218) in the _Getting Started with Hi3861_.
After the preceding two steps are complete, press the **RST** button to reset the module. If the LED blinks periodically as expected, the verification is passed.
After the preceding two steps are complete, press the **RST** button to reset the module. If the LED blinks periodically as expected, the verification is passed.
@@ -73,11 +73,11 @@ kernel_version = "3.0.0" --- Kernel version, which corresponds to
...
@@ -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.
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.


You can run the `hb env` command to view the selected precompilation environment variables.
You can run the `hb env` command to view the selected precompilation environment variables.


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).
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
...
@@ -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`.
When the configuration is complete, run the `make menuconfig` command in the `kernel/liteos_m` directory to select `SoC Series`/`SoC`/`Board`.


The result is automatically saved in `$(PRODUCT_PATH)/kernel_configs/debug.config` and will be exported when `make menuconfig` is executed.
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 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.
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:
...
@@ -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:
...
@@ -12,7 +12,7 @@ For easy description, we divide the OpenHarmony architecture into two parts:
OpenHarmony = Kernel mode layer + User mode layer
OpenHarmony = Kernel mode layer + User mode layer


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.
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:
...
@@ -35,7 +35,7 @@ Therefore, the OpenHarmony kernel mode layer includes the following:
- OpenHarmony basic kernel-mode code
- OpenHarmony basic kernel-mode code
- OpenHarmony kernel-mode features, such as HDF
- OpenHarmony kernel-mode features, such as HDF


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:
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:
...
@@ -84,7 +84,7 @@ The following uses Raspberry Pi 3b \(BCM2837\) as an example to describe how to
...
@@ -84,7 +84,7 @@ The following uses Raspberry Pi 3b \(BCM2837\) as an example to describe how to
# Configure the build environment, and use clang provided by the project to build the Raspberry Pi kernel source code.
# Configure the build environment, and use clang provided by the project to build the Raspberry Pi kernel source code.
3. Comment out the flags that cannot be recognized by **clang**.
3. Comment out the flags that cannot be recognized by **clang**.
...
@@ -175,7 +175,7 @@ For details about how to use the logs, see [Hilog\_lite](https://gitee.com/open
...
@@ -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:
The configuration \(in **Device Drivers** \> **HDF driver framework support**\) is as follows:


### Building the Image<a name="section1681965561911"></a>
### Building the Image<a name="section1681965561911"></a>
...
@@ -198,7 +198,7 @@ The HDF test cases are used to verify basic functions of the HDF framework and p
...
@@ -198,7 +198,7 @@ The HDF test cases are used to verify basic functions of the HDF framework and p
**Test Case Build and Test Method**
**Test Case Build and Test Method**
Use the [hdc\_std](https://gitee.com/openharmony/docs/blob/master/en/device-dev/subsystems/oem_subsys_toolchain_hdc_guide.md) tool to push the test case execution file to the device and execute the test cases. The procedure is as follows:
Use the [hdc\_std](https://gitee.com/openharmony/docs/blob/master/en/device-dev/subsystems/subsys-toolchain-hdc-guide.md) tool to push the test case execution file to the device and execute the test cases. The procedure is as follows:
1. Build the HDF test cases.
1. Build the HDF test cases.
2. Use the **hdc\_std** tool to push the test case execution file to the device.
2. Use the **hdc\_std** tool to push the test case execution file to the device.
...
@@ -211,14 +211,14 @@ The procedure is as follows:
...
@@ -211,14 +211,14 @@ The procedure is as follows:
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:
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.
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).
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.
- 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
...
@@ -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.
>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
...
@@ -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.
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>
**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
...
@@ -218,12 +218,12 @@ The following steps show how to configure and modify the toolchains for cross-co
1. Set up the OpenHarmony environment.
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-hi3516-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.
The following screen is displayed after a successful login to the OS.
**Figure 1** Successful startup of OpenHarmony<a name="fig13279524162418"></a>
**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.
2. Mount the **nfs** directory and put the executable file **cctest** into the **test** directory \(listed in [Table 2](#table1452412391911)\) to the **nfs** directory.
@@ -6,51 +6,60 @@ This document describes the general process for porting a development board, rat
...
@@ -6,51 +6,60 @@ This document describes the general process for porting a development board, rat
This document uses the process of porting a development board named **MyProduct** as an example. This development board is provided by **MyProductVendor** and uses the SoC **MySOC** produced by **MySoCVendor**.
This document uses the process of porting a development board named **MyProduct** as an example. This development board is provided by **MyProductVendor** and uses the SoC **MySOC** produced by **MySoCVendor**.
### Defining an SoC<a name="section135mcpsimp"></a>
### Defining a Product<a name="section145mcpsimp"></a>
Create a JSON file named after the SoC name in the **//productdefine/common/device** directory and specify the CPU architecture.
Create a config.json file in the directory with the name "//vendor/MyProductVendor/{product_name}. This file is used to describe the SoC used by the product and the required subsystems. configure the file as follows:
For example, to port **MySOC**, which uses a 32-bit ARM kernel, configure the file as follows:
Currently, **target\_cpu** can be set to **arm** only. In the future, you can set the value depending on the CPU architecture, such as **arm64**, **riscv**, or **x86**.
The main configurations are as follows:
### Defining a Product<a name="section145mcpsimp"></a>
product_name:The product name.Required
Create a JSON file named after the product name in the **//productdefine/common/products** directory. This file is used to describe the SoC used by the product and the required subsystems. Configure the file as follows:
version:version.Required
//productdefine/common/products/MyProduct.json
type:Configured at the system level, select from (mini, small, standard).Required
```
target_cpu :The CPU type of the device (depending on the actual situation, the target_cpu here may also be arm64, riscv, x86, etc..).Required
{
"product_name": "MyProduct",
"product_company" : "MyProductVendor",
"product_device": "MySOC",
"version": "2.0",
"type": "standard",
"parts":{
"ace:ace_engine_standard":{},
"ace:napi":{},
...
"xts:phone_tests":{}
}
}
```
ohos_version:Operating system version.Optional
The main configurations are as follows:
device_company:device manufacturer name.Required
board:Board name.Required
enable_ramdisk:Whether to start ramdisk.Required
kernel_type and kernel_version: kernel_type with kernel_version is fixed in the standard and does not need to be written.Optional
subsystems:The subsystem that the system needs to be enabled. Subsystems can simply understand a piece of function that is built independently. Required
1.**product\_device**: SoC used by the product.
product_company:Not reflected in the configuration, but in the directory name, the next directory of the vendor is product_company, build.gn script can still be accessed.
2.**type**: system level. In this example, set it to **standard**.
3.**parts**: subsystem to enable. A subsystem can be treated as an independently built functional block.
You can find available subsystems in **//build/subsystem\_config.json**. You can also customize subsystems.
You can find available subsystems in **//build/subsystem\_config.json**. You can also customize subsystems.
...
@@ -83,7 +92,7 @@ Add the following subsystem configuration to the **//build/subsystem\_config.js
...
@@ -83,7 +92,7 @@ Add the following subsystem configuration to the **//build/subsystem\_config.js
},
},
```
```
Then, open the configuration file **//productdefine/common/products/MyProduct.json**, which is used to define the product, and add the new subsystem to the product.
Then, open the configuration file **//vendor/MyProductVendor/MyProduct/config.json**, which is used to define the product, and add the new subsystem to the product.
### 2. Building the Kernel<a name="section182mcpsimp"></a>
### 2. Building the Kernel<a name="section182mcpsimp"></a>
...
@@ -277,7 +286,7 @@ For details about driver development, see [TOUCHSCREEN](../driver/driver-periph
...
@@ -277,7 +286,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.
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**.
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**.
# Setting Up the Windows+Ubuntu Hybrid Development Environment
# Setting Up the Windows+Ubuntu Hybrid Development Environment
In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, as the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu build environment.
In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, as the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu development environment.
In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional).
In the Windows+Ubuntu hybrid development environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional).
## System Requirements
## System Requirements
...
@@ -18,9 +18,7 @@ In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of bo
...
@@ -18,9 +18,7 @@ In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of bo
- DevEco Device Tool: 3.0 Release
- DevEco Device Tool: 3.0 Release
## Setting Up the Ubuntu Build Environment
## Setting Up the Ubuntu Development Environment
The setup procedure varies, depending on whether you need a GUI. If you need a GUI, you need to install Visual Studio Code. In this case, follow the instructions in [Setting Up the Ubuntu Development Environment](https://device.harmonyos.com/en/docs/documentation/guide/ide-install-ubuntu-0000001072959308). If you do not need a GUI, perform the steps below:
1. Make sure the Ubuntu shell environment is **bash**.
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.
1. Run the following command and check whether the command output is **bash**. If the command output is not **bash**, go to step 2.
...
@@ -116,7 +114,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
...
@@ -116,7 +114,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
Hi3516D 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 a high-performance NNIE engine, leading the industry in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption.
Hi3516D 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 a high-performance NNIE engine, leading the industry in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption.
Hi3861 is a 2 x 5 cm development board. It is a 2.4 GHz WLAN SoC chip that highly integrates the IEEE 802.11b/g/n baseband and radio frequency (RF) circuit. It supports OpenHarmony and provides an open and easy-to-use development and debugging environment.
Hi3861 is a 2 x 5 cm development board. It is a 2.4 GHz WLAN SoC chip that highly integrates the IEEE 802.11b/g/n baseband and radio frequency (RF) circuit. It supports OpenHarmony and provides an open and easy-to-use development and debugging environment.
The Hi3861 development board can also be connected to the Hi3861 mother board to expand its peripheral capabilities. The following figure shows the Hi3861 mother board.
The Hi3861 development board can also be connected to the Hi3861 mother board to expand its peripheral capabilities. The following figure shows the Hi3861 mother board.
@@ -6,15 +6,15 @@ Hi3516D V300 supports burning through the USB port, network port, and serial por
...
@@ -6,15 +6,15 @@ Hi3516D V300 supports burning through the USB port, network port, and serial por
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md).
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed, click the connect icon.
- If  is displayed, click the connect icon.
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step.
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
@@ -6,7 +6,7 @@ Hi3861 V100 supports burning through the serial port. To burn source code throug
...
@@ -6,7 +6,7 @@ Hi3861 V100 supports burning through the serial port. To burn source code throug
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3861 V100 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3861.md).
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3861 V100 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3861.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed, click the connect icon.
- If  is displayed, click the connect icon.
...
@@ -14,7 +14,7 @@ Hi3861 V100 supports burning through the serial port. To burn source code throug
...
@@ -14,7 +14,7 @@ Hi3861 V100 supports burning through the serial port. To burn source code throug
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step.
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
Hi3516D V300 is a next-generation system on chip (SoC) designed for industry-dedicated smart HD IP cameras. It introduces a next-generation image signal processor (ISP), the H.265 video compression encoder, and a high-performance NNIE engine, leading the industry in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption.
Hi3516D V300 is a next-generation system on chip (SoC) designed for industry-dedicated smart HD IP cameras. It introduces a next-generation image signal processor (ISP), the H.265 video compression encoder, and a high-performance NNIE engine, leading the industry in terms of low bit rate, high image quality, intelligent processing and analysis, and low power consumption.
Bolstered by the Rockchip RK3568 chip, the RK3568 development board integrates a dual-core GPU and high-efficiency NPU. Its quad-core 64-bit Cortex-A55 processor uses the advanced 22 nm manufacturing process and is clocked at up to 2.0 GHz. The development board is packed with Bluetooth, Wi-Fi, audio, video, and camera features, with a wide range of expansion ports as well as video input and output ports. It comes with dual GE auto-sensing RJ45 ports, so it can be used in multi-connectivity products, such as NVRs and industrial gateways.
Bolstered by the Rockchip RK3568 chip, the RK3568 development board integrates a dual-core GPU and high-efficiency NPU. Its quad-core 64-bit Cortex-A55 processor uses the advanced 22 nm manufacturing process and is clocked at up to 2.0 GHz. The development board is packed with Bluetooth, Wi-Fi, audio, video, and camera features, with a wide range of expansion ports as well as video input and output ports. It comes with dual GE auto-sensing RJ45 ports, so it can be used in multi-connectivity products, such as NVRs and industrial gateways.
**Figure 1** Front view of the RK3568 development board
**Figure 1** Front view of the RK3568 development board
@@ -25,7 +25,7 @@ After [setting up the Windows+Ubuntu hybrid development environment](../quick-st
...
@@ -25,7 +25,7 @@ After [setting up the Windows+Ubuntu hybrid development environment](../quick-st
5. On the **Import Project** page, select a product, and the MCU, board, company, and kernel fields will be automatically populated. Then, select the OpenHarmony source code version for **ohosVersion**. The following figure uses **Hi3516DV300** as an example.
5. On the **Import Project** page, select a product, and the MCU, board, company, and kernel fields will be automatically populated. Then, select the OpenHarmony source code version for **ohosVersion**. The following figure uses **Hi3516DV300** as an example.
# Setting Up the Windows+Ubuntu Hybrid Development Environment
# Setting Up the Windows+Ubuntu Hybrid Development Environment
In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, as the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu build environment.
In embedded development, Windows-based tools, such as Visual Studio Code, are widely used in code editing. Yet, as the source code of most development boards, such as Hi3861 and Hi3516, cannot be built in Windows, these development boards require the Ubuntu development environment.
In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional).
In the Windows+Ubuntu hybrid development environment, you can enjoy the benefits of both DevEco Device Tool for Windows and DevEco Device Tool for Ubuntu (where Visual Studio Code is optional).
## System Requirements
## System Requirements
...
@@ -18,9 +18,7 @@ In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of bo
...
@@ -18,9 +18,7 @@ In the Windows+Ubuntu hybrid build environment, you can enjoy the benefits of bo
- DevEco Device Tool: 3.0 Release
- DevEco Device Tool: 3.0 Release
## Setting Up the Ubuntu Build Environment
## Setting Up the Ubuntu Development Environment
The setup procedure varies, depending on whether you need a GUI. If you need a GUI, you need to install Visual Studio Code. In this case, follow the instructions in [Setting Up the Ubuntu Development Environment](https://device.harmonyos.com/en/docs/documentation/guide/ide-install-ubuntu-0000001072959308). If you do not need a GUI, perform the steps below:
1. Make sure the Ubuntu shell environment is **bash**.
1. Make sure the Ubuntu shell environment is **bash**.
...
@@ -116,7 +114,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
...
@@ -116,7 +114,7 @@ To remotely access the Ubuntu environment through Windows and enjoy the benefits
@@ -12,7 +12,7 @@ To accommodate different developer habits, OpenHarmony provides two modes for ge
...
@@ -12,7 +12,7 @@ To accommodate different developer habits, OpenHarmony provides two modes for ge
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool.
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool.
OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
This document exemplifies how to use the IDE mode. For details about the installation package mode, see [Getting Started with Standard System (Installation Package Mode)](../quick-start/quickstart-standard-overview.md).
This document exemplifies how to use the IDE mode. For details about the installation package mode, see [Getting Started with Standard System (Installation Package Mode)](../quick-start/quickstart-standard-package-directory.md).
## Development Environment
## Development Environment
...
@@ -28,7 +28,7 @@ This document describes how to develop OpenHarmony in the Windows+Ubuntu environ
...
@@ -28,7 +28,7 @@ This document describes how to develop OpenHarmony in the Windows+Ubuntu environ
## Development Boards
## Development Boards
In this document, two development board models are used as examples: Hi3516D V300 and RK3568. For details about these development boards, see [Appendix](../quick-start/quickstart-ide-standard-board-introduction-hi3516.md). You can purchase the development board as required.
In this document, two development board models are used as examples: Hi3516D V300 and RK3568. For details about these development boards, see [Appendix](../quick-start/quickstart-standard-board-introduction.md). You can purchase the development board as required.
@@ -6,7 +6,7 @@ To burn source code to Hi3516D V300 through the USB port in Windows, perform the
...
@@ -6,7 +6,7 @@ To burn source code to Hi3516D V300 through the USB port in Windows, perform the
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md).
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed, click the connect icon.
- If  is displayed, click the connect icon.
...
@@ -14,7 +14,7 @@ To burn source code to Hi3516D V300 through the USB port in Windows, perform the
...
@@ -14,7 +14,7 @@ To burn source code to Hi3516D V300 through the USB port in Windows, perform the
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step.
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
2. Connect the computer to the target development board through the USB port.
2. Connect the computer to the target development board through the USB port.
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed, click the connect icon.
- If  is displayed, click the connect icon.
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step.
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
4. In DevEco Device Tool, choose QUICK ACCESS > DevEco Home > Projects, and then click Settings.
4. In DevEco Device Tool, choose QUICK ACCESS > DevEco Home > Projects, and then click Settings.
After the image is burnt and the development board is restarted, the system automatically starts. If the following page is displayed on the screen of the development board, the system is running properly.
After the image is burnt and the development board is restarted, the system automatically starts. If the following page is displayed on the screen of the development board, the system is running properly.
> 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.
> 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**
-**Obtaining OpenHarmony master code**
...
@@ -72,7 +72,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
...
@@ -72,7 +72,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony
## Running prebuilts
## Running prebuilts
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
Go to the root directory of the source code and run the following script to install the compiler and binary tool:
2. Burn the U-Boot file by following the procedures for burning a U-Boot file over USB.
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 [Burning to Hi3516D V300](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3516-upload-0000001052148681).
Select the U-Boot files of corresponding development boards for burning by referring to [Burning to Hi3516D V300](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3516-upload-0000001052148681)/[Burning to Hi3518E V300](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3518-upload-0000001057313128#section93591711580).
3. Log in to the serial port after the burning is complete.
3. Log in to the serial port after the burning is complete.
> _name_ indicates the product name, for example, **Hi3516D V300** and **rk3568**.
> _name_ indicates the product name, for example, **hispark_taurus_standard** and **rk3568**.
2. Check the build result. After the build is complete, the following information is displayed in the log:
2. Check the build result. After the build is complete, the following information is displayed in the log:
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
```
```
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.
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.
@@ -40,7 +40,7 @@ After the source code is imported, perform the following steps:
...
@@ -40,7 +40,7 @@ After the source code is imported, perform the following steps:
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md).
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed, click the connect icon.
- If  is displayed, click the connect icon.
...
@@ -48,7 +48,7 @@ After the source code is imported, perform the following steps:
...
@@ -48,7 +48,7 @@ After the source code is imported, perform the following steps:
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step.
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
@@ -40,7 +40,7 @@ After the source code is imported, perform the following steps:
...
@@ -40,7 +40,7 @@ After the source code is imported, perform the following steps:
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3861 V100 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3861.md).
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3861 V100 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3861.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed, click the connect icon.
- If  is displayed, click the connect icon.
...
@@ -48,7 +48,7 @@ After the source code is imported, perform the following steps:
...
@@ -48,7 +48,7 @@ After the source code is imported, perform the following steps:
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step.
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
## What should I do if garbled characters and segmentation faults occur during hb installation?
## What should I do if garbled characters and segmentation faults occur during hb installation?
-**Symptom**
-**Symptom**
Garbled characters and segmentation faults occur during the execution of the **python3 -m pip install --user ohos-build** command.
Garbled characters and segmentation faults occur during the execution of the **python3 -m pip install --user ohos-build** command.
-**Possible Causes**
-**Possible Causes**
pip is of an early version.
pip is of an early version.
-**Solution**
-**Solution**
Upgrade pip.
Upgrade pip.
```
```
...
@@ -21,13 +24,16 @@
...
@@ -21,13 +24,16 @@
## What should I do if the message "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation?
## What should I do if the message "cannot import 'sysconfig' from 'distutils'" is displayed during hb installation?
-**Symptom**
-**Symptom**
The message "cannot import 'sysconfig' from 'distutils'" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
The message "cannot import 'sysconfig' from 'distutils'" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
-**Possible Causes**
-**Possible Causes**
The **distutils** module is unavailable.
The **distutils** module is unavailable.
-**Solution**
-**Solution**
Install distutils.
Install distutils.
```
```
...
@@ -38,13 +44,16 @@
...
@@ -38,13 +44,16 @@
## What should I do if the message "module 'platform' has no attribute 'linux_distribution'" is displayed during hb installation?
## What should I do if the message "module 'platform' has no attribute 'linux_distribution'" is displayed during hb installation?
-**Symptom**
-**Symptom**
The message "module 'platform' has no attribute 'linux_distribution'" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
The message "module 'platform' has no attribute 'linux_distribution'" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
-**Possible Causes**
-**Possible Causes**
There is a compatibility issue of python3-pip.
There is a compatibility issue of python3-pip.
-**Solution**
-**Solution**
Reinstall pip.
Reinstall pip.
```
```
...
@@ -57,12 +66,15 @@
...
@@ -57,12 +66,15 @@
## What should I do if the message "Could not find a version that satisfies the requirement ohos-build" is displayed during hb installation?
## What should I do if the message "Could not find a version that satisfies the requirement ohos-build" is displayed during hb installation?
-**Symptom**
-**Symptom**
The message "Could not find a version that satisfies the requirement ohos-build" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
The message "Could not find a version that satisfies the requirement ohos-build" is displayed during the execution of the **python3 -m pip install --user ohos-build** command.
-**Possible Causes**
-**Possible Causes**
The installation fails due to poor network connectivity.
The installation fails due to poor network connectivity.
-**Solution**
-**Solution**
1. Ensure that your computer has a good network connection. If the network connection is unstable, rectify the network fault and reinstall hb.
1. Ensure that your computer has a good network connection. If the network connection is unstable, rectify the network fault and reinstall hb.
2. If the network is functional, run the following commands to install hb by specifying a temporary PyPI source:
2. If the network is functional, run the following commands to install hb by specifying a temporary PyPI source:
@@ -40,7 +40,7 @@ After the source code is imported, perform the following steps:
...
@@ -40,7 +40,7 @@ After the source code is imported, perform the following steps:
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md).
1. Connect the computer and the target development board through the serial port and USB port. For details, see [Introduction to the Hi3516D V300 Development Board](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-introduction-hi3516.md).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
2. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. In this case, no further action is required.
- If  is displayed, click the connect icon.
- If  is displayed, click the connect icon.
...
@@ -48,7 +48,7 @@ After the source code is imported, perform the following steps:
...
@@ -48,7 +48,7 @@ After the source code is imported, perform the following steps:
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step.
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
3. Check the serial port number in **QUICK ACCESS** > **DevEco Home** > **Device** in DevEco Device Tool.
@@ -44,7 +44,7 @@ After the source code is imported, perform the following steps:
...
@@ -44,7 +44,7 @@ After the source code is imported, perform the following steps:
2. Connect the computer to the target development board through the USB port.
2. Connect the computer to the target development board through the USB port.
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu build environment) and the local computer (Windows build environment).
3. In DevEco Device Tool, choose **REMOTE DEVELOPMENT** > **Local PC** to check the connection status between the remote computer (Ubuntu development environment) and the local computer (Windows development environment).
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. Inthis case, no further action is required.
- If  is displayed on the right of **Local PC**, the remote computer is connected to the local computer. Inthis case, no further action is required.
- If  is displayed, click the connect icon.
- If  is displayed, click the connect icon.
...
@@ -52,7 +52,7 @@ After the source code is imported, perform the following steps:
...
@@ -52,7 +52,7 @@ After the source code is imported, perform the following steps:
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid build environment). If the local access mode (Windows or Ubuntu build environment) is used, skip this step.
> This operation is required only in remote access mode (in the Windows+Ubuntu hybrid development environment). If the local access mode (Windows or Ubuntu development environment) is used, skip this step.
4. In DevEco Device Tool, choose QUICK ACCESS > DevEco Home > Projects, and then click Settings.
4. In DevEco Device Tool, choose QUICK ACCESS > DevEco Home > Projects, and then click Settings.