HOME
Shop
  • English
  • 简体中文
HOME
Shop
  • English
  • 简体中文
  • Product Series

    • FPGA+ARM

      • GM-3568JHF

        • 1. Introduction

          • About GM-3568JHF
        • 2. Quick Start

          • 00 Introduction
          • 01 Environment Setup
          • 02 Compilation Instructions
          • 03 Flashing Guide
          • 04 Debug Tools
          • 05 Software Update
          • 06 View Information
          • 07 Test Commands
          • 08 App Compilation
          • 09 Source Code Acquisition
        • 3. Peripherals and Interfaces

          • 01 USB
          • 02 Display and Touch
          • 03 Ethernet
          • 04 WIFI
          • 05 Bluetooth
          • 06 TF-Card
          • 07 Audio
          • 08 Serial Port
          • 09 CAN
          • 10 RTC
        • 4. Application Development

          • 01 UART read and write case
          • 02 Key detection case
          • 03 LED light flashing case
          • 04 MIPI screen detection case
          • 05 Read USB device information example
          • 06 FAN Detection Case
          • 07 FPGA FSPI Communication Case
          • 08 FPGA DMA read and write case
          • 09 GPS debugging case
          • 10 Ethernet Test Cases
          • 11 RS485 reading and writing examples
          • 12 FPGA IIC read and write examples
          • 13 PN532 NFC card reader case
          • 14 TF card reading and writing case
        • 5. QT Development

          • 01 ARM64 cross compiler environment construction
          • 02 QT program added automatic startup service
        • 6. RKNN_NPU Development

          • 01 RK3568 NPU Overview
          • 02 Development Environment Setup
          • Run Official YOLOv5 Example
          • Model Conversion Detailed Explanation
          • Run Custom Model on Board
        • 7. FPGA Development

          • ARM and FPGA Communication
          • /fpga-arm/GM-3568JHF/FPGA/ch02-FPGA-Development-Manual.html
        • 8. Others

          • 01 Modification of the root directory file system
          • 02 System auto-start service
        • 9. Download

          • Download Resources
    • ShimetaPi

      • M4-R1

        • 1. Introduction

          • 1.1 About M4-R1
        • 2. Quick Start

          • 2.1 OpenHarmony Overview
          • 2.2 Image Burning
          • 2.3 Development Environment Preparation
          • 2.4 Hello World Application
        • 3. Application Development

          • 3.1 Getting Started

            • 3.1.1 ArkTS Language Overview
            • 3.1.2 UI Components (Part 1)
            • 3.1.3 UI Components (Part 2)
            • 3.1.4 UI Components (Part 3)
          • 3.2 Advanced

            • 3.2.1 Getting Started Guide
            • 3.2.2 Usage of Third Party Libraries
            • 3.2.3 Deployment of the Application
            • 3.2.4 Factory Reset
            • 3.2.5 System Debug
            • 3.2.6 APP Stability Testing
            • 3.2.7 Application Testing
          • 3.3 Getting Docs

            • 3.3.1 Official Website Information
          • 3.4 Development Instructions

            • 3.4.1 Full SDK
            • 3.4.2 Introduction of Third Party Libraries
            • 3.4.3 Introduction of HDC Tool
            • 3.4.4 Restore Factory Mode
            • 3.4.5 Update System API
          • 3.5 First Application

            • 3.5.1 First ArkTS App
          • 3.6 Application Demo

            • 3.6.1 UART Tool
            • 3.6.2 Graphics Tablet
            • 3.6.3 Digital Clock
            • 3.6.4 WIFI Tool
        • 4. Device Development

          • 4.1 Ubuntu Environment Development

            • 4.1.1 Environment Setup
            • 4.1.2 Download Source Code
            • 4.1.3 Compile Source Code
          • 4.2 Using DevEco Device Tool

            • 4.2.1 Tool Introduction
            • 4.2.2 Environment Construction
            • 4.2.3 Import SDK
            • 4.2.4 Function Introduction
        • 5. Peripherals and Interfaces

          • 5.1 Raspberry Pi Interfaces
          • 5.2 GPIO Interface
          • 5.3 I2C Interface
          • 5.4 SPI Communication
          • 5.5 PWM Control
          • 5.6 Serial Port Communication
          • 5.7 TF Card Slot
          • 5.8 Display Screen
          • 5.9 Touch Screen
          • 5.10 Audio
          • 5.11 RTC
          • 5.12 Ethernet
          • 5.13 M.2
          • 5.14 MINI PCIE
          • 5.15 Camera
          • 5.16 WIFI BT
          • 5.17 HAT
        • 6. FAQ

          • 6.1 Download Link
      • M5-R1

        • 1. Introduction

          • M5-R1 Development Documentation
        • 2. Quick Start

          • OpenHarmony Overview
          • Image Burning
          • Development Environment Preparation
          • Hello World Application and Deployment
        • 3. Peripherals and Interfaces

          • 3.1 Raspberry Pi Interfaces
          • 3.2 GPIO Interface
          • 3.3 I2C Interface
          • 3.4 SPI Communication
          • 3.5 PWM Control
          • 3.6 Serial Port Communication
          • 3.7 TF Card Slot
          • 3.8 Display Screen
          • 3.9 Touch Screen
          • 3.10 Audio
          • 3.11 RTC
          • 3.12 Ethernet
          • 3.13 M.2
          • 3.14 MINI PCIE
          • 3.15 Camera
          • 3.16 WIFI BT
          • 3.17 HAT
        • 4. Application Development

          • 4.1 Getting Started

            • 4.1.1 ArkTS Language Overview
            • 4.1.2 UI Components (Part 1)
            • 4.1.3 UI Components (Part 2)
            • 4.1.4 UI Components (Part 3)
          • 4.2 Advanced

            • 4.2.1 Getting Started Guide
            • 4.2.2 Usage of Third Party Libraries
            • 4.2.3 Deployment of the Application
            • 4.2.4 Factory Reset
            • 4.2.5 System Debug
            • 4.2.6 APP Stability Testing
            • 4.2.7 Application Testing
        • 5. Device Development

          • 5.1 Environment Setup
          • 5.2 Download Source Code
          • 5.3 Compile Source Code
        • 6. Download

          • Data Download
    • OpenHarmony

      • SC-3568HA

        • 1. Introduction

          • 1.1 About SC-3568HA
        • 2. Quick Start

          • 2.1 OpenHarmony Overview
          • 2.2 Image Burning
          • 2.3 Development Environment Preparation
          • 2.4 Hello World Application
        • 3. Application Development

          • 3.1 ArkUI

            • 3.1.1 ArkTS Language Overview
            • 3.1.2 UI Components (Part 1)
            • 3.1.3 UI Components (Part 2)
            • 3.1.4 UI Components (Part 3)
          • 3.2 Advanced

            • 3.2.1 Getting Started Guide
            • 3.2.2 Usage of Third Party Libraries
            • 3.2.3 Deployment of the Application
            • 3.2.4 Factory Reset
            • 3.2.5 System Debug
            • 3.2.6 APP Stability Testing
            • 3.2.7 Application Testing
        • 4. Device Development

          • 4.1 Environment Setup
          • 4.2 Download Source Code
          • 4.3 Compile Source Code
        • 5. Peripherals and Interfaces

          • 5.1 Raspberry Pi Interfaces
          • 5.2 GPIO Interface
          • 5.3 I2C Interface
          • 5.4 SPI Communication
          • 5.5 PWM Control
          • 5.6 Serial Port Communication
          • 5.7 TF Card Slot
          • 5.8 Display Screen
          • 5.9 Touch Screen
          • 5.10 Audio
          • 5.11 RTC
          • 5.12 Ethernet
          • 5.13 M.2
          • 5.14 MINI PCIE
          • 5.15 Camera
          • 5.16 WIFI BT
          • 5.17 HAT
        • 6. FAQ

          • 6.1 Download Link
      • M-K1HSE

        • 1. Introduction

          • 1.1 Product Introduction
        • 2. Quick Start

          • 2.1 Debug Tool Installation
          • 2.2 Development Environment Setup
          • 2.3 Source Code Download
          • 2.4 Build Instructions
          • 2.5 Flashing Guide
          • 2.6 APT Update Sources
          • 2.7 View Board Info
          • 2.8 CLI LED and Key Test
          • 2.9 GCC Build Programs
        • 3. Application Development

          • 3.1 Basic Application Development

            • 3.1.1 Development Environment Preparation
            • 3.1.2 First Application HelloWorld
            • 3.1.3 Develop HAR Package
          • 3.2 Peripheral Application Cases

            • 3.2.1 UART Read/Write
            • 3.2.2 Key Demo
            • 3.2.3 LED Flash
        • 4. Peripherals and Interfaces

          • 4.1 Standard Peripherals

            • 4.1.1 USB
            • 4.1.2 Display and Touch
            • 4.1.3 Ethernet
            • 4.1.4 WIFI
            • 4.1.5 Bluetooth
            • 4.1.6 TF Card
            • 4.1.7 Audio
            • 4.1.8 Serial Port
            • 4.1.9 CAN
            • 4.1.10 RTC
          • 4.2 Interfaces

            • 4.2.1 Audio
            • 4.2.2 RS485
            • 4.2.3 Display
            • 4.2.4 Touch
        • 5. System Customization Development

          • 5.1 System Porting
          • 5.2 System Customization
          • 5.3 Driver Development
          • 5.4 System Debugging
          • 5.5 OTA Upgrade
        • 6. Download

          • 6.1 Download
    • EVS-Camera

      • CF-NRS1

        • 1. Introduction

          • 1.1 About CF-NRS1
          • 1.2 Event-Based Concepts
          • 1.3 Quick Start
          • 1.4 Resources
        • 2. Development

          • 2.1 Development Overview

            • 2.1.1 Shimetapi Hybrid Camera SDK Introduction
          • 2.2 Environment & API

            • 2.2.1 Environment Overview
            • 2.2.2 Development API Overview
          • 2.3 Linux Development

            • 2.3.1 Linux SDK Introduction
            • 2.3.2 Linux SDK API
            • 2.3.3 Linux Algorithm
            • 2.3.4 Linux Algorithm API
          • 2.4 Service & Web

            • 2.4.1 EVS Server
            • 2.4.2 Time Server
            • 2.4.3 EVS Web
        • 3. Download

          • 3.1 Download
        • 4. Common Problems

          • 4.1 Common Problems
      • CF-CRA2

        • 1. Introduction

          • 1.1 About CF-CRA2
        • 2. Download

          • 2.1 Download
      • EVS Module

        • 1. Related Concepts
        • 2. Hardware Preparation and Environment Configuration
        • 3. Example Program User Guide
        • Resources Download
    • AI-model

      • 1684XB-32T

        • 1. Introduction

          • AIBOX-1684XB-32 Introduction
        • 2. Quick Start

          • First time use
          • Network Configuration
          • Disk usage
          • Memory allocation
          • Fan Strategy
          • Firmware Upgrade
          • Cross-Compilation
          • Model Quantization
        • 3. Application Development

          • 3.1 Development Introduction

            • Sophgo SDK Development
            • SOPHON-DEMO Introduction
          • 3.2 Large Language Models

            • Deploying Llama3 Example
            • /ai-model/AIBOX-1684XB-32/application-development/LLM/Sophon_LLM_api_server-Development-AIBOX-1684XB-32.html
            • /ai-model/AIBOX-1684XB-32/application-development/LLM/MiniCPM-V-2_6-AIBOX-1684XB-32.html
            • /ai-model/AIBOX-1684XB-32/application-development/LLM/Qwen-2-5-VL-demo-Development-AIBOX-1684XB-32.html
            • /ai-model/AIBOX-1684XB-32/application-development/LLM/Qwen-3-chat-demo-Development-AIBOX-1684XB-32.html
            • /ai-model/AIBOX-1684XB-32/application-development/LLM/Qwen3-Qwen Agent-MCP.html
            • /ai-model/AIBOX-1684XB-32/application-development/LLM/Qwen3-langchain-AI Agent.html
          • 3.3 Deep Learning

            • ResNet (Image Classification)
            • LPRNet (License Plate Recognition)
            • SAM (Universal Image Segmentation Foundation Model)
            • YOLOv5 (Object Detection)
            • OpenPose (Human Keypoint Detection)
            • PP-OCR (Optical Character Recognition)
        • 4. Download

          • Resource Download
      • 1684X-416T

        • 1. Introduction

          • AIBOX-1684X-416 Introduction
        • 2. Demo Simple Operation Guide

          • Simple instructions for using shimeta smart monitoring demo
      • RDK-X5

        • 1. Introduction

          • RDK-X5 Hardware Introduction
        • 2. Quick Start

          • RDK-X5 Quick Start
        • 3. Application Development

          • 3.1 AI Online Model Development

            • AI Online Development - Experiment01
            • AI Online Development - Experiment02
            • AI Online Development - Experiment03
            • AI Online Development - Experiment04
            • AI Online Development - Experiment05
            • AI Online Development - Experiment06
          • 3.2 Large Language Models (Voice)

            • Voice LLM Application - Experiment01
            • Voice LLM Application - Experiment02
            • Voice LLM Application - Experiment03
            • Voice LLM Application - Experiment04
            • Voice LLM Application - Experiment05
            • Voice LLM Application - Experiment06
          • 3.3 40pin-IO Development

            • 40pin IO Development - Experiment01
            • 40pin IO Development - Experiment02
            • 40pin IO Development - Experiment03
            • 40pin IO Development - Experiment04
            • 40pin IO Development - Experiment05
            • 40pin IO Development - Experiment06
            • 40pin IO Development - Experiment07
          • 3.4 USB Module Development

            • USB Module Usage - Experiment01
            • USB Module Usage - Experiment02
          • 3.5 Machine Vision

            • Machine Vision Technology Development - Experiment01
            • Machine Vision Technology Development - Experiment02
            • Machine Vision Technology Development - Experiment03
            • Machine Vision Technology Development - Experiment04
          • 3.6 ROS2 Base Development

            • ROS2 Basic Development - Experiment01
            • ROS2 Basic Development - Experiment02
            • ROS2 Basic Development - Experiment03
            • ROS2 Basic Development - Experiment04
      • RDK-S100

        • 1. Introduction

          • 1.1 About RDK-S100
        • 2. Quick Start

          • 2.1 First Use
        • 3. Application Development

          • 3.1 AI Online Model Development

            • 3.1.1 Volcano Engine Doubao AI
            • 3.1.2 Image Analysis
            • 3.1.3 Multimodal Visual Analysis
            • 3.1.4 Multimodal Image Comparison
            • 3.1.5 Multimodal Document Analysis
            • 3.1.6 Camera AI Vision Analysis
          • 3.2 Large Language Models

            • 3.2.1 Speech Recognition
            • 3.2.2 Voice Conversation
            • 3.2.3 Multimodal Image Analysis
            • 3.2.4 Multimodal Image Comparison
            • 3.2.5 Multimodal Document Analysis
            • 3.2.6 Multimodal Vision Application
          • 3.3 40pin-IO Development

            • 3.3.1 GPIO Output LED Blink
            • 3.3.2 GPIO Input
            • 3.3.3 Key Control LED
            • 3.3.4 PWM Output
            • 3.3.5 Serial Output
            • 3.3.6 I2C Experiment
          • 3.4 USB Module Development

            • 3.4.1 USB Voice Module
            • 3.4.2 Sound Source Localization
          • 3.5 Machine Vision

            • 3.5.1 USB Camera
            • 3.5.2 Image Processing Basics
            • 3.5.3 Object Detection
            • 3.5.4 Image Segmentation
          • 3.6 ROS2 Base Development

            • 3.6.1 Environment Setup
            • 3.6.2 Create and Build Workspace
            • 3.6.3 ROS2 Topic Communication
            • 3.6.4 ROS2 Camera Application
    • Core-Board

      • C-3568BQ

        • 1. Introduction

          • C-3568BQ Introduction
      • C-3588LQ

        • 1. Introduction

          • C-3588LQ Introduction
      • GC-3568JBAF

        • 1. Introduction

          • GC-3568JBAF Introduction
      • C-K1BA

        • 1. Introduction

          • C-K1BA Introduction

