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 57787c13f1f2eae93f4f57a8e19f83a471c3ea9f..0785be003cb784fc91a1c1f8e63b5385ea22f4ef 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", - ] + ] } ``` ### 内核启动适配