【鸿蒙南向开发】OpenHarmony瘦设备内核移植实战(三)

一、背景

OpenHarmony系统移植最核心的步骤是内核的移植,内核的稳定是一切子系统稳定的基础,上一篇我们讲述了内核启动原理,以及vendor、board的开发配置,本文将介绍SoC层级的移植适配流程。

二、SoC适配

SoC配置芯片层级编译依赖库,包括CMSIS、HAL(硬件抽象层)等,这里包含操作总线、串口、时钟、寄存等库函数。

1.创建对应的文件目录结构

目录名称按照芯片厂家、芯片型号来创建,比如st公司下的stm32f4xx系列芯片。
image.png

配置文件内容如下:

device/soc/st/stm32f4xx/Kconfig.liteos_m.defconfig.series
if SOC_SERIES_STM32F4xx
rsource "Kconfig.liteos_m.defconfig.stm32f4xx"
config SOC_SERIES
string
default "stm32f4xx"
endif
device/soc/st/stm32f4xx/Kconfig.liteos_m.defconfig.stm32f4xx
config SOC
string
default "stm32f4xx"
depends on SOC_STM32F4xx
device/soc/st/stm32f4xx/Kconfig.liteos_m.series
config SOC_SERIES_STM32F4xx
bool "STMicroelectronics STM32F4xx series"
select ARCH_ARM
select SOC_COMPANY_STMICROELECTRONICS
select CPU_CORTEX_M4
help
Enable support for STMicroelectronics STM32F4xx series
device/soc/st/stm32f4xx/Kconfig.liteos_m.soc
choice
prompt "STMicroelectronics STM32F4xx series SoC"
depends on SOC_SERIES_STM32F4xx
config SOC_STM32F407
bool "SoC STM32F407"
Endchoice
device/soc/st/Kconfig.liteos_m.defconfig
rsource "*/Kconfig.liteos_m.defconfig.series"
device/soc/st/Kconfig.liteos_m.defconfig
rsource "*/Kconfig.liteos_m.series"
device/soc/st/Kconfig.liteos_m.soc
config SOC_COMPANY_STMICROELECTRONICS
bool
if SOC_COMPANY_STMICROELECTRONICS
config SOC_COMPANY
default "st"
rsource "*/Kconfig.liteos_m.soc"
endif # SOC_COMPANY_STMICROELECTRONICS
device/soc/st/BUILD.gn
if (ohos_kernel_type == "liteos_m") {
import("//kernel/liteos_m/liteos.gni")
module_name = get_path_info(rebase_path("."), "name"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值