System customization

UI Customization

Change the boot logo

The Boot logo can be placed in 2 locations:

The boot logo shared by all schemes is placed at:

device/soc/spacemit/k1/kernel/boot/bootfs is as follows:

|-- boot_logo_spacemit_0.bmp
|-- boot_logo_spacemit_180.bmp
|-- boot_logo_spacemit_270.bmp
`-- boot_logo_spacemit_90.bmp

There are 4 images of the same boot logo, divided into 4 directions. Each plan selects a logo in different directions according to needs. Generally, a 0° logo image is selected.

The customized boot logo for a specific solution is placed at:

device/board/spacemit/xxx/kernel/boot/bootfs

as follows:

|-- boot_logo_ry_270.bmp

The image requirement for bootlogo is a 32-bit bmp image. Place the new boot logo in the above directory, then modify the build_kernel.sh file in device/board/spacemit/smt001/kernel and copy the boot logo to the packaging path.

cp ${OHOS_SOURCE_ROOT}/device/soc/${DEVICE_BOARD}/k1/kernel/boot/bootfs/boot_logo_spacemit_0.bmp ${OHOS_IMAGES_DIR}/bootfs/bianbu.bmp

Change kernel logo

The kernel logo is the logo displayed after the boot logo and between the boot animation. The purpose is to avoid a long black screen between the boot logo and the boot animation. Generally, the pattern of the kernel logo is consistent with the boot logo.

kernel_logo is placed in

device/board/spacemit/common/kernel_logo is as follows:

|-- kernel_logo_ry_270.ppm
|-- kernel_logo_spacemit_0.ppm
|-- kernel_logo_spacemit_180.ppm
|-- kernel_logo_spacemit_270.ppm
`-- kernel_logo_spacemit_90.ppm

