| # Copyright (c) 2021 Project CHIP Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//args.gni") |
| import("//build_overrides/bouffalolab_iot_sdk.gni") |
| import("//build_overrides/chip.gni") |
| import("//build_overrides/mbedtls.gni") |
| import("//build_overrides/openthread.gni") |
| import("${chip_root}/src/lib/lib.gni") |
| import("bl702_board.gni") |
| |
| import("${mbedtls_root}/mbedtls.gni") |
| |
| declare_args() { |
| # Location of the bl702 SDK. |
| bl702_sdk_root = "${chip_root}/third_party/bouffalolab/repo" |
| |
| enable_zigbee = false |
| |
| enable_cdc_module = false |
| } |
| |
| assert(bl702_sdk_root != "", "bl702_sdk_root must be specified") |
| |
| # Defines an bl702 SDK build target. |
| # |
| # Parameters: |
| # bl702_sdk_root - The location of the bl702 SDK. |
| # sources - The sources files to build. |
| template("bl702_sdk") { |
| sdk_target_name = target_name |
| |
| if (defined(invoker.bl702_sdk_root)) { |
| bl702_sdk_root = invoker.bl702_sdk_root |
| } |
| |
| if (defined(invoker.enable_zigbee)) { |
| enable_zigbee = invoker.enable_zigbee |
| } |
| |
| if (defined(invoker.enable_cdc_module)) { |
| enable_cdc_module = invoker.enable_cdc_module |
| } |
| |
| config("${sdk_target_name}_config") { |
| include_dirs = [] |
| if (defined(invoker.include_dirs)) { |
| include_dirs += invoker.include_dirs |
| } |
| |
| defines = [ |
| "CONFIG_RENDEZVOUS_MODE=2", |
| "CONFIG_ENABLE_PW_RPC=0", |
| "__FILENAME__=strrchr(__FILE__,'/')?strrchr(__FILE__,'/')+1:__FILE__", |
| "OT_FREERTOS_ENABLE=1", |
| "INCLUDE_xSemaphoreGetMutexHolder=1", |
| ] |
| |
| if (defined(invoker.defines)) { |
| defines += invoker.defines |
| } |
| } |
| |
| config("${sdk_target_name}_plat_config") { |
| _include_dirs = [ |
| "${bl702_sdk_root}", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/config", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/portable/GCC/RISC-V", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/portable/GCC/RISC-V/chip_specific_extensions/RV32F_float_abi_single", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/panic", |
| |
| "${bl702_sdk_root}/components/sys/blmtd/include", |
| "${bl702_sdk_root}/components/utils/include/", |
| |
| "${bl702_sdk_root}/components/stage/yloop/include", |
| "${bl702_sdk_root}/components/stage/blfdt/inc", |
| "${bl702_sdk_root}/components/stage/blog/", |
| "${bl702_sdk_root}/components/stage/cli/cli/include", |
| "${bl702_sdk_root}/components/stage/coredump/inc", |
| "${bl702_sdk_root}/components/stage/easyflash4/inc", |
| |
| "${bl702_sdk_root}/components/fs/vfs/include", |
| |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Board", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/risc-v/Core/Include", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/regs", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/startup", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/inc", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/soft_crc", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/misc", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/ring_buffer", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/device", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/list", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/memheap", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Common/platform", |
| |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/include", |
| "${bl702_sdk_root}/components/platform/hosal/include", |
| "${bl702_sdk_root}/components/platform/hosal/sec_common", |
| ] |
| |
| defines = [ |
| "ARCH_RISCV", |
| "bl706_iot=1", |
| ] |
| |
| defines += board_defines |
| |
| cflags = [] |
| cflags_c = [] |
| if (defined(invoker.freertos_config)) { |
| cflags_c += [ |
| "-include", |
| rebase_path("${invoker.freertos_config}", root_build_dir), |
| ] |
| } |
| |
| foreach(include_dir, _include_dirs) { |
| cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] |
| } |
| |
| if (defined(invoker.defines)) { |
| defines += invoker.defines |
| } |
| } |
| |
| source_set("${sdk_target_name}_drv") { |
| defines = [ |
| "BFLB_USE_ROM_DRIVER=1", |
| "BFLB_USE_HAL_DRIVER=1", |
| "CFG_USE_XTAL32K=1", |
| "CFG_BLE_ENABLE=1", |
| "BL702", |
| ] |
| |
| include_dirs = |
| [ "${bl702_sdk_root}/components/network/ble/blecontroller/ble_inc/" ] |
| |
| sources = [ |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_adc.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_boot2.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_chip.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_cks.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_dma.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_efuse.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_flash.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_gpio.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_hbn.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_irq.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_pds.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_psram.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_pwm.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_rtc.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_sec.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_sys.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_timer.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_uart.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_wdt.c", |
| |
| # "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_sec_aes.c", |
| # "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_sec_sha.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_wireless.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hal_board.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hal_boot2.c", |
| |
| # "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hal_tcal.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hal_button.c", |
| |
| # "${bl702_sdk_root}/components/platform/hosal/bl702_hal/bl_emac.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hal_gpio.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hal_hbn.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hal_hwtimer.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hal_pds.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hal_sys.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_adc.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_dac.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_dma.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_flash.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_gpio.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_i2c.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_ota.c", |
| |
| # "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_spi.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_pwm.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_rng.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_rtc.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_timer.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_uart.c", |
| "${bl702_sdk_root}/components/platform/hosal/bl702_hal/hosal_wdg.c", |
| |
| #"${bl702_sdk_root}/components/platform/hosal/bl702_hal/hal_uart.c", |
| ] |
| |
| sources += [ |
| "${bl702_sdk_root}/components/platform/hosal/sec_common/bl_sec_aes.c", |
| "${bl702_sdk_root}/components/platform/hosal/sec_common/bl_sec_pka.c", |
| |
| #"${bl702_sdk_root}/components/platform/hosal/sec_common/bl_sec_sha.c", |
| ] |
| |
| libs = [ "${bl702_sdk_root}/components/platform/soc/bl702/bl702_rf/lib/libbl702_rf.a" ] |
| |
| cflags_c = [ |
| "-Wno-unused-variable", |
| "-Wno-enum-conversion", |
| "-Wno-sign-compare", |
| "-Wno-old-style-declaration", |
| "-Wno-stringop-overflow", |
| "-Wno-format-truncation", |
| ] |
| |
| public_configs = [ |
| ":${sdk_target_name}_config", |
| ":${sdk_target_name}_plat_config", |
| ] |
| } |
| |
| source_set("${sdk_target_name}_app") { |
| sources = [] |
| if (defined(invoker.sources)) { |
| sources += invoker.sources |
| } |
| |
| public_configs = [ |
| ":${sdk_target_name}_config", |
| ":${sdk_target_name}_plat_config", |
| ] |
| } |
| |
| source_set("${sdk_target_name}_cdc") { |
| include_dirs = [ |
| "${bl702_sdk_root}/components/fs/vfs/include", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Inc", |
| ] |
| |
| defines = [ |
| "BFLB_USE_ROM_DRIVER=1", |
| "BFLB_USE_HAL_DRIVER=1", |
| ] |
| |
| sources = [ |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Src/bl702_hal_pcd.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Src/bl702_usb_cdc.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Src/usb_device.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Src/usbd_cdc.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Src/usbd_cdc_if.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Src/usbd_conf.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Src/usbd_core.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Src/usbd_ctlreq.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Src/usbd_desc.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_usb_cdc/Src/usbd_ioreq.c", |
| ] |
| |
| cflags_c = [ "-Wno-sign-compare" ] |
| |
| public_configs = [ |
| ":${sdk_target_name}_config", |
| ":${sdk_target_name}_plat_config", |
| ] |
| } |
| |
| source_set("${sdk_target_name}_bflb_platform") { |
| defines = [ |
| "BFLB_USE_ROM_DRIVER=1", |
| "BFLB_USE_HAL_DRIVER=1", |
| ] |
| |
| include_dirs = [ "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/hal_drv/inc" ] |
| |
| sources = [ |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_acomp.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_adc.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_aon.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_cam.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_clock.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_common.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_dac.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_dma.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_ef_ctrl.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_glb.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_hbn.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_i2c.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_i2s.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_ir.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_l1c.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_mjpeg.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_pds.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_psram.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_pwm.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_qdec.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_romapi.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_sec_dbg.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_sec_eng.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_sf_cfg.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_sf_cfg_ext.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_sf_ctrl.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_sflash.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_sflash_ext.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_spi.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_timer.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_uart.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_usb.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_xip_sflash.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_xip_sflash_ext.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/misc/misc.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/ring_buffer/ring_buffer.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/soft_crc/softcrc.c", |
| ] |
| public_configs = [ |
| ":${sdk_target_name}_config", |
| ":${sdk_target_name}_plat_config", |
| ] |
| cflags_c = [ |
| "-Wno-sign-compare", |
| "-Wno-unused-variable", |
| ] |
| } |
| |
| source_set("${sdk_target_name}_plat") { |
| defines = [ |
| "portasmHANDLE_INTERRUPT=interrupt_entry", |
| "CFG_CPP_ENABLE=1", |
| "BL_SDK_VER=\"1.0\"", |
| "BFLB_USE_ROM_DRIVER=1", |
| "BFLB_USE_HAL_DRIVER=1", |
| ] |
| |
| sources = [ |
| "${bl702_sdk_root}/components/libc/newlibc/assert.c", |
| "${bl702_sdk_root}/components/libc/newlibc/stdatomic.c", |
| "${bl702_sdk_root}/components/libc/newlibc/syscalls.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702/evb/src/boot/gcc/start.S", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702/evb/src/debug.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702/evb/src/strntoumax.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702/evb/src/vprint.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/event_groups.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/list.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/misaligned/fp_asm.S", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/misaligned/misaligned_ldst.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/panic/panic_c.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/portable/GCC/RISC-V/port.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/portable/GCC/RISC-V/portASM.S", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/portable/MemMang/heap_5.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/portable/MemMang/heap_5_psram.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/queue.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/stream_buffer.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/tasks.c", |
| "${bl702_sdk_root}/components/platform/soc/bl702/bl702_freertos/timers.c", |
| "${bl702_sdk_root}/components/stage/blfdt/src/fdt.c", |
| "${bl702_sdk_root}/components/stage/blfdt/src/fdt_addresses.c", |
| "${bl702_sdk_root}/components/stage/blfdt/src/fdt_empty_tree.c", |
| "${bl702_sdk_root}/components/stage/blfdt/src/fdt_overlay.c", |
| "${bl702_sdk_root}/components/stage/blfdt/src/fdt_ro.c", |
| "${bl702_sdk_root}/components/stage/blfdt/src/fdt_rw.c", |
| "${bl702_sdk_root}/components/stage/blfdt/src/fdt_strerror.c", |
| "${bl702_sdk_root}/components/stage/blfdt/src/fdt_sw.c", |
| "${bl702_sdk_root}/components/stage/blfdt/src/fdt_wip.c", |
| "${bl702_sdk_root}/components/stage/blog/blog.c", |
| "${bl702_sdk_root}/components/stage/easyflash4/src/easyflash.c", |
| "${bl702_sdk_root}/components/stage/easyflash4/src/ef_env.c", |
| "${bl702_sdk_root}/components/stage/easyflash4/src/ef_port.c", |
| "${bl702_sdk_root}/components/stage/easyflash4/src/ef_utils.c", |
| "${bl702_sdk_root}/components/sys/blmtd/bl_mtd.c", |
| "${bl702_sdk_root}/components/utils/src/utils_list.c", |
| "${bl702_sdk_root}/components/utils/src/utils_log.c", |
| "${bl702_sdk_root}/components/utils/src/utils_string.c", |
| ] |
| |
| cflags_c = [ |
| "-Wno-old-style-declaration", |
| "-Wno-enum-conversion", |
| "-Wno-sign-compare", |
| ] |
| cflags_c += [ |
| "-Wno-builtin-declaration-mismatch", |
| "-Wno-format-truncation", |
| ] |
| |
| sources += [ |
| "${bl702_sdk_root}/components/fs/vfs/device/vfs_adc.c", |
| "${bl702_sdk_root}/components/fs/vfs/device/vfs_gpio.c", |
| "${bl702_sdk_root}/components/fs/vfs/device/vfs_pwm.c", |
| "${bl702_sdk_root}/components/fs/vfs/device/vfs_spi.c", |
| "${bl702_sdk_root}/components/fs/vfs/device/vfs_uart.c", |
| "${bl702_sdk_root}/components/fs/vfs/src/vfs.c", |
| "${bl702_sdk_root}/components/fs/vfs/src/vfs_file.c", |
| "${bl702_sdk_root}/components/fs/vfs/src/vfs_inode.c", |
| "${bl702_sdk_root}/components/fs/vfs/src/vfs_register.c", |
| "${bl702_sdk_root}/components/stage/yloop/src/aos_freertos.c", |
| "${bl702_sdk_root}/components/stage/yloop/src/device.c", |
| "${bl702_sdk_root}/components/stage/yloop/src/local_event.c", |
| "${bl702_sdk_root}/components/stage/yloop/src/select.c", |
| "${bl702_sdk_root}/components/stage/yloop/src/yloop.c", |
| "${bl702_sdk_root}/components/utils/src/utils_base64.c", |
| "${bl702_sdk_root}/components/utils/src/utils_crc.c", |
| "${bl702_sdk_root}/components/utils/src/utils_dns.c", |
| "${bl702_sdk_root}/components/utils/src/utils_fec.c", |
| "${bl702_sdk_root}/components/utils/src/utils_getopt.c", |
| "${bl702_sdk_root}/components/utils/src/utils_hex.c", |
| "${bl702_sdk_root}/components/utils/src/utils_hexdump.c", |
| "${bl702_sdk_root}/components/utils/src/utils_hmac_sha1_fast.c", |
| "${bl702_sdk_root}/components/utils/src/utils_memp.c", |
| "${bl702_sdk_root}/components/utils/src/utils_notifier.c", |
| "${bl702_sdk_root}/components/utils/src/utils_psk_fast.c", |
| "${bl702_sdk_root}/components/utils/src/utils_rbtree.c", |
| "${bl702_sdk_root}/components/utils/src/utils_sha256.c", |
| "${bl702_sdk_root}/components/utils/src/utils_time.c", |
| "${bl702_sdk_root}/components/utils/src/utils_tlv_bl.c", |
| ] |
| |
| cflags_c += [ "-Wno-shadow" ] |
| |
| public_configs = [ |
| ":${sdk_target_name}_config", |
| ":${sdk_target_name}_plat_config", |
| ] |
| } |
| |
| config("${sdk_target_name}_ble_config") { |
| _include_dirs = [ |
| "${bl702_sdk_root}/components/network/ble/blestack/src/include", |
| "${bl702_sdk_root}/components/network/ble/blestack/src", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common/include", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common/include/misc", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common/include/zephyr", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/port/include", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/include/bluetooth", |
| "${bl702_sdk_root}/components/network/ble/blecontroller/ble_inc", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/include/drivers/bluetooth", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host", |
| ] |
| |
| defines = [ |
| "CONFIG_SET_TX_PWR", |
| "CFG_BLE_ENABLE", |
| "BFLB_BLE", |
| "CFG_BLE", |
| "CFG_SLEEP", |
| "OPTIMIZE_DATA_EVT_FLOW_FROM_CONTROLLER", |
| "CFG_BT_RESET", |
| "CFG_CON=1", |
| "CFG_BLE_TX_BUFF_DATA=2", |
| "CONFIG_BT_PERIPHERAL=1", |
| "CONFIG_BT_L2CAP_DYNAMIC_CHANNEL", |
| "CONFIG_BT_GATT_CLIENT", |
| "CONFIG_BT_CONN=1", |
| "CONFIG_BT_GATT_DIS_PNP", |
| "CONFIG_BT_GATT_DIS_SERIAL_NUMBER", |
| "CONFIG_BT_GATT_DIS_FW_REV", |
| "CONFIG_BT_GATT_DIS_HW_REV", |
| "CONFIG_BT_GATT_DIS_SW_REV", |
| "CONFIG_BT_ECC", |
| "CONFIG_BT_GATT_DYNAMIC_DB", |
| "CONFIG_BT_GATT_SERVICE_CHANGED", |
| "CONFIG_BT_KEYS_OVERWRITE_OLDEST", |
| "CONFIG_BT_KEYS_SAVE_AGING_COUNTER_ON_PAIRING", |
| "CONFIG_BT_GAP_PERIPHERAL_PREF_PARAMS", |
| "CONFIG_BT_BONDABLE", |
| "CONFIG_BT_HCI_VS_EVT_USER", |
| "CONFIG_BT_ASSERT", |
| "CONFIG_BT_SETTINGS_CCC_LAZY_LOADING", |
| "CONFIG_BT_SETTINGS_USE_PRINTK", |
| "CFG_BLE_STACK_DBG_PRINT", |
| ] |
| |
| cflags = [] |
| foreach(include_dir, _include_dirs) { |
| cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] |
| } |
| } |
| |
| source_set("${sdk_target_name}_ble") { |
| defines = [ "BL702=1" ] |
| |
| include_dirs = [ |
| "${bl702_sdk_root}/components/network/ble/blestack/src/include", |
| "${bl702_sdk_root}/components/network/ble/blecontroller/ble_inc", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/include/drivers/bluetooth", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/bl_hci_wrapper", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common/tinycrypt/include/tinycrypt", |
| ] |
| |
| sources = [ |
| "${bl702_sdk_root}/components/network/ble/blestack/src/bl_hci_wrapper/bl_hci_wrapper.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common/atomic_c.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common/buf.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common/dec.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common/log.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common/poll.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/common/work_q.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/hci_onchip/hci_driver.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host/att.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host/bl_host_assist.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host/conn.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host/crypto.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host/gatt.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host/hci_core.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host/l2cap.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host/settings.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/host/uuid.c", |
| "${bl702_sdk_root}/components/network/ble/blestack/src/port/bl_port.c", |
| ] |
| |
| libs = [ "${bl702_sdk_root}/components/network/ble/blecontroller_702_std/lib/libblecontroller_702_std.a" ] |
| |
| configs += [ ":${sdk_target_name}_plat_config" ] |
| public_configs = [ ":${sdk_target_name}_ble_config" ] |
| |
| cflags_c = [ |
| "-Wno-sign-compare", |
| "-Wno-unused-but-set-variable", |
| "-Wno-misleading-indentation", |
| "-Wno-format", |
| "-Wno-format-nonliteral", |
| "-Wno-format-security", |
| "-Wno-unused-function", |
| "-Wno-incompatible-pointer-types", |
| "-Wno-discarded-qualifiers", |
| ] |
| } |
| |
| config("${sdk_target_name}_otport_config") { |
| _include_dirs = [ |
| "${chip_root}/platform/bl702", |
| "${chip_root}/third_party/openthread/repo/src/core", |
| "${chip_root}/third_party/openthread/repo/examples/platforms", |
| "${bl702_sdk_root}/components/network/thread/openthread_port/include", |
| ] |
| |
| cflags = [] |
| foreach(include_dir, _include_dirs) { |
| cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] |
| } |
| } |
| |
| source_set("${sdk_target_name}_otport") { |
| import("//build_overrides/openthread.gni") |
| |
| include_dirs = [ |
| "${bl702_sdk_root}/components/network/lmac154/include", |
| "${openthread_root}/examples/platforms/utils/", |
| "${openthread_root}/examples", |
| ] |
| |
| sources = [ |
| "${bl702_sdk_root}/components/network/thread/openthread_port/ot_alarm.c", |
| "${bl702_sdk_root}/components/network/thread/openthread_port/ot_diag.c", |
| "${bl702_sdk_root}/components/network/thread/openthread_port/ot_entropy.c", |
| "${bl702_sdk_root}/components/network/thread/openthread_port/ot_logging.c", |
| "${bl702_sdk_root}/components/network/thread/openthread_port/ot_misc.c", |
| "${bl702_sdk_root}/components/network/thread/openthread_port/ot_radio.c", |
| "${bl702_sdk_root}/components/network/thread/openthread_port/ot_settings.c", |
| "${bl702_sdk_root}/components/network/thread/openthread_port/ot_uart.c", |
| |
| # "${bl702_sdk_root}/components/network/thread/openthread_port/ot_system.c", |
| # "${bl702_sdk_root}/components/network/thread/openthread_port/ot_freertos.c", |
| # "${bl702_sdk_root}/components/network/thread/openthread_port/ot_memory.c" |
| ] |
| |
| libs = [ "${bl702_sdk_root}/components/network/lmac154/lib/liblmac154.a" ] |
| |
| public_configs = [ |
| ":${sdk_target_name}_config", |
| ":${sdk_target_name}_plat_config", |
| ":${sdk_target_name}_otport_config", |
| ] |
| |
| public_deps = [ |
| ":${sdk_target_name}_plat", |
| "${bl702_sdk_build_root}:mbedtls", |
| "${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils", |
| "${openthread_root}/src/core:libopenthread_core_headers", |
| ] |
| } |
| |
| config("${sdk_target_name}_lwip_port_config") { |
| _include_dirs = [ |
| "${bl702_sdk_root}/components/network/lwip/lwip-port", |
| "${bl702_sdk_root}/components/network/lwip/lwip-port/config", |
| "${bl702_sdk_root}/components/stage/virt_net/include", |
| "${bl702_sdk_root}/components/stage/throughput/bl702/inc", |
| ] |
| |
| defines = [ |
| "TCPIP_THREAD_PRIO=24", |
| "CFG_ETHERNET_ENABLE=1", |
| ] |
| |
| cflags = [] |
| foreach(include_dir, _include_dirs) { |
| cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] |
| } |
| |
| cflags += [ |
| "-Wno-conversion", |
| "-Wno-unused-function", |
| ] |
| } |
| |
| source_set("${sdk_target_name}_lwip_port") { |
| defines = [ |
| "SPI_WIFI_RXBUFF_IN_PSRAM=1", |
| "VIRT_NET_SPI_RX_TASK_PRIORITY=25", |
| ] |
| |
| # include_dirs = [ |
| # "${bl702_sdk_root}/components/network/lwip/lwip-port/arch", |
| # "${bl702_sdk_root}/components/network/lwip/lwip-port/FreeRTOS", |
| # "${bl702_sdk_root}/components/stage/throughput" |
| # ] |
| |
| # sources = [ |
| # "${bl702_sdk_root}/components/network/lwip/lwip-port/FreeRTOS/ethernetif.c", |
| # "${bl702_sdk_root}/components/network/lwip/lwip-port/FreeRTOS/sys_arch.c" |
| # ] |
| |
| # sources += [ |
| # "${bl702_sdk_root}/components/stage/throughput/bl702/src/tp_spi_master.c", |
| # ] |
| # sources += [ |
| # "${bl702_sdk_root}/components/stage/virt_net/src/virt_net.c", |
| # "${bl702_sdk_root}/components/stage/virt_net/src/virt_net_spi.c", |
| # ] |
| |
| public_configs = [ |
| ":${sdk_target_name}_config", |
| ":${sdk_target_name}_plat_config", |
| ":${sdk_target_name}_lwip_port_config", |
| ":${sdk_target_name}_lwip_config", |
| ] |
| |
| cflags = [ "-Wno-sign-compare" ] |
| } |
| |
| config("${sdk_target_name}_lwip_config") { |
| _include_dirs = [ |
| "${bl702_sdk_root}/components/network/lwip/src/include", |
| # "${bl702_sdk_root}/components/network/lwip_mdns", |
| ] |
| |
| defines = [ |
| "LWIP_IPV6=1", |
| "LWIP_IPV4=1", |
| "LWIP_IPV6_DHCP6=1", |
| "LWIP_IPV6_SCOPES=0", |
| "PBUF_POOL_SIZE=12", |
| "PBUF_POOL_BUFSIZE=(1280+150)", |
| ] |
| |
| cflags = [] |
| foreach(include_dir, _include_dirs) { |
| cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] |
| } |
| } |
| |
| source_set("${sdk_target_name}_lwip") { |
| sources = [ |
| "${bl702_sdk_root}/components/network/lwip/src/api/api_lib.c", |
| "${bl702_sdk_root}/components/network/lwip/src/api/api_msg.c", |
| "${bl702_sdk_root}/components/network/lwip/src/api/err.c", |
| "${bl702_sdk_root}/components/network/lwip/src/api/if_api.c", |
| "${bl702_sdk_root}/components/network/lwip/src/api/netbuf.c", |
| "${bl702_sdk_root}/components/network/lwip/src/api/netifapi.c", |
| "${bl702_sdk_root}/components/network/lwip/src/api/sockets.c", |
| "${bl702_sdk_root}/components/network/lwip/src/api/tcpip.c", |
| ] |
| |
| sources += [ |
| "${bl702_sdk_root}/components/network/lwip/src/apps/altcp_tls/altcp_tls_mbedtls.c", |
| "${bl702_sdk_root}/components/network/lwip/src/apps/altcp_tls/altcp_tls_mbedtls_mem.c", |
| ] |
| |
| sources += [ |
| "${bl702_sdk_root}/components/network/lwip/src/core/def.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/dns.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/inet_chksum.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/init.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ip.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/mem.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/memp.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/netif.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/pbuf.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/raw.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/stats.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/sys.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/tcp.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/tcp_in.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/tcp_out.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/timeouts.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/udp.c", |
| "${bl702_sdk_root}/components/network/lwip/src/include/lwip/priv/api_msg.h", |
| "${bl702_sdk_root}/components/network/lwip/src/include/lwip/priv/memp_std.h", |
| "${bl702_sdk_root}/components/network/lwip/src/include/lwip/priv/nd6_priv.h", |
| ] |
| |
| sources += [ |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv4/autoip.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv4/dhcp.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv4/etharp.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv4/icmp.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv4/igmp.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv4/ip4.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv4/ip4_addr.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv4/ip4_frag.c", |
| ] |
| |
| sources += [ |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv6/dhcp6.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv6/ethip6.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv6/icmp6.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv6/inet6.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv6/ip6.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv6/ip6_addr.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv6/ip6_frag.c", |
| |
| #"${bl702_sdk_root}/components/network/lwip/src/core/ipv6/ip6_route_table.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv6/mld6.c", |
| "${bl702_sdk_root}/components/network/lwip/src/core/ipv6/nd6.c", |
| ] |
| |
| sources += |
| [ "${bl702_sdk_root}/components/network/lwip/src/netif/slipif.c" ] |
| sources += |
| [ "${bl702_sdk_root}/components/network/lwip/src/netif/bridgeif.c" ] |
| sources += |
| [ "${bl702_sdk_root}/components/network/lwip/src/netif/bridgeif_fdb.c" ] |
| sources += |
| [ "${bl702_sdk_root}/components/network/lwip/src/netif/ethernet.c" ] |
| sources += [ "${bl702_sdk_root}/components/network/lwip/src/netif/zepif.c" ] |
| |
| sources += |
| [ "${bl702_sdk_root}/components/network/lwip/src/apps/mdns/mdns.c" ] |
| |
| public_configs = [ |
| ":${sdk_target_name}_config", |
| ":${sdk_target_name}_plat_config", |
| ":${sdk_target_name}_lwip_port_config", |
| ":${sdk_target_name}_lwip_config", |
| ] |
| } |
| |
| config("${sdk_target_name}_zigbee_config") { |
| _include_dirs = [ |
| "${bl702_sdk_root}/components/network/zigbee/zbstack/", |
| "${bl702_sdk_root}/components/network/zigbee/zbstack/include", |
| "${bl702_sdk_root}/components/network/zigbee/zbstack/include/core", |
| "${bl702_sdk_root}/components/network/zigbee/zbstack/include/zcl", |
| "${bl702_sdk_root}/components/network/zigbee/zbcli/", |
| ] |
| |
| defines = [ "CFG_ZIGBEE_TOUCHLINK=1" ] |
| |
| cflags = [] |
| foreach(include_dir, _include_dirs) { |
| cflags += [ "-isystem" + rebase_path(include_dir, root_build_dir) ] |
| } |
| } |
| |
| source_set("${sdk_target_name}_zigbee") { |
| #sources = [ "${bl702_sdk_root}/components/network/zigbee/zbcli/zb_stack_cli.c" ] |
| |
| libs = [ |
| "${bl702_sdk_root}/components/network/zigbee/zbstack/lib/libzbstack.a", |
| "${bl702_sdk_root}/components/network/zigbee/zbstack/lib/libzbstackex.a", |
| ] |
| |
| public_configs = [ |
| ":${sdk_target_name}_config", |
| ":${sdk_target_name}_plat_config", |
| ":${sdk_target_name}_zigbee_config", |
| ] |
| ldflags = [ "-Wl,--defsym=__LD_CONFIG_FLASH_SIZE=0x100000" ] |
| cflags = [ |
| "-Wno-implicit-function-declaration", |
| "-Wno-incompatible-pointer-types", |
| "-Wno-unused-variable", |
| ] |
| } |
| |
| group(sdk_target_name) { |
| public_deps = [ |
| ":${sdk_target_name}_bflb_platform", |
| ":${sdk_target_name}_ble", |
| ":${sdk_target_name}_drv", |
| ":${sdk_target_name}_plat", |
| ] |
| |
| if (chip_enable_openthread) { |
| public_deps += [ ":${sdk_target_name}_otport" ] |
| } |
| |
| if (chip_enable_wifi) { |
| public_deps += [ ":${sdk_target_name}_lwip_port" ] |
| public_deps += [ ":${sdk_target_name}_lwip" ] |
| } |
| |
| if (enable_zigbee) { |
| public_deps += [ ":${sdk_target_name}_zigbee" ] |
| } |
| |
| if (enable_cdc_module) { |
| public_deps += [ ":${sdk_target_name}_cdc" ] |
| } |
| |
| public_deps += [ ":${sdk_target_name}_app" ] |
| } |
| } |