From: luozheng <1732036298@qq.com> Date: Thu, 24 Jul 2025 03:45:16 +0000 (+0800) Subject: build文件夹合并提交 X-Git-Tag: leiniao_debug_1.0.0_20250922_020716~220 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=157370106c76f5513a2568da53e9aaf579a788fc;p=mirrors%2FFD230.git build文件夹合并提交 --- diff --git a/code/sdk/build/cmake/build_function.cmake b/code/sdk/build/cmake/build_function.cmake index 63c3ed805..23c5f93e3 100644 --- a/code/sdk/build/cmake/build_function.cmake +++ b/code/sdk/build/cmake/build_function.cmake @@ -29,6 +29,10 @@ endfunction() function(KCONFIG_GET_PARAMS KCONFIG_PATH) file(STRINGS ${KCONFIG_PATH} LOS_CONFIG_LIST ENCODING "UTF-8") + # ¹ýÂ˵ô¿ÕÐкÍ×¢ÊÍÐÐ + list(FILTER LOS_CONFIG_LIST EXCLUDE REGEX "^[ \t]*$") + list(FILTER LOS_CONFIG_LIST EXCLUDE REGEX "^[ \t]*#") + foreach (CONFIG ${LOS_CONFIG_LIST}) # CONFIG maybe: CONFIG_CC_STACKPROTECTOR_STRONG=y @@ -40,6 +44,8 @@ function(KCONFIG_GET_PARAMS KCONFIG_PATH) set(CONFIG_VAR_VAL ${CMAKE_MATCH_1}) if(CONFIG_VAR_VAL MATCHES "^y$") set(${CONFIG_VAR_NAME} ${CONFIG_VAR_VAL} PARENT_SCOPE) + else() + set(${CONFIG_VAR_NAME} ${CONFIG_VAR_VAL} PARENT_SCOPE) endif() endforeach() endfunction() \ No newline at end of file diff --git a/code/sdk/build/cmake/build_linker.cmake b/code/sdk/build/cmake/build_linker.cmake index 21883e566..308506c45 100644 --- a/code/sdk/build/cmake/build_linker.cmake +++ b/code/sdk/build/cmake/build_linker.cmake @@ -56,6 +56,16 @@ if(${ROM_CHECK}) list(APPEND LDS_DEFINES "-DROM_CHECK") endif() +if(${USE_KCONFIG}) +file(STRINGS "${ROOT_DIR}/build/config/target_config/${CHIP}/menuconfig/${CORE}/${BUILD_TARGET_NAME}.config" LOS_CONFIG_LIST ENCODING "UTF-8") +# 过滤掉空行和注释行 +list(FILTER LOS_CONFIG_LIST EXCLUDE REGEX "^[ \t]*$") +list(FILTER LOS_CONFIG_LIST EXCLUDE REGEX "^[ \t]*#") +foreach (CONFIG ${LOS_CONFIG_LIST}) + list(APPEND LDS_DEFINES "-D"${CONFIG}) +endforeach() +endif() + add_custom_command(TARGET ${TARGET_NAME} PRE_BUILD COMMAND ${CMAKE_C_COMPILER} -P -xc -E -o linker.lds @${CMAKE_CURRENT_BINARY_DIR}/linker_header.srp ${LDS_DEFINES} ${LINK_SCRIPT} COMMENT "Generating ${LINK_SCRIPT} -> ${CMAKE_BINARY_DIR}/linker.lds" diff --git a/code/sdk/build/cmake/open_source.cmake b/code/sdk/build/cmake/open_source.cmake index 202c1be8e..f4eec418e 100644 --- a/code/sdk/build/cmake/open_source.cmake +++ b/code/sdk/build/cmake/open_source.cmake @@ -1,2 +1,3 @@ include(${CMAKE_DIR}/open_source/gmssl.cmake) -include(${CMAKE_DIR}/open_source/mbedtls.cmake) \ No newline at end of file +include(${CMAKE_DIR}/open_source/mbedtls.cmake) +include(${CMAKE_DIR}/open_source/libogg.cmake) \ No newline at end of file diff --git a/code/sdk/build/cmake/open_source/libogg.cmake b/code/sdk/build/cmake/open_source/libogg.cmake new file mode 100644 index 000000000..0329abc82 --- /dev/null +++ b/code/sdk/build/cmake/open_source/libogg.cmake @@ -0,0 +1,27 @@ +#=============================================================================== +# @brief cmake file +# Copyright (c) @CompanyNameMagicTag 2025-2025. All rights reserved. +#=============================================================================== +set(COMPONENT_NAME "ogg") +set(LIBOGG_ROOT_DIR ${ROOT_DIR}/open_source/libogg/libogg-1.3.5) + +set(OGG_HEADERS + ${LIBOGG_ROOT_DIR}/include/ogg/ + ${LIBOGG_ROOT_DIR}/include/ +) + +set(OGG_SOURCES + ${LIBOGG_ROOT_DIR}/src/bitwise.c + ${LIBOGG_ROOT_DIR}/src/framing.c + ${LIBOGG_ROOT_DIR}/src/crctable.h +) + +set(SOURCES + ${OGG_SOURCES} +) + +set(PRIVATE_HEADER + ${OGG_HEADERS} +) + +build_component() diff --git a/code/sdk/build/cmake/open_source/mbedtls.cmake b/code/sdk/build/cmake/open_source/mbedtls.cmake index b79e1134f..2a6dc9b14 100644 --- a/code/sdk/build/cmake/open_source/mbedtls.cmake +++ b/code/sdk/build/cmake/open_source/mbedtls.cmake @@ -121,9 +121,16 @@ set(SOURCES ${ROOT_DIR}/open_source/mbedtls/mbedtls_v3.6.0/library/x509write_csr.c ) +if("MBEDTLS_DIAL_SHA256_ALT" IN_LIST DEFINES) +list(APPEND SOURCES + ${ROOT_DIR}/open_source/mbedtls/mbedtls_v3.6.0/harden/src/sha256_harden.c +) +endif() + set(PUBLIC_HEADER ${ROOT_DIR}/open_source/mbedtls/mbedtls_v3.6.0/include ${ROOT_DIR}/open_source/mbedtls/mbedtls_v3.6.0/library + ${ROOT_DIR}/open_source/mbedtls/mbedtls_v3.6.0/harden/src/internal_include ) set(PUBLIC_DEFINES diff --git a/code/sdk/build/config/target_config/brandy/config.py b/code/sdk/build/config/target_config/brandy/config.py index b711eca2f..a0e2ce53b 100644 --- a/code/sdk/build/config/target_config/brandy/config.py +++ b/code/sdk/build/config/target_config/brandy/config.py @@ -42,7 +42,7 @@ target = { 'CONFIG_ZDIAG_AUDIO_PROC_SUPPORT', 'CONFIG_ZDIAG_AUDIO_DUMP_SUPPORT', 'CONFIG_ZDIAG_AUDIO_PROBE_SUPPORT', 'CONFIG_SEA_PHS_SUPPORT', 'CONFIG_DIAG_GPU_PROC_SUPPORT', 'SUPPORT_BLE', 'SUPPORT_BREDR', 'ENABLE_UIKIT', 'SUPPORT_GPU_JPEG', 'SUPPORT_GPU_GMMU', 'SUPPORT_GPU_OPENVG', 'SW_UART_DEBUG', 'SAVE_EXC_INFO', 'HASH_MEM_COPY','MIPI_ULPS_SUPPORT', 'CONFIG_LOW_POWER_TEST', - 'ENABLE_ECC', 'SUPPORT_ALIPAY_SEC', 'SUPPORT_RC_CALIBRATION'], + 'ENABLE_ECC', 'SUPPORT_ALIPAY_SEC', 'SUPPORT_RC_CALIBRATION', 'SUPPORT_LWIP'], 'ram_component': ["algorithm", "dfx_port_brandy", "dfx_update", 'dfx_nv', "osal", "arch_port", "-:testsuite", "liteos_port", 'lcd', 'qspi_display', 'dfx_file_operation', 'psram', 'hal_mipi', 'mipi_tx', 'non_os', 'touch', @@ -50,7 +50,7 @@ target = { 'x_dpal', 'x_vfs', 'x_disk', 'x_fat', 'drv_mmc', 'fs_yaffs2', 'pm_service', 'pm_brandy', 'cmn_header', 'at_cmd', 'graphic_at_service', 'app_at_service', 'audio_at_service', 'media_at_service', 'bt_manager_at_service', - "audio_proc", "audio_dump", "audio_probe", "gpu_proc", 'bts_header'], + "audio_proc", "audio_dump", "audio_probe", "gpu_proc", 'bts_header', 'lwip', 'netstack_http'], 'ram_component_set': ['bgh', 'media', 'gpu', 'graphic_uikit', 'graphic_test', 'bgh_audio', 'dfx_set', 'alipay_set'], 'dsp_version': 'max', 'packet': True, @@ -115,30 +115,48 @@ target = { "-:TARGET_CHIP_BRANDY=1", "-:BRANDY_CHIP_V100=1", 'CFG_DRIVERS_NANDFLASH', 'CONFIG_ZDIAG_NV_SUPPORT', 'CONFIG_ZDIAG_AUDIO_PROC_SUPPORT', 'CONFIG_ZDIAG_AUDIO_DUMP_SUPPORT', 'CONFIG_ZDIAG_AUDIO_PROBE_SUPPORT', 'CONFIG_SEA_PHS_SUPPORT', 'CONFIG_DIAG_GPU_PROC_SUPPORT', 'SUPPORT_BLE', 'SUPPORT_BREDR', 'ENABLE_UIKIT', 'SUPPORT_GPU_JPEG', 'SUPPORT_GPU_GMMU', 'SUPPORT_GPU_OPENVG', - 'SW_UART_DEBUG', 'SAVE_EXC_INFO', 'HASH_MEM_COPY', 'JS_ENABLE', 'CONFIG_LOW_POWER_TEST', 'SUPPORT_OHOSFWK', - 'ENABLE_ECC', 'MIPI_ULPS_SUPPORT', 'SUPPORT_ALIPAY_SEC', 'SUPPORT_RC_CALIBRATION'], + 'SW_UART_DEBUG', 'SAVE_EXC_INFO', 'JS_ENABLE', 'CONFIG_LOW_POWER_TEST', 'SUPPORT_OHOSFWK', "HASH_MEM_COPY", + 'ENABLE_ECC', 'MIPI_ULPS_SUPPORT', 'SUPPORT_ALIPAY_SEC', 'SUPPORT_RC_CALIBRATION', + 'SUPPORT_DIAL_DEBUG', 'SUPPORT_LWIP', 'CONFIG_BRANDY_BLE_TRANS_OPTIMIZE', 'MBEDTLS_NO_PLATFORM_ENTROPY', + 'MBEDTLS_ENTROPY_HARDWARE_ALT', 'MARKET_ENABLE'], 'ram_component': ["algorithm", "dfx_port_brandy", "dfx_update", 'dfx_nv', "osal", "arch_port", "-:testsuite", "liteos_port", 'lcd', 'qspi_display', 'dfx_file_operation', 'psram', 'hal_mipi', 'mipi_tx', 'non_os', 'touch', 'ulp_aon', 'hal_l2ram', 'bt_manager_at_service', - 'x_dpal', 'x_vfs', 'x_disk', 'x_fat', 'drv_mmc', 'fs_yaffs2', 'x_vfs_private', + 'x_dpal', 'x_vfs', 'x_disk', 'x_fat', 'drv_mmc', 'fs_yaffs2', 'x_vfs_private', "cipher_static", 'pm_service', 'pm_brandy', 'cmn_header', 'at_cmd', 'graphic_at_service', 'app_at_service', 'ohosfwk_at_service', - "audio_proc", "audio_dump", "audio_probe", "power_manager", "gpu_proc",'bts_header', 'lwip'], + "audio_proc", "audio_dump", "audio_probe", "power_manager", "gpu_proc",'bts_header','lwip', + 'ace_kit_cipher_static'], 'ram_component_set': ['bgh', 'media', 'gpu', 'graphic_uikit', 'bgh_audio', 'dfx_set', 'ohos_set', 'wearable_set', 'alipay_set', 'msg_center_service'], + # 如果没有定义ssb_version,默认使用brandy-ssb + 'ssb_version': 'brandy-ssb-native-js', 'dsp_version': 'max', - 'packet': True - # 'fs_image': False + 'packet': True, + 'fs_image': False + }, + #native-js-user: liteos + uikit + nandflash + mipi + psram + audio 典型合封UIKIT版本 + #离线日志版本 + #删除reg/mem dump,写法如下:'-:DUMP_MEM_SUPPORT', '-:DUMP_REG_SUPPORT', '-:SUPPORT_DFX_EXCEPTION' + 'brandy-native-js-user': { + 'base_target_name': 'brandy-native-js', + 'defines': ['-:SW_UART_DEBUG', '-:DUMP_MEM_SUPPORT', '-:DUMP_REG_SUPPORT', '-:SUPPORT_DFX_EXCEPTION'], + # 如果没有定义ssb_version,默认使用brandy-ssb + 'ssb_version': 'brandy-ssb-native-js', }, #auto-ota-server 'brandy-auto-ota-ser': { 'base_target_name': 'brandy-native-js', 'defines': ['SUPPORT_AUTO_OTA_SERVER', 'CONFIG_DFX_SUPPORT_DIAG_UP_MACHINE=1'], + # 如果没有定义ssb_version,默认使用brandy-ssb + 'ssb_version': 'brandy-ssb-native-js', }, #auto-ota-client 'brandy-auto-ota-cli': { 'base_target_name': 'brandy-native-js', 'defines': ['SUPPORT_AUTO_OTA_SERVER', 'SUPPORT_AUTO_OTA', 'CONFIG_DFX_SUPPORT_DIAG_UP_MACHINE=1'], - 'ram_component': ['auto_ota'] + 'ram_component': ['auto_ota'], + # 如果没有定义ssb_version,默认使用brandy-ssb + 'ssb_version': 'brandy-ssb-native-js', }, #native-xts: liteos + uikit + nandflash + mipi + psram + audio 典型合封UIKIT版本 'brandy-xts': { @@ -149,19 +167,22 @@ target = { "-:TARGET_CHIP_BRANDY=1", "-:BRANDY_CHIP_V100=1", 'CFG_DRIVERS_NANDFLASH', 'CONFIG_ZDIAG_NV_SUPPORT', 'CONFIG_ZDIAG_AUDIO_PROC_SUPPORT', 'CONFIG_ZDIAG_AUDIO_DUMP_SUPPORT', 'CONFIG_ZDIAG_AUDIO_PROBE_SUPPORT', 'CONFIG_SEA_PHS_SUPPORT', 'SUPPORT_BLE', 'SUPPORT_BREDR', 'ENABLE_UIKIT', 'SUPPORT_GPU_JPEG', 'SUPPORT_GPU_GMMU', 'SUPPORT_GPU_OPENVG', 'CONFIG_DIAG_GPU_PROC_SUPPORT', - 'SW_UART_DEBUG', 'SAVE_EXC_INFO', 'HASH_MEM_COPY', 'JS_ENABLE', 'CONFIG_LOW_POWER_TEST', 'SUPPORT_OHOSFWK', - 'ENABLE_ECC', 'XTS_SUPPORT', 'SUPPORT_ALIPAY_SEC','SUPPORT_RC_CALIBRATION'], + 'SW_UART_DEBUG', 'SAVE_EXC_INFO', "HASH_MEM_COPY", 'JS_ENABLE', 'CONFIG_LOW_POWER_TEST', 'SUPPORT_OHOSFWK', + 'ENABLE_ECC', 'XTS_SUPPORT', 'SUPPORT_ALIPAY_SEC', 'SUPPORT_RC_CALIBRATION', 'MBEDTLS_NO_PLATFORM_ENTROPY', + 'MBEDTLS_ENTROPY_HARDWARE_ALT', 'MARKET_ENABLE'], 'ram_component': ["algorithm", "dfx_port_brandy", "dfx_update", 'dfx_nv', "osal", "arch_port", "-:testsuite", "liteos_port", 'lcd', 'qspi_display', 'dfx_file_operation', 'psram', 'hal_mipi', 'mipi_tx', 'non_os', 'touch', 'ulp_aon', 'hal_l2ram', 'x_dpal', 'x_vfs', 'x_disk', 'x_fat', 'drv_mmc', 'fs_yaffs2', 'x_vfs_private', 'pm_service', 'pm_brandy', 'cmn_header', 'at_cmd', 'graphic_at_service', 'app_at_service', 'ohosfwk_at_service', - "audio_proc", "audio_dump", "audio_probe", "power_manager", "gpu_proc", 'bts_header'], + "audio_proc", "audio_dump", "audio_probe", "power_manager", "gpu_proc", 'bts_header', 'lwip'], 'ram_component_set': ['bgh', 'media', 'gpu', 'graphic_uikit', 'bgh_audio', 'dfx_set', 'ohos_set', 'wearable_set', 'xts_set', 'xts_test_set', 'alipay_set', 'msg_center_service'], + # 如果没有定义ssb_version,默认使用brandy-ssb + 'ssb_version': 'brandy-ssb-xts', 'dsp_version': 'max', 'packet': True, - # 'fs_image': False + 'fs_image': False }, 'brandy-target1-r': { @@ -226,7 +247,8 @@ target = { 'defines': ['PRE_ASIC', 'BRANDY_PRODUCT_EVB4', 'VERSION_STANDARD', '__LITEOS__', '_ALL_SOURCE', 'SUPPORT_CXX', 'I2C_SLAVE_REG_ADDR_4BYTE', 'CFG_DRIVERS_NANDFLASH', "-:TARGET_CHIP_BRANDY=1", "-:BRANDY_CHIP_V100=1", 'ENABLE_UIKIT', 'SW_UART_DEBUG', "HASH_MEM_COPY", - 'ENABLE_ECC', 'SUPPORT_RECOVERY_DISPLAY'], + 'ENABLE_ECC', 'SUPPORT_RECOVERY_DISPLAY', + 'MBEDTLS_NO_PLATFORM_ENTROPY', 'MBEDTLS_ENTROPY_HARDWARE_ALT', 'MARKET_ENABLE'], 'ram_component': ["algorithm", "dfx_port_brandy", "dfx_update", "osal", "arch_port", "-:testsuite", "liteos_port", 'lcd', 'qspi_display', 'dfx_file_operation', 'psram', 'hal_mipi', 'mipi_tx', 'non_os', 'touch', @@ -240,7 +262,7 @@ target = { 'defines': ['PRE_ASIC', 'BRANDY_PRODUCT_EVB4', 'VERSION_STANDARD', '__LITEOS__', '_ALL_SOURCE', 'SUPPORT_CXX', 'I2C_SLAVE_REG_ADDR_4BYTE', 'CFG_DRIVERS_NANDFLASH', "-:TARGET_CHIP_BRANDY=1", "-:BRANDY_CHIP_V100=1", 'ENABLE_UIKIT', 'SW_UART_DEBUG', "HASH_MEM_COPY", - 'ENABLE_ECC'], + 'ENABLE_ECC', 'MBEDTLS_NO_PLATFORM_ENTROPY', 'MBEDTLS_ENTROPY_HARDWARE_ALT', 'MARKET_ENABLE'], 'ram_component': ["algorithm", "dfx_port_brandy", "dfx_update", "osal", "arch_port", "-:testsuite", "liteos_port", 'lcd', 'qspi_display', 'dfx_file_operation', 'psram', 'hal_mipi', 'mipi_tx', 'non_os', 'touch', @@ -284,6 +306,12 @@ target = { 'ram_component_set': ['pinctrl'], 'target': 'ssb', }, + 'brandy-ssb-native-js': { + 'base_target_name': 'brandy-ssb', + }, + 'brandy-ssb-xts': { + 'base_target_name': 'brandy-ssb', + }, 'brandy-native-js-ssb': { 'base_target_name': 'brandy-ssb', #自定义配置项,选择硬件及功能参数 @@ -904,14 +932,15 @@ target_group = { 'pack_brandy_target3': ['brandy-ssb', 'brandy-target3-r', 'brandy-target3'], 'pack_brandy_target4': ['brandy-ssb', 'brandy-target4-r', 'brandy-target4'], 'pack_brandy_target5': ['brandy-ssb', 'brandy-target5-r', 'brandy-target5'], - 'pack_brandy_native_js': ['brandy-native-js-ssb', 'brandy-native-js-r', 'brandy-native-js'], + 'pack_brandy_native_js': ['brandy-ssb-native-js', 'brandy-native-js-r', 'brandy-native-js'], + 'pack_brandy_native_js_user': ['brandy-ssb-native-js', 'brandy-native-js-r', 'brandy-native-js-user'], + 'pack_brandy_xts': ['brandy-ssb-xts', 'brandy-xts-r', 'brandy-xts'], + 'pack_brandy_auto_ota_ser': ['brandy-ssb-native-js', 'brandy-auto-ota-ser'], + 'pack_brandy_auto_ota_cli': ['brandy-ssb-native-js', 'brandy-auto-ota-cli'], 'pack_brandy_native_js_fd230': ['brandy-native-js-fd230-ssb', 'brandy-native-js-fd230-r', 'brandy-native-js-fd230'], 'pack_brandy_native_js_u8': ['brandy-native-js-u8-ssb', 'brandy-native-js-u8-r', 'brandy-native-js-u8'], 'pack_brandy_native_js_w9': ['brandy-native-js-w9-ssb', 'brandy-native-js-w9-r', 'brandy-native-js-w9'], 'pack_brandy_native_js_lt22': ['brandy-native-js-lt22-ssb', 'brandy-native-js-lt22-r', 'brandy-native-js-lt22'], - 'pack_brandy_native_js_user': ['brandy-native-js-user-ssb', 'brandy-native-js-user-r', 'brandy-native-js-user'], - 'pack_brandy_xts': ['brandy-ssb', 'brandy-xts-r', 'brandy-xts'], - 'pack_brandy_native_js_xts': ['brandy-native-js-xts-ssb', 'brandy-native-js-xts-r', 'brandy-native-js-xts'], 'brandy_all': ['brandy-ssb', diff --git a/code/sdk/build/config/target_config/brandy/target_config.py b/code/sdk/build/config/target_config/brandy/target_config.py index ca6cb0014..4bb7873cf 100644 --- a/code/sdk/build/config/target_config/brandy/target_config.py +++ b/code/sdk/build/config/target_config/brandy/target_config.py @@ -59,7 +59,7 @@ target_template = { 'defines_set': ['chip_defines', 'version_defines'], 'ram_component': ['brandy_std_lds', 'liteos_207_1_0', 'partition', 'chip_brandy', 'driver_header', 'nand_flash', 'brandy_app_standard', 'board_brandy', 'brandy_clocks', 'pmu_brandy', 'hal_sectors', - 'partition_brandy', 'nv', 'nv_brandy', 'mtd_com', 'segger', 'mbedtls'], + 'partition_brandy', 'nv', 'nv_brandy', 'mtd_com', 'segger', 'mbedtls', 'drv_hitls'], 'ram_component_set': ['std_common_lib', 'mem', 'cpu', 'lpc', 'audio', 'xip_os', 'adc', 'ipc', 'spi', 'dma', 'i2c', 'pwm', 'watchdog', 'uart', 'otp', 'gpio_v100', 'qspi', 'cpu_trace', 'time_set', 'security', 'efuse_v100', @@ -100,7 +100,7 @@ target_template = { 'ram_component': ['brandy_std_lds', 'chip_brandy', 'brandy_app_standard', 'driver_header', 'board_brandy', 'brandy_clocks', 'pmu_brandy', 'c', 'm', 'segger', 'posix', 'sec', 'freertos', 'cmsis_rtos', 'csysdeps', 'xlt_mem', 'x_dpal', 'nand_flash', 'x_vfs', 'x_disk', - 'nv', 'nv_brandy', 'hal_sectors', 'mtd_com', 'mbedtls', 'freertos_debug'], + 'nv', 'nv_brandy', 'hal_sectors', 'mtd_com', 'mbedtls', 'freertos_debug', 'drv_hitls'], 'ram_component_set': ['std_common_lib', 'mem', 'cpu', 'lpc', 'audio', 'xip_os', 'adc', 'ipc', 'spi', 'dma', 'i2c', 'pwm', 'watchdog', 'uart', 'otp', 'gpio_v100', 'qspi', 'cpu_trace', 'time_set', 'security', 'efuse_v100', @@ -220,7 +220,7 @@ target_template = { 'ram_component': ['brandy_std_lds', 'liteos_207_1_0', 'chip_brandy', 'driver_header', 'nand_flash', 'brandy_testsuite', 'board_brandy', 'brandy_clocks', 'pmu_brandy', 'hal_sectors', 'test_flash', 'test_update', 'partition', 'partition_brandy', 'test_partition', 'test_nv', - 'nv', 'nv_brandy', 'testsuite', 'test_spi', 'fs_yaffs2', 'mtd_com', 'mbedtls', 'segger'], + 'nv', 'nv_brandy', 'testsuite', 'test_spi', 'fs_yaffs2', 'mtd_com', 'mbedtls', 'segger', 'drv_hitls'], 'ram_component_set': ['std_common_lib', 'mem', 'cpu', 'lpc', 'xip_os', 'adc', 'ipc', 'spi', 'dma', 'i2c', 'pwm', 'watchdog', 'uart', 'otp', 'gpu', 'gpu_test', 'gpio_v100', 'qspi', 'cpu_trace', 'time_set', 'efuse_v100', diff --git a/code/sdk/build/config/target_config/common_config.py b/code/sdk/build/config/target_config/common_config.py index 80b367632..21db45000 100644 --- a/code/sdk/build/config/target_config/common_config.py +++ b/code/sdk/build/config/target_config/common_config.py @@ -74,14 +74,14 @@ component_set = { 'media_sample_wrapper', 'player', 'media_common', 'audio_bluetooth_port', 'audio_hw', 'audio_primary_port','format_hw', 'hmf_demuxer', 'media_hal_common', 'plugin_demuxer_hmf', 'plugin_demuxer_mjpeg', 'plugin_protocol_https', 'audio_port_common', 'codec_hw', 'codec_plugin_vdec', - 'camera_codec_hw', 'hdi_camera_intf', 'plugin_demuxer_raw', 'audio_modem_port', 'audio_decrypt'], + 'camera_codec_hw', 'hdi_camera_intf', 'plugin_demuxer_raw', 'audio_modem_port', 'audio_decrypt', 'ogg'], 'media_melody': ['audio_manager', 'audio_service', 'audio_stream', 'audio_utils', 'media_common', 'audio_bluetooth_port', 'audio_hw', 'audio_primary_port', 'media_hal_common', 'audio_port_common', 'haid_manager', 'tone_player', 'tws_manager'], 'media_mini': ['audio_capture', 'audio_manager', 'audio_service', 'audio_stream', 'audio_utils', 'media_sample_wrapper', 'player', 'media_common', 'audio_bluetooth_port', 'audio_hw', 'audio_primary_port','format_hw', 'hmf_demuxer', 'media_hal_common', 'plugin_demuxer_hmf', - 'plugin_demuxer_mjpeg', 'plugin_protocol_https', 'audio_port_common', 'plugin_demuxer_raw'], + 'plugin_demuxer_mjpeg', 'plugin_protocol_https', 'audio_port_common', 'plugin_demuxer_raw', 'ogg'], 'media_target4': ['audio_manager', 'audio_service', 'audio_stream', 'audio_utils', 'media_common', 'audio_hw', 'audio_primary_port', 'audio_bluetooth_port', 'audio_modem_port', 'media_hal_common', 'audio_port_common', 'media_sample_wrapper', 'audio_decrypt'], @@ -116,7 +116,7 @@ component_set = { 'efuse_v120': ['efuse', 'hal_efuse_v120', 'efuse_porting'], 'efuse_v100': ['efuse', 'hal_efuse_v100', 'efuse_porting'], 'efuse_v130': ['efuse', 'hal_efuse_v130', 'efuse_port'], - 'ohos_set' : ['bootstrap', 'samgr', 'ams', 'bms', 'bms_sign_mode', 'ace', 'ace_adapt', 'permission', 'appverify', 'jerryscript','js_player', 'js_audio_capturer', 'baidumapcomponent', 'brightness', 'i18n', + 'ohos_set' : ['bootstrap', 'samgr', 'ams', 'bms', 'bms_sign_mode', 'ace', 'ace_adapt', 'permission', 'appverify', 'jerryscript','js_player', 'js_audio_capturer', 'baidumapcomponent', 'brightness', 'ace_http', 'ace_websocket', 'i18n', 'netstack_http', 'websocket', 'resmgr', 'syspara', 'utils_kv_store', 'native_file', 'storage_jsapi', 'svr_dynload', 'location_common', 'location_utils', 'locator_sdk', 'location_locator', 'location_gnss', 'location_gnss_hdi', 'location_gnss_utils', 'location_gnss_emulator', 'location_sample', 'sensor_client', 'sensor_service', 'sensor_hdi', 'sensor_sample'], 'wearable_set' : ['nativeabilityfwk', 'nativelauncher', 'ai_voice_service', 'ai_voice_engine_hal', 'ai_voice_audio_stream_wrapper', 'ohos_deps', @@ -132,7 +132,8 @@ component_set = { "fwk_device_certificate_rv70_llvm", "fwk_network_rv70_llvm", "fwk_sm2_rv70_llvm", "fwk_quickjs_adapt_rv70_llvm", "fwk_js_api_rv70_llvm", "3rdparty_mbedtls_rv70_llvm", "3rdparty_uEcc_rv70_llvm", "3rdparty_sm3_rv70_llvm", "3rdparty_cJSON_rv70_llvm", "3rdparty_protobuf-c_rv70_llvm", "quickjs", "app_antchain_rv70_llvm", "app_provision_rv70_llvm", "alipay_antchain", "fwk_storage_rv70_llvm", "fwk_crypt_ext_rv70_llvm"], - 'msg_center_service' : ['xiaodu_navi', 'xiaodu_voice', 'xiaodu_navi_vector', 'hc_demo_msg', 'auto_ota_msg', 'alipay_msg', 'app_store_msg'] + 'msg_center_service' : ['xiaodu_navi', 'xiaodu_voice', 'xiaodu_navi_vector', 'hc_demo_msg', 'auto_ota_msg', 'alipay_msg', 'app_store_msg', + 'dial_market', 'device_msg', 'remote_msg'] } defines_set = { diff --git a/code/sdk/build/script/cmake_builder.py b/code/sdk/build/script/cmake_builder.py index 26326bcfa..21273aaf9 100644 --- a/code/sdk/build/script/cmake_builder.py +++ b/code/sdk/build/script/cmake_builder.py @@ -14,7 +14,7 @@ from pack_tool import packTool from sdk_generator.sdk_generator import SdkGenerator from rom_ram_callback.gen_rom_ram_callback import gen_rom_ram_callback from rom_ram_callback.strip_undef_symbols import strip_undefined_symbols -from usr_config import mconfig +from usr_config import mconfig, save_kconfig_env from custom_cmd import run_custom_cmd from target_config.common_config import CommonConfig @@ -182,11 +182,11 @@ class CMakeBuilder(BuildEnvironment): print("copy file.bin to application dir over!\n") if env.get('packet'): - defines = env.get("defines") - if "CFG_FLASH_SIZE=16" in defines: + if env.get('CONFIG_NORFLASH_SIZE') == '16': self.pack_fwpkg(env.get('chip'), target, "0x1000000") else: - if "CFG_LOAD_FROM_FS" in defines: + defines = env.get("defines") + if env.get('CONFIG_LOAD_FROM_FS'): self.pack_fwpkg(env.get('chip'), target, "0x800000", "True") else: self.pack_fwpkg(env.get('chip'), target, "0x800000") @@ -320,6 +320,7 @@ class CMakeBuilder(BuildEnvironment): if os.path.exists(mconfig_file_path): menuconfig_argv = ["", "savemenuconfig", chip, core, target_name, output_path] mconfig(menuconfig_argv) + save_kconfig_env(env, mconfig_file_path) os.chdir(output_path) log_file_name = "build_%s.log" % target_name diff --git a/code/sdk/build/script/enviroment.py b/code/sdk/build/script/enviroment.py index b306a1a10..c6a5c9ac5 100644 --- a/code/sdk/build/script/enviroment.py +++ b/code/sdk/build/script/enviroment.py @@ -81,6 +81,12 @@ class TargetEnvironment: self.config["build_platform"] = get_platform_name() self.config['target_command'] = target_name + if org_target.get('dsp_version') != None: + self.config['dsp_version'] = org_target.get('dsp_version') + if org_target.get('ssb_version') != None: + self.config['ssb_version'] = org_target.get('ssb_version') + else: + self.config['ssb_version'] = 'brandy-ssb' def merge_target_config(self, target_name, extra_defines): """ 将target_name对应的diff配置同diff配置中base_target_name对应的template配置合并 diff --git a/code/sdk/build/script/sdk_generator/sdk_generator.py b/code/sdk/build/script/sdk_generator/sdk_generator.py index d1766c222..50510a1f8 100644 --- a/code/sdk/build/script/sdk_generator/sdk_generator.py +++ b/code/sdk/build/script/sdk_generator/sdk_generator.py @@ -107,6 +107,7 @@ class SdkGenerator: if os.path.exists(os.path.join(root_path, 'build', 'config', 'target_config', chip, 'menuconfig')): self.copy_srcs([os.path.join(root_path, 'build', 'config', 'target_config', chip, 'menuconfig')]) self.copy_srcs([os.path.join(root_path, 'config.in')]) + self.copy_srcs([os.path.join(root_path, 'product')]) def copy_kconfig(self, cmake_trace_file): depend_cmake_files = self.parse_depend_cmake_files(cmake_trace_file) @@ -124,8 +125,8 @@ class SdkGenerator: if not os.path.exists(path): sdk_copy_common_files.remove(path) self.copy_srcs(sdk_copy_common_files) + self.copy_menuconfig() if self.env.get('use_memuconfig') != False: - self.copy_menuconfig() self.copy_kconfig(cmake_trace_file) if self.env.get('auto_gen_config'): self.genarate_sdk_target_config(self.env.get('pkg_target_name', False)) diff --git a/code/sdk/build/script/usr_config.py b/code/sdk/build/script/usr_config.py index 9e0e4f7ea..4e95c95c4 100644 --- a/code/sdk/build/script/usr_config.py +++ b/code/sdk/build/script/usr_config.py @@ -3,9 +3,20 @@ # Copyright (c) @CompanyNameMagicTag 2023-2023. All rights reserved. import os, sys +import re from kconfiglib import Kconfig from menuconfig import menuconfig +def save_kconfig_env(env, mconfig_file): + with open(mconfig_file, 'r') as file: + for line in file: + line = line.strip() + if line and not line.startswith('#'): + match = re.match(r'(\w+)\s*=\s*(.+)', line) + if match: + key, value = match.groups() + env.add(key, value) + def mconf_set_env(style, conf, config_header, autoheader_header, output_path = None): """ Set Kconfig Env