After adding the new kernel logo, modify the build_kernel.sh file in device/board/spacemit/smt001/kernel and copy the kernel logo to the kernel compilation path.

cp -rf ${OHOS_SOURCE_ROOT}/device/board/${DEVICE_BOARD}/common/kernel_logo/kernel_logo_spacemit_0.ppm ${KERNEL_BUILD_ROOT}/drivers/video/logo/

logo_linux_clut224.ppm bmp to ppm Install the conversion tool sudo apt-get install netpbm Execute the script, and xxx.ppm will be generated in the current directory. ./bmp2ppm.sh xxx.bmp The script content is as follows:

 #!/bin/bash
 if [ " $1" == " " ];
 then
     echo "usage:$0 bmp_file"
     exit 0
 fi

 if [ -f "$1" ]
 then
     echo $1
 else
     echo "no find file [$1]"
     exit 0
 fi
 name=${1%%.*}
 bmptopnm $1 > $name.pnm
 pnmquant 224 $name.pnm > $name.clut224.pnm
 pnmtoplainpnm $name.clut224.pnm > $name.ppm
 rm $name.pnm $name.clut224.pnm

Change boot animation

There are two ways to change the boot animation. One is to change the native boot animation, and the other is to add a custom animation. The following are the two ways:

Replace native animation

The native boot animation is bootpic.zip in foundation/graphic/graphic_2d/frameworks/bootanimation/data, which can replace this zip package.

The boot animation zip package includes:

|-- config.json
`-- OH_bootAni compressed
    |-- OH_bootAni_00000.jpg
    |-- OH_bootAni_00001.jpg
    |-- OH_bootAni_00002.jpg
    |-- OH_bootAni_00003.jpg
    |-- ...
    |-- OH_bootAni_00146.jpg
    |-- OH_bootAni_00147.jpg
    |-- OH_bootAni_00148.jpg
    `-- OH_bootAni_00149.jpg
	
The content of config.json is:

{
        "Remark": "FrameRate Support 30, 60 frame rate configuration",
        "FrameRate": 30
}

To customize your own boot animation, you need to follow the above format and content.

Adding custom animations

In the vendor/spacemit/xxx directory, add the bootanimation_custom_config.json configuration file and configure the path of the custom animation as follows:

{
        "cust.bootanimation.pics": "/sys_prod/etc/bootanimation/cust_bootpic.zip",
        "cust.bootanimation.sounds": "/sys_prod/etc/bootanimation/cust_bootsound.wav",
        "cust.bootanimation.video": "/sys_prod/etc/bootanimation/cust_bootvideo.mp4"
}

And put the customized boot animation in the path corresponding to the above file.

Change the startup music

There are two ways to change the startup music. One is to change the original startup music, and the other is to add custom music. The following are the two ways:

Replace original music

The native boot music is bootsound.wav in foundation/graphic/graphic_2d/frameworks/bootanimation/data. You can replace this wav file. The music does not need to be too long.

Add custom music

In the vendor/spacemit directory, add the bootanimation_custom_config.json configuration file and configure the path of the custom music as follows:

{
        "cust.bootanimation.pics": "/sys_prod/etc/bootanimation/cust_bootpic.zip",
        "cust.bootanimation.sounds": "/sys_prod/etc/bootanimation/cust_bootsound.wav",
        "cust.bootanimation.video": "/sys_prod/etc/bootanimation/cust_bootvideo.mp4"
}

And put the customized startup music in the path corresponding to the above file.

Change boot video

There are two ways to change the boot video. One is to change the native boot video, and the other is to add a custom video. The following are the two ways:

Replace the original video

The native boot video is bootvideo.mp4 in foundation/graphic/graphic_2d/frameworks/bootanimation/data. You can replace this mp4 file and ensure that the video encoding format of the boot video is H.264 and the aspect ratio of the video is consistent with the aspect ratio of the screen.

Add a custom video

Under the vendor/spacemit directory, add a bootanimation_custom_config.json configuration file, which configures the path to the customized video as follows:

{
        "cust.bootanimation.pics": "/sys_prod/etc/bootanimation/cust_bootpic.zip",
        "cust.bootanimation.sounds": "/sys_prod/etc/bootanimation/cust_bootsound.wav",
        "cust.bootanimation.video": "/sys_prod/etc/bootanimation/cust_bootvideo.mp4"
}

And put the customized startup video in the path corresponding to the above file.

Application customization

Pre-built applications

Place hap in applications/standard/hap

Modify the configuration of applications/standard/hap/BUILD.gn as follows (taking browser hap as an example):

diff --git a/BUILD.gn b/BUILD.gn
index c9ea451..87ed7aa 100755
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -407,6 +407,13 @@ ohos_prebuilt_etc("tetris_hap") {
   subsystem_name = "applications"
 }

+ohos_prebuilt_etc("broswer_hap") {
+  source = "Broswer.hap"
+  module_install_dir = "app/ohos.samples.browser"
+  part_name = "prebuilt_hap"
+  subsystem_name = "applications"
+}
+
 group("hap") {
   deps = [
     ":calendarData_hap",
@@ -464,6 +471,7 @@ group("hap") {
     "//applications/standard/hap:wuziqi_hap",
     "//applications/standard/hap:deviceinfo_hap",
     "//applications/standard/hap:tetris_hap",
+    "//applications/standard/hap:broswer_hap",
   ]
   if (defined(product_name) && product_name == "watchos") {
     deps -= [

Modify the vendor/spacemit/xxx/preinstall-config/install_list.json configuration for installation, as shown below:

diff --git a/smt001/preinstall-config/install_list.json b/smt001/preinstall-config/install_list.json
index dd859c2..0107e85 100755
--- a/smt001/preinstall-config/install_list.json
+++ b/smt001/preinstall-config/install_list.json
@@ -220,6 +220,10 @@
             "app_dir": "/system/app/ohos.samples.game2048",
             "removable": false
         },
+        {
+            "app_dir": "/system/app/ohos.samples.label",
+            "removable": false
+        },
         {
             "app_dir": "/system/app/com.example.Digital_Huarong_Road",
             "removable": false

Deleting Pre-installed Applications

Deleting an application is the reverse operation of adding an application. You can refer to the above section and delete the corresponding hap configuration in vendor/spacemit/xxx/preinstall-config/install_list.json.

Replace system apps

By Ability, system applications can be divided into the following two categories:

UIAbility, such as Settings, Photos, Camera, etc., these system applications can be displayed on the desktop. ExtensionAbility, such as Launcher, SystemUI, Settingsdata, etc., some of these system applications create windows to display the interface, while others are pageless resident services to provide corresponding capabilities. Therefore, the traditional hdc install command and IDE automatic installation cannot be installed normally. At this time, the replacement of system applications is needed.

Taking Launcher as an example, the steps to replace system applications are as follows:

Find the Launcher preset hap path /system/app/com.ohos.launcher, you can see there are 2 haps under this path: Launcher.hap and Launcher_Settings.hap. Execute the following command

hdc shell "mount -o remount,rw /"
hdc shell "rm -rf /data/*"
hdc file send Launcher.hap /system/app/com.ohos.launcher/Launcher.hap
hdc file send Launcher_Settings.hap /system/app/com.ohos.launcher/Launcher_Settings.hap
hdc shell "reboot"

You can replace and install the Launcher you built normally

Photo Album

Push video

Prepare xxx.mp4 video

Push the video into the machine via hdc

D:\>hdc file send D:\xxx.mp4 /storage/media/100/local/files/Videos/

Triggering a media scan


D:\>hdc shell

Open the photo app and play the video. If there is no video, delete the photo app in the background and re-enter the push image to prepare xxx.jpg or xxx.png images. Push the images to the machine through hdc.

D:\>hdc file send D:\xxx.jpg /storage/media/100/local/files/Pictures/

Triggering a media scan

D:\>hdc shell
# scanner
#

Open the photo app and display the pictures. If there are no pictures, delete the photo app in the background and re-enter the app.

Launcher

Replace background image

The location of the background image is: applications/standard/launcher/product/phone/src/main/ets/common/pics/img_wallpaper_default.jpg

After replacing the image, recompile Launcher, put the newly generated Launcher.hap into the applications/standard/hap folder, and generate a new img.

Lock screen

Remove lock screen

Remove the lock screen application related code in the applications/standard/hap/BUILD.gn file as follows:

diff --git a/BUILD.gn b/BUILD.gn
index e213683..7382b97 100755
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -463,7 +463,6 @@ group("hap") {
     "//applications/standard/hap:note_hap",
     "//applications/standard/hap:notificationManagement_hap",
     "//applications/standard/hap:photos_hap",
-    "//applications/standard/hap:screenLock_hap",
     "//applications/standard/hap:screen_shot_hap",
     "//applications/standard/hap:settingsData_hap",
     "//applications/standard/hap:settings_faceauth_hap",
@@ -518,7 +517,6 @@ group("hap") {
       "//applications/standard/hap:navigationBar_hap",
       "//applications/standard/hap:notificationManagement_hap",
       "//applications/standard/hap:photos_hap",
-      "//applications/standard/hap:screenLock_hap",
       "//applications/standard/hap:screen_shot_hap",
       "//applications/standard/hap:settingsData_hap",
       "//applications/standard/hap:settings_faceauth_hap",

Remove the detection of the lock screen application status at boot time in the foundation/systemabilitymgr/safwk/etc/profile/foundation.cfg file as follows:

diff --git a/etc/profile/foundation.cfg b/etc/profile/foundation.cfg
index f2573fa..1a21510 100644
--- a/etc/profile/foundation.cfg
+++ b/etc/profile/foundation.cfg
@@ -25,7 +25,6 @@
             "name" : "services:restartfoundation",
             "cmds" : [
                 "unset_bootevent bootevent.appfwk.ready",
-                "unset_bootevent bootevent.lockscreen.ready",
                 "unset_bootevent bootevent.launcher.ready",
                 "reset appspawn",
                 "reset accountmgr",
@@ -141,7 +140,6 @@
             "bootevents": [
                 "bootevent.wms.fullscreen.ready",
                 "bootevent.appfwk.ready",
-                "bootevent.lockscreen.ready",
                 "bootevent.launcher.ready",
                 "bootevent.wms.ready"
             ],

Remove the window controller's response to the lock screen signal; because here we only remove the lock screen application, but the mechanism for triggering the lock screen is still there, such as key triggering and remote control triggering, but there is no actual response. If it is not removed, when the mechanism for entering the lock screen is triggered again, the application interface may freeze. Modify the foundation/window/window_manager/wmserver/src/window_controller.cpp file as follows:

diff --git a/wmserver/src/window_controller.cpp b/wmserver/src/window_controller.cpp
index 32c6a60ec..98df12ffc 100644
--- a/wmserver/src/window_controller.cpp
+++ b/wmserver/src/window_controller.cpp
@@ -783,8 +783,8 @@ void WindowController::NotifyDisplayStateChange(DisplayId defaultDisplayId, sptr
     WLOGFD("NotifyDisplayStateChange start: %{public}u", type);
     switch (type) {
         case DisplayStateChangeType::BEFORE_SUSPEND: {
-            isScreenLocked_ = true;
-            windowRoot_->ProcessWindowStateChange(WindowState::STATE_FROZEN, WindowStateChangeReason::KEYGUARD);
+            //isScreenLocked_ = true;
+            //windowRoot_->ProcessWindowStateChange(WindowState::STATE_FROZEN, WindowStateChangeReason::KEYGUARD);
             break;
         }
         case DisplayStateChangeType::BEFORE_UNLOCK: {

Side Effect: No drop-down menu

System customization

Power management customization

Mainly modify vendor/spacemit/xxx/power_config/power_mode_config.xml as follows:

<!--
    Power Mode Definitions:
    MODE_NORMAL = 600,
    MODE_POWER_SAVE = 601,
    MODE_PERFORMANCE = 602,
    MODE_EXTREME_POWER_SAVE = 603,
-->
<!--
    Action Definitions:
    DisplayOffTime = 101,
    SystemAutoSleepTime = 102,
    AutoAdjustBrightness = 103,
    AutoWindowRotation = 107,
    SystemBrightness = 115,
    VibratorsState = 120,
-->
<switch_proxy version="1">
    <proxy id="600">
        <switch id="101" value="300000" recover_flag="0"/>
        <switch id="102" value="0" recover_flag="0"/>
        <switch id="103" value="-1" recover_flag="0"/>
        <switch id="107" value="1" recover_flag="0"/>
        <switch id="115" value="76" recover_flag="0"/>
        <switch id="120" value="1" recover_flag="0"/>
    </proxy>
    <proxy id="601">
        <switch id="101" value="10000" recover_flag="0"/>
        <switch id="102" value="5000" recover_flag="0"/>
        <switch id="103" value="-1" recover_flag="0"/>
        <switch id="107" value="-1" recover_flag="0"/>
        <switch id="115" value="50" recover_flag="0"/>
        <switch id="120" value="-1" recover_flag="0"/>
    </proxy>
    <proxy id="602">
        <switch id="101" value="-1" recover_flag="0"/>
        <switch id="102" value="-1" recover_flag="0"/>
        <switch id="103" value="-1" recover_flag="0"/>
        <switch id="107" value="1" recover_flag="0"/>
        <switch id="115" value="255" recover_flag="0"/>
        <switch id="120" value="1" recover_flag="0"/>
    </proxy>
    <proxy id="603">
        <switch id="101" value="5000" recover_flag="0"/>
        <switch id="102" value="1000" recover_flag="0"/>
        <switch id="103" value="-1" recover_flag="0"/>
        <switch id="107" value="-1" recover_flag="0"/>
        <switch id="115" value="25" recover_flag="0"/>
        <switch id="120" value="-1" recover_flag="0"/>
    </proxy>
</switch_proxy>

This file mainly defines several power management modes, including normal/power saving/performance/super power saving, etc., as well as the parameters of the corresponding management modes, including screen off time, standby time, etc.

The default system is in MODE_NORMAL mode, and you can switch to other modes through commands. For example, if you don't want the system to go into sleep mode, you can switch to performance mode as follows:

power-shell setmode 602

Window management customization

Mainly modify display_manager_config.xml and window_manager_config.xml in the vendor/spacemit/smt001/window_config path

display_manager_config.xml
 <Configs>
    <!--Window display dpi, valid range is 80~640, use 0 if no configuration is requeired-->
    <dpi>240</dpi>
    <!-- Indicate the deviation between the default device display direction and the direction -->
    <!-- of the sensor. Use 0 in default, available values are {0, 90, 180, 270} -->
    <defaultDeviceRotationOffset>0</defaultDeviceRotationOffset>
    <!-- Svg path for cutout, use empty string if there is not cutout on the screen -->
    <!-- format: string -->
    <!-- default value: empty string -->
    <!-- sample: M 100,100 m -75,0 a 75,75 0 1,0 150,0 a 75,75 0 1,0 -150,0 z -->
    <defaultDisplayCutoutPath></defaultDisplayCutoutPath>
    <!-- Indicates the boundary of the curved screen, each value corresponds to the px from each edge -->
    <!-- format: number(left) number(top) number(right) number(bottom) -->
    <!-- default value: 0 0 0 0 -->
    <!-- sample: 150 150 0 0 -->
    <curvedScreenBoundary>0 0 0 0</curvedScreenBoundary>
    <!-- Indicates whether the built-in display is a waterfall display -->
    <!-- format: boolean -->
    <!-- default value: false -->
    <!-- sample: false -->
    <isWaterfallDisplay enable="false"></isWaterfallDisplay>

    <!-- Indicate whether to enable display area compression for waterfall display when displayed in landscape -->
    <!-- or landscape_inverted mode. -->
    <!-- This configuration item takes effect only when isWaterfallDisplay above is true -->
    <!-- format: boolean -->
    <!-- default value: false -->
    <isWaterfallAreaCompressionEnableWhenHorizontal enable="false"></isWaterfallAreaCompressionEnableWhenHorizontal>

    <!-- Indicate the size of both sides of the waterfall display which to be compressed when displayed in landscape -->
    <!-- or landscape_inverted mode. -->
    <!-- This configuration item takes effect only when isWaterfallDisplay above is true -->
    <!-- format: uint32_t, the unit is vp. -->
    <!-- default value: 0 -->
    <waterfallAreaCompressionSizeWhenHorzontal>0</waterfallAreaCompressionSizeWhenHorzontal>

    <!-- Indicates orientation of the built-in screen -->
    <!-- 0: Orientation::UNSPECIFIED -->
    <!-- 1: Orientation::VERTICAL         2: Orientation::HORIZONTAL-->
    <!-- 3: Orientation::REVERSE_VERTICAL 4: Orientation::REVERSE_HORIZONTAL -->
    <buildInDefaultOrientation>0</buildInDefaultOrientation>
 </Configs>

The main modified configurations are:

dpi: pixel density, the larger the dpi, the smaller the icon buildInDefaultOrientation: desktop rotation angle configuration window_manager_config.xml is mainly used to configure window animations, effects, etc., and there are not many modifications

Network management customization

Wi-Fi Customization

Driver debugging

The debugging function is mainly performed by iteration to ensure that the driver layer functions normally and can compile ko.

Copy ko (taking rtl8852bs as an example)

Copy it in build_kernel.sh of device/board/spacemit/xxx/kernel as follows:

function cp_ko(){
  # cp ko to userspace
  cp ${KERNEL_BUILD_ROOT}/drivers/usb/typec/typec.ko ${OHOS_SOURCE_ROOT}/device/board/${DEVICE_BOARD}/${DEVICE_NAME}/kernel/ko
  cp ${KERNEL_BUILD_ROOT}/drivers/usb/typec/husb239.ko ${OHOS_SOURCE_ROOT}/device/board/${DEVICE_BOARD}/${DEVICE_NAME}/kernel/ko
  cp ${KERNEL_BUILD_ROOT}/drivers/net/wireless/realtek/rtl8852be/8852be.ko ${OHOS_SOURCE_ROOT}/device/board/${DEVICE_BOARD}/${DEVICE_NAME}/kernel/ko
  cp ${KERNEL_BUILD_ROOT}/drivers/net/wireless/realtek/rtl8852bs/8852bs.ko ${OHOS_SOURCE_ROOT}/device/board/${DEVICE_BOARD}/${DEVICE_NAME}/kernel/ko
}

After compiling the kernel, copy the ko files in the kernel compilation directory to the OpenHarmony system directory. When compiling OpenHarmony, these ko files will be copied to the vendor partition and packaged.

Load ko (take 8852bs as an example)

Load ko in init.xxx.cfg in device/board/spacemit/xxx/cfg as follows:

{
  "name" : "fs",
    "cmds" : [
      "insmod /vendor/modules/8852bs.ko ifname=wlan0 if2name=p2p0",
      "insmod /vendor/modules/typec.ko",
      "insmod /vendor/modules/husb239.ko"
    ]
},

After booting, these ko files will be loaded in the init process. Use the lsmod command to check whether the loading is successful, as follows:

# lsmod
Module                  Size  Used by
husb239               110592  0
typec                 323584  1 husb239
8852bs              10031104  0

Multimedia system customization

Audio path customization

Add sound card information in vendor\spacemit\xxx\hals\audio\alsa_adapter.json.

{
    "adapters": [
        {
            "name": "primary",
            "cardId": 0,
            "cardName": "sndes8326"
        },
        {
            "name": "usb",
            "cardId": 1,
            "cardName": "C"
        }
    ]
}

Configure the audio properties of different sound cards in vendor\spacemit\xxx\hals\audio\config\riscv64\audio_policy_config.xml, including the sampling rate, number of channels, buffer size, etc. for playback and recording.

        <adapter name="primary" supportSelectScene="0">
            <pipes>
                <pipe name="primary_output" role="output">
                    <paProp lib="libmodule-hdi-sink.z.so" role="sink" fixed_latency="1" render_in_idle_state="1" moduleName="Speaker"/>
                    <streamProps>
                        <streamProp format="s16le" sampleRates="48000" channelLayout="CH_LAYOUT_STEREO" bufferSize="4096"/>
                    </streamProps>
                    <attributes>
                        <attribute name="preload" value="true"/>
                    </attributes>
                </pipe>
                <pipe name="primary_input" role="input">
                    <paProp lib="libmodule-hdi-source.z.so" role="source" moduleName="Built_in_mic"/>
                    <streamProps>
                        <streamProp format="s16le" sampleRates="48000" channelLayout="CH_LAYOUT_STEREO" bufferSize="4096"/>
                    </streamProps>
                </pipe>
            </pipes>
            <devices>
                <device name="Speaker_Out" type="DEVICE_TYPE_SPEAKER" pin="PIN_OUT_SPEAKER" role="output" supportPipes="primary_output"/>
                <device name="Wired_Headset_Out" type="DEVICE_TYPE_WIRED_HEADSET" pin="PIN_OUT_HEADSET" role="output" supportPipes="primary_output"/>
                <device name="Wired_Headphones_Out" type="DEVICE_TYPE_WIRED_HEADPHONES" pin="PIN_OUT_HEADPHONE" role="output" supportPipes="primary_output"/>
                <device name="Builtin_Mic_In" type="DEVICE_TYPE_MIC" pin="PIN_IN_MIC" role="input" supportPipes="primary_input"/>
                <device name="Wired_Headset_In" type="DEVICE_TYPE_WIRED_HEADSET" pin="PIN_IN_HS_MIC" role="input" supportPipes="primary_input"/>
            </devices>
        </adapter>
                <adapter name="usb">
            <pipes>
                <pipe name="usb_output" role="output">
                    <paProp lib="libmodule-hdi-sink.z.so" role="sink" fixed_latency="1" render_in_idle_state="1" moduleName="Usb_arm_speaker"/>
                    <streamProps>
                        <streamProp format="s16le" sampleRates="48000" channelLayout="CH_LAYOUT_STEREO" bufferSize="4096"/>
                    </streamProps>
                    <attributes>
                        <attribute name="preload" value="true"/>
                    </attributes>
                </pipe>
                <pipe name="usb_input" role="input">
                    <paProp lib="libmodule-hdi-source.z.so" role="source" moduleName="Usb_arm_mic"/>
                    <streamProps>
                        <streamProp format="s16le" sampleRates="48000" channelLayout="CH_LAYOUT_STEREO" bufferSize="19200"/>
                    </streamProps>
                </pipe>
            </pipes>
            <devices>
                <device name="Usb_Headset_Out" type="DEVICE_TYPE_USB_HEADSET" pin="PIN_OUT_USB_HEADSET" role="output" supportPipes="usb_output"/>
                <device name="Usb_Headset_In" type="DEVICE_TYPE_USB_HEADSET" pin="PIN_IN_USB_HEADSET" role="input" supportPipes="usb_input"/>
            </devices>
        </adapter>

Kernel customization

Modify kernel defconfig configuration

The kernel defconfig is located at:

kernel/linux/spacemit_kernel-6.6/arch/riscv/configs/k1_defconfig

After the modification, compile the kernel separately and then package it, as follows:

./build.sh --product-name xxx --ccache --prebuilt-sdk -T build_kernel
./build/gen_zip.sh xxx

Modify kernel dts configuration

The kernel's dts configuration is located at:

kernel/linux/spacemit_kernel-6.6/arch/riscv/boot/dts/spacemit

As shown below:

|-- k1-x-camera-reserved-mm.dtsi
|-- k1-x-camera-sdk.dtsi
|-- k1-x-camera-sensor.dtsi
|-- k1-x_deb1.dts
|-- k1-x_deb2.dts
|-- k1-x.dtsi
|-- k1-x-efuse.dtsi
|-- k1-x_evb.dts
|-- k1-x-hdmi.dtsi
|-- k1-x_hs450.dts
|-- k1-x_kx312.dts
|-- k1-x-lcd.dtsi
|-- k1-x_lpi3a.dts
|-- k1-x_milkv-jupiter.dts
|-- k1-x_mingo.dts
|-- k1-x_MINI-PC.dts
|-- k1-x_MUSE-Book.dts
|-- k1-x_MUSE-Card.dts
|-- k1-x_MUSE-N1.dts
|-- k1-x_MUSE-Paper2.dts
|-- k1-x_MUSE-Paper.dts
|-- k1-x_MUSE-Paper-mini-4g.dts
|-- k1-x_MUSE-Pi.dts
|-- k1-x_opp_table.dtsi
|-- k1-x_pinctrl.dtsi
|-- k1-x_SMT001.dts
|-- k1-x_thermal_cooling.dtsi
|-- k1-x_ZT001H.dts
|-- lcd
|   |-- lcd_ft8201sinx101_mipi.dtsi
|   |-- lcd_gc9503v_mipi.dtsi
|   |-- lcd_gx09inx101_mipi.dtsi
|   |-- lcd_icnl9911c_mipi.dtsi
|   |-- lcd_icnl9951r_mipi.dtsi
|   |-- lcd_jd9365dah3_mipi.dtsi
|   |-- lcd_jd9365da_mipi_1280x800.dtsi
|   |-- lcd_lt8911_edp_1920x1080.dtsi
|   |-- lcd_lt8911_edp_1920x1200.dtsi
|   |-- lcd_lt9711_dp_1920x1080.dtsi
|   `-- lcd_orisetech_ota7290b_mipi.dtsi
|-- m1-x_milkv-jupiter.dts
`-- Makefile

After modifying the dts configuration of the corresponding solution, compile the kernel separately and then package it, as follows:

./build.sh --product-name xxx --ccache --prebuilt-sdk -T build_kernel
./build/gen_zip.sh xxx

Add the ko that needs to be loaded

If you need to load the ko file compiled by the kernel when the system starts, you need to modify the configuration of the upper layer of OpenHarmony, which is mainly divided into two steps:

Copy ko

Copy it in build_kernel.sh of device/board/spacemit/xxx/kernel as follows:

function cp_ko(){
  # cp ko to userspace
  cp ${KERNEL_BUILD_ROOT}/drivers/usb/typec/typec.ko ${OHOS_SOURCE_ROOT}/device/board/${DEVICE_BOARD}/${DEVICE_NAME}/kernel/ko
  cp ${KERNEL_BUILD_ROOT}/drivers/usb/typec/husb239.ko ${OHOS_SOURCE_ROOT}/device/board/${DEVICE_BOARD}/${DEVICE_NAME}/kernel/ko
  cp ${KERNEL_BUILD_ROOT}/drivers/net/wireless/realtek/rtl8852be/8852be.ko ${OHOS_SOURCE_ROOT}/device/board/${DEVICE_BOARD}/${DEVICE_NAME}/kernel/ko
  cp ${KERNEL_BUILD_ROOT}/drivers/net/wireless/realtek/rtl8852bs/8852bs.ko ${OHOS_SOURCE_ROOT}/device/board/${DEVICE_BOARD}/${DEVICE_NAME}/kernel/ko
}

After compiling the kernel, copy the ko file in the kernel compilation directory to the OpenHarmony system directory.

Load ko

Load ko in init.xxx.cfg in device/board/spacemit/xxx/cfg as follows:

{
  "name" : "fs",
    "cmds" : [
      "insmod /vendor/modules/8852bs.ko ifname=wlan0 if2name=p2p0",
      "insmod /vendor/modules/typec.ko",
      "insmod /vendor/modules/husb239.ko"
    ]
},

After booting, these ko will be loaded in the init process.

Patching the kernel

First generate the kernel modifications into a patch, and then place the generated patch in the OpenHarmony configuration directory.

For patches common to all platforms, place them in:

device/board/spacemit/kernel_patches/linux-6.6

For patches specific to a particular platform, place them in:

device/board/spacemit/xxx/kernel/kernel_patch
Inside the build_kernel.sh file located in the device/board/spacemit/xxx/kernel directory, apply the relevant patches as follows:

patch -p1 <${OHOS_SOURCE_ROOT}/device/board/spacemit/kernel_patches/linux-6.6/0001-bounds_checking_function-include.patch
patch -p1 <${OHOS_SOURCE_ROOT}/device/board/spacemit/kernel_patches/linux-6.6/0002-fix-hmdfs-permission.patch
patch -p1 <${OHOS_SOURCE_ROOT}/device/board/${DEVICE_BOARD}/${DEVICE_NAME}/kernel/kernel_patch/0001-kernel-audio.patch
Edit this page on GitHub
Last Updated:
Contributors: ZSL
Prev
5.1 System Porting
Next
5.3 Driver Development