From 24cad4762a24755f2796603f6a9b0618e722ddb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=AE=B6=E6=A0=8B?= Date: Mon, 19 Sep 2022 04:09:24 +0000 Subject: [PATCH] =?UTF-8?q?=E3=80=90OpenHarmony=E5=BC=80=E6=BA=90=E8=B4=A1?= =?UTF-8?q?=E7=8C=AE=E8=80=85=E8=AE=A1=E5=88=922022=E3=80=91update=20zh-cn?= =?UTF-8?q?/device-dev/porting/porting-stm32mp15xx-on-smallsystem.md.=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9md=E6=96=87=E6=A1=A3=E4=B8=AD=E5=85=B3?= =?UTF-8?q?=E4=BA=8EBUILD.gn=E4=B8=AD=E7=9A=84=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴家栋 --- .../porting-stm32mp15xx-on-smallsystem.md | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/zh-cn/device-dev/porting/porting-stm32mp15xx-on-smallsystem.md b/zh-cn/device-dev/porting/porting-stm32mp15xx-on-smallsystem.md index 57787c13f1..0785be003c 100644 --- a/zh-cn/device-dev/porting/porting-stm32mp15xx-on-smallsystem.md +++ b/zh-cn/device-dev/porting/porting-stm32mp15xx-on-smallsystem.md @@ -195,74 +195,74 @@ vendor cmd = "if [ -f $product_path/hdf_config/BUILD.gn ]; then echo true; else echo false; fi" HAVE_PRODUCT_CONFIG = exec_script("//build/lite/run_shell_cmd.py", [ cmd ], "value") - + group("liteos_a") { - deps = [ + deps = [ "board", "drivers", - ] - if (HAVE_PRODUCT_CONFIG) { + ] + if (HAVE_PRODUCT_CONFIG) { deps += [ "$product_path/hdf_config" ] - } else { + } else { deps += [ "hdf_config" ] + } } - } - + config("public") { - configs = [ + configs = [ "board:public", "drivers:public", - ] + ] } ``` 2. 在//device/board/bearpi/bearpi_hm_micro/liteos_a/board中新建BUILD.gn,添加代码如下。将os_adapt.c内核启动相关代码编译进系统。 ``` import("//kernel/liteos_a/liteos.gni") - + module_name = "bsp_config" - + kernel_module(module_name) { - sources = [] - if (defined(LOSCFG_PLATFORM_ADAPT)) { + sources = [] + if (defined(LOSCFG_PLATFORM_ADAPT)) { sources += [ "os_adapt/os_adapt.c" ] + } } - } - + config("public") { - include_dirs = [ "." ] - include_dirs += [ "include" ] - include_dirs += [ "$LITEOSTOPDIR/drivers/block/disk/include" ] - include_dirs += - [ "$LITEOSTOPDIR/../../drivers/adapter/khdf/liteos/osal/include" ] + include_dirs = [ "." ] + include_dirs += [ "include" ] + include_dirs += [ "$LITEOSTOPDIR/drivers/block/disk/include" ] + include_dirs += + [ "$LITEOSTOPDIR/../../drivers/adapter/khdf/liteos/osal/include" ] } ``` 3. 在//device/board/bearpi/bearpi_hm_micro/liteos_a/drivers中新建BUILD.gn,添加代码如下,将device/soc/st/common/platform路径下的HDF驱动编译进系统。 ``` import("//drivers/adapter/khdf/liteos/hdf.gni") - + group("drivers") { - public_deps = [ "//device/soc/st/common/platform:drivers" ] + public_deps = [ "//device/soc/st/common/platform:drivers" ] } - + config("public") { - configs = [ "//device/soc/st/common/platform:public" ] + configs = [ "//device/soc/st/common/platform:public" ] } - + ``` 4. 在//vendor/bearpi/bearpi_hm_micro/hdf_config中新建BUILD.gn,添加代码如下,将HCS配置文件编译进系统。 ``` module_switch = defined(LOSCFG_DRIVERS_HDF) && !defined(LOSCFG_DRIVERS_HDF_TEST) module_name = "libhdf_config" hdf_driver(module_name) { - hcs_sources = [ "hdf.hcs" ] + hcs_sources = [ "hdf.hcs" ] } - + group("hdf_config") { - public_deps = [ ":$module_name" ] - deps = [ + public_deps = [ ":$module_name" ] + deps = [ "hdf_test", "hdf_test/hcs_macro_test", - ] + ] } ``` ### 内核启动适配 -- GitLab