diff --git a/build_overrides/bouffalolab_iot_sdk.gni b/build_overrides/bouffalolab_iot_sdk.gni index aaa2dce52065b5..2a87174c734d84 100644 --- a/build_overrides/bouffalolab_iot_sdk.gni +++ b/build_overrides/bouffalolab_iot_sdk.gni @@ -13,8 +13,7 @@ # limitations under the License. declare_args() { - bouffalolab_iot_sdk_build_root = "//third_party/bouffalolab/" - + bouffalolab_sdk_root = "/opt/bouffalolab_sdk" } diff --git a/config/bouffalolab/args.gni b/config/bouffalolab/args.gni index a0fe18abfa94fb..a85d0ea655d0b4 100644 --- a/config/bouffalolab/args.gni +++ b/config/bouffalolab/args.gni @@ -15,4 +15,5 @@ # Options from standalone-chip.mk that differ from configure defaults. These # options are used from examples/. -custom_toolchain = "//third_party/connectedhomeip/config/bouffalolab/toolchain:riscv_gcc" +custom_toolchain = + "//third_party/connectedhomeip/config/bouffalolab/toolchain:riscv_gcc" diff --git a/examples/build_overrides/bouffalolab_iot_sdk.gni b/examples/build_overrides/bouffalolab_iot_sdk.gni index 29d1b63ed90b3a..d66989f09abd37 100644 --- a/examples/build_overrides/bouffalolab_iot_sdk.gni +++ b/examples/build_overrides/bouffalolab_iot_sdk.gni @@ -13,8 +13,7 @@ # limitations under the License. declare_args() { - - bouffalolab_iot_sdk_build_root = + bouffalolab_iot_sdk_build_root = "//third_party/connectedhomeip/third_party/bouffalolab" bouffalolab_sdk_root = "/opt/bouffalolab_sdk" diff --git a/examples/lighting-app/bouffalolab/bl602/BUILD.gn b/examples/lighting-app/bouffalolab/bl602/BUILD.gn index 5445076c503b54..0b341d50c32675 100644 --- a/examples/lighting-app/bouffalolab/bl602/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl602/BUILD.gn @@ -16,8 +16,8 @@ import("//build_overrides/bouffalolab_iot_sdk.gni") import("//build_overrides/build.gni") import("//build_overrides/chip.gni") -import("${bouffalolab_iot_sdk_build_root}/common/bouffalolab_executable.gni") import("${bouffalolab_iot_sdk_build_root}/bl602/bl_iot_sdk.gni") +import("${bouffalolab_iot_sdk_build_root}/common/bouffalolab_executable.gni") import("${build_root}/config/defaults.gni") import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni") import("${chip_root}/src/platform/device.gni") @@ -66,7 +66,7 @@ bl_iot_sdk("sdk") { "CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setupPinCode}", "OTA_PERIODIC_QUERY_TIMEOUT=${ota_periodic_query_timeout}", "CHIP_UART_BAUDRATE=${baudrate}", - "SYS_AOS_LOOP_ENABLE" + "SYS_AOS_LOOP_ENABLE", ] if (chip_enable_pw_rpc) { @@ -86,7 +86,7 @@ bouffalolab_executable("lighting_app") { "CHIP_UART_BAUDRATE=${baudrate}", "BL602_ENABLE", "START_ENTRY=bfl_main", - "SYS_AOS_LOOP_ENABLE" + "SYS_AOS_LOOP_ENABLE", ] bl_plat_name = "bl602" @@ -198,9 +198,7 @@ bouffalolab_executable("lighting_app") { sources += [ "${examples_plat_common_dir}/plat/OTAConfig.cpp" ] } - cflags_c = [ - "-Wno-sign-compare", - ] + cflags_c = [ "-Wno-sign-compare" ] ldscript = "${examples_plat_dir}/ldscripts/flash_rom.ld" ldflags = [ "-T" + rebase_path(ldscript, root_build_dir) ] diff --git a/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h b/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h index b8d78172155bd6..9e9934c227c465 100644 --- a/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h +++ b/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h @@ -145,4 +145,4 @@ #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 -#define CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE 128 \ No newline at end of file +#define CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE 128 diff --git a/examples/lighting-app/bouffalolab/common/AppTask.cpp b/examples/lighting-app/bouffalolab/common/AppTask.cpp index 6af026645fb192..2fe2a403357717 100644 --- a/examples/lighting-app/bouffalolab/common/AppTask.cpp +++ b/examples/lighting-app/bouffalolab/common/AppTask.cpp @@ -417,7 +417,8 @@ void AppTask::ChipEventHandler(const ChipDeviceEvent * event, intptr_t arg) #if CHIP_DEVICE_CONFIG_ENABLE_WIFI case DeviceEventType::kWiFiConnectivityChange: - ChipLogProgress(NotSpecified, "Wi-Fi state changed to %s.\r\n", ConnectivityMgr().IsWiFiStationConnected() ? "connected" : "disconnected"); + ChipLogProgress(NotSpecified, "Wi-Fi state changed to %s.\r\n", + ConnectivityMgr().IsWiFiStationConnected() ? "connected" : "disconnected"); chip::app::DnssdServer::Instance().StartServer(); NetworkCommissioning::BLWiFiDriver::GetInstance().SaveConfiguration(); diff --git a/examples/platform/bouffalolab/bl602/FreeRTOSConfig.h b/examples/platform/bouffalolab/bl602/FreeRTOSConfig.h index eb9a30b60e2ed4..96379643d791e3 100644 --- a/examples/platform/bouffalolab/bl602/FreeRTOSConfig.h +++ b/examples/platform/bouffalolab/bl602/FreeRTOSConfig.h @@ -115,23 +115,25 @@ * See http://www.freertos.org/a00110.html. *----------------------------------------------------------*/ -#define configSUPPORT_STATIC_ALLOCATION 1 +#define configSUPPORT_STATIC_ALLOCATION 1 -#define configCLINT_BASE_ADDRESS CLINT_CTRL_ADDR -#define configCLIC_TIMER_ENABLE_ADDRESS (0x02800407) -#define configUSE_PREEMPTION 1 -#define configUSE_IDLE_HOOK 1 -#define configUSE_TICK_HOOK 0 +#define configCLINT_BASE_ADDRESS CLINT_CTRL_ADDR +#define configCLIC_TIMER_ENABLE_ADDRESS (0x02800407) +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 0 #ifndef configUSE_TICKLESS_IDLE -//Maybe Compile flags is passed by command line -#define configUSE_TICKLESS_IDLE 1 +// Maybe Compile flags is passed by command line +#define configUSE_TICKLESS_IDLE 1 #endif -#define configCPU_CLOCK_HZ ( 10 * 1000 * 1000 ) /*QEMU*/ -#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) -#define configMAX_PRIORITIES ( 32 ) +#define configCPU_CLOCK_HZ (10 * 1000 * 1000) /*QEMU*/ +#define configTICK_RATE_HZ ((TickType_t) 1000) +#define configMAX_PRIORITIES (32) /* Creating idle task */ -/* -1 -> prvInitialiseNewTask: (subtract 1 to get top of stack) pxTopOfStack = &( pxNewTCB->pxStack[ ulStackDepth - ( uint32_t ) 1 ] ); */ -/* -1 -> prvInitialiseNewTask: (subtract 1 in case not matching 8 bytes alignment) pxTopOfStack = ( StackType_t * ) ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) ); */ +/* -1 -> prvInitialiseNewTask: (subtract 1 to get top of stack) pxTopOfStack = &( pxNewTCB->pxStack[ ulStackDepth - ( uint32_t ) 1 + * ] ); */ +/* -1 -> prvInitialiseNewTask: (subtract 1 in case not matching 8 bytes alignment) pxTopOfStack = ( StackType_t * ) ( ( ( + * portPOINTER_SIZE_TYPE ) pxTopOfStack ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) ); */ /* Running idle task */ /* -12 -> prvIdleTask: addi sp, sp, -48 */ /* -16 -> prvIdleTask.xTaskResumeAll: addi sp, sp, -64 */ @@ -139,52 +141,52 @@ /* -30 -> freertos_risc_v_trap_handler: addi sp, sp, -portCONTEXT_SIZE */ /* -34 -> portasmSAVE_ADDITIONAL_REGISTERS: addi sp, sp, -(portasmADDITIONAL_CONTEXT_SIZE * portWORD_SIZE) */ /* Checking for stack overflow */ -/* 4 -> taskCHECK_FOR_STACK_OVERFLOW: if( ( pulStack[ 0 ] != ulCheckValue ) || ( pulStack[ 1 ] != ulCheckValue ) || ( pulStack[ 2 ] != ulCheckValue ) || ( pulStack[ 3 ] != ulCheckValue ) ) */ -#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 114 ) /* SIZE-1-1-12-16-30-34>=4 */ -#define configTOTAL_HEAP_SIZE ( ( size_t ) 14100 ) -#define configMAX_TASK_NAME_LEN ( 16 ) -#define configUSE_TRACE_FACILITY 1 -#define configUSE_STATS_FORMATTING_FUNCTIONS 1 -#define configUSE_16_BIT_TICKS 0 -#define configIDLE_SHOULD_YIELD 1 -#define configUSE_MUTEXES 1 -#define configQUEUE_REGISTRY_SIZE 8 -#define configCHECK_FOR_STACK_OVERFLOW 2 -#define configUSE_RECURSIVE_MUTEXES 1 -#define configUSE_MALLOC_FAILED_HOOK 1 -#define configUSE_APPLICATION_TASK_TAG 0 -#define configUSE_COUNTING_SEMAPHORES 1 -#define configGENERATE_RUN_TIME_STATS 0 +/* 4 -> taskCHECK_FOR_STACK_OVERFLOW: if( ( pulStack[ 0 ] != ulCheckValue ) || ( pulStack[ 1 ] != ulCheckValue ) || ( pulStack[ 2 + * ] != ulCheckValue ) || ( pulStack[ 3 ] != ulCheckValue ) ) */ +#define configMINIMAL_STACK_SIZE ((unsigned short) 114) /* SIZE-1-1-12-16-30-34>=4 */ +#define configTOTAL_HEAP_SIZE ((size_t) 14100) +#define configMAX_TASK_NAME_LEN (16) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_STATS_FORMATTING_FUNCTIONS 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 8 +#define configCHECK_FOR_STACK_OVERFLOW 2 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 0 +#define configUSE_COUNTING_SEMAPHORES 1 +#define configGENERATE_RUN_TIME_STATS 0 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 /* Co-routine definitions. */ -#define configUSE_CO_ROUTINES 0 -#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) +#define configUSE_CO_ROUTINES 0 +#define configMAX_CO_ROUTINE_PRIORITIES (2) /* Software timer definitions. */ -#define configUSE_TIMERS 1 -#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) -#define configTIMER_QUEUE_LENGTH 4 -#define configTIMER_TASK_STACK_DEPTH ( 400 ) +#define configUSE_TIMERS 1 +#define configTIMER_TASK_PRIORITY (configMAX_PRIORITIES - 1) +#define configTIMER_QUEUE_LENGTH 4 +#define configTIMER_TASK_STACK_DEPTH (400) /* Task priorities. Allow these to be overridden. */ #ifndef uartPRIMARY_PRIORITY - #define uartPRIMARY_PRIORITY ( configMAX_PRIORITIES - 3 ) +#define uartPRIMARY_PRIORITY (configMAX_PRIORITIES - 3) #endif - /* Optional functions - most linkers will remove unused functions anyway. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 1 -#define INCLUDE_vTaskCleanUpResources 1 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 -#define INCLUDE_eTaskGetState 1 -#define INCLUDE_xTimerPendFunctionCall 1 -#define INCLUDE_xTimerPendFunctionCall 1 -#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 1 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_eTaskGetState 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_xTimerPendFunctionCall 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 /* Overwrite some of the stack sizes allocated to various test and demo tasks. Like all task stack sizes, the value is the number of words, not bytes. */ @@ -204,10 +206,10 @@ extern void vAssertCalled(void); if ((x) == 0) \ vAssertCalled() -#if ( configUSE_TICKLESS_IDLE != 0 ) +#if (configUSE_TICKLESS_IDLE != 0) #include "portmacro.h" extern void vApplicationSleep(TickType_t xExpectedIdleTime); -#define portSUPPRESS_TICKS_AND_SLEEP(xExpectedIdleTime) vApplicationSleep(xExpectedIdleTime) +#define portSUPPRESS_TICKS_AND_SLEEP(xExpectedIdleTime) vApplicationSleep(xExpectedIdleTime) #endif #endif diff --git a/src/platform/bouffalolab/BL602/BL602Config.cpp b/src/platform/bouffalolab/BL602/BL602Config.cpp index e90bdc800715c3..140b52d5fa0edd 100644 --- a/src/platform/bouffalolab/BL602/BL602Config.cpp +++ b/src/platform/bouffalolab/BL602/BL602Config.cpp @@ -81,7 +81,7 @@ CHIP_ERROR BL602Config::Init() CHIP_ERROR BL602Config::ReadConfigValue(Key key, bool & val) { CHIP_ERROR err = CHIP_NO_ERROR; - size_t valLen = 0; + size_t valLen = 0; ef_get_env_blob(key.name, &val, 1, &valLen); if (0 == valLen) @@ -95,7 +95,7 @@ CHIP_ERROR BL602Config::ReadConfigValue(Key key, bool & val) CHIP_ERROR BL602Config::ReadConfigValue(Key key, uint32_t & val) { CHIP_ERROR err = CHIP_NO_ERROR; - size_t valLen = 0; + size_t valLen = 0; ef_get_env_blob(key.name, &val, sizeof(val), &valLen); if (0 == valLen) @@ -109,7 +109,7 @@ CHIP_ERROR BL602Config::ReadConfigValue(Key key, uint32_t & val) CHIP_ERROR BL602Config::ReadConfigValue(Key key, uint64_t & val) { CHIP_ERROR err = CHIP_NO_ERROR; - size_t valLen = 0; + size_t valLen = 0; ef_get_env_blob(key.name, &val, sizeof(val), &valLen); if (0 == valLen) @@ -122,7 +122,7 @@ CHIP_ERROR BL602Config::ReadConfigValue(Key key, uint64_t & val) CHIP_ERROR BL602Config::ReadConfigValueStr(Key key, char * buf, size_t bufSize, size_t & outLen) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; outLen = 0; ef_get_env_blob(key.name, buf, bufSize, &outLen); @@ -136,7 +136,7 @@ CHIP_ERROR BL602Config::ReadConfigValueStr(Key key, char * buf, size_t bufSize, CHIP_ERROR BL602Config::ReadConfigValueBin(Key key, uint8_t * buf, size_t bufSize, size_t & outLen) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; ef_get_env_blob(key.name, buf, bufSize, &outLen); if (0 == outLen) diff --git a/src/platform/bouffalolab/BL602/ConfigurationManagerImpl.cpp b/src/platform/bouffalolab/BL602/ConfigurationManagerImpl.cpp index 5f875a9b52ab0b..5c53153867fbe0 100644 --- a/src/platform/bouffalolab/BL602/ConfigurationManagerImpl.cpp +++ b/src/platform/bouffalolab/BL602/ConfigurationManagerImpl.cpp @@ -32,9 +32,9 @@ #include extern "C" { -#include #include #include +#include } namespace chip { diff --git a/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp b/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp index cba5cd54e6061c..9c972071a60631 100644 --- a/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp +++ b/src/platform/bouffalolab/BL602/DiagnosticDataProviderImpl.cpp @@ -30,11 +30,11 @@ #include extern "C" { -#include #include -#include #include #include +#include +#include #include } @@ -248,7 +248,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiBssId(ByteSpan & BssId) CHIP_ERROR DiagnosticDataProviderImpl::GetWiFiSecurityType(uint8_t & securityType) { - //int authmode; + // int authmode; // authmode = mgmr_get_security_type(); // securityType = MapAuthModeToSecurityType(authmode); diff --git a/src/platform/bouffalolab/BL602/KeyValueStoreManagerImpl.cpp b/src/platform/bouffalolab/BL602/KeyValueStoreManagerImpl.cpp index e20e54b161b7af..dc7aee8708d0f5 100644 --- a/src/platform/bouffalolab/BL602/KeyValueStoreManagerImpl.cpp +++ b/src/platform/bouffalolab/BL602/KeyValueStoreManagerImpl.cpp @@ -47,7 +47,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t size_t outlen = 0; BL602Config::Key ckey = { key }; - err = BL602Config::ReadConfigValueBin(ckey, (uint8_t *)value, value_size, outlen); + err = BL602Config::ReadConfigValueBin(ckey, (uint8_t *) value, value_size, outlen); if (CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND == err) { err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; @@ -69,7 +69,7 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, CHIP_ERROR err = CHIP_NO_ERROR; BL602Config::Key ckey = { key }; - err = BL602Config::WriteConfigValueBin(ckey, (uint8_t *)value, value_size); + err = BL602Config::WriteConfigValueBin(ckey, (uint8_t *) value, value_size); if (CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND == err) { err = CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND; diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp index d0d93cceabeb2e..7cb2bfaad1cc20 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.cpp @@ -16,14 +16,14 @@ */ #include +#include +#include #include #include #include +#include #include #include -#include -#include -#include #include #include diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h index f4bee4de728e20..fc08f778e8fbff 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningDriver.h @@ -16,8 +16,8 @@ */ #pragma once -#include #include +#include namespace chip { namespace DeviceLayer { diff --git a/src/platform/bouffalolab/BL602/NetworkCommissioningWiFiDriver.cpp b/src/platform/bouffalolab/BL602/NetworkCommissioningWiFiDriver.cpp index 91284cf54430e0..c469c5a90edb01 100644 --- a/src/platform/bouffalolab/BL602/NetworkCommissioningWiFiDriver.cpp +++ b/src/platform/bouffalolab/BL602/NetworkCommissioningWiFiDriver.cpp @@ -19,9 +19,9 @@ #include #include #include +#include #include #include -#include #include #include diff --git a/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp b/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp index 84d296e82272ed..16fad1b9ffcf5f 100644 --- a/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/BL602/PlatformManagerImpl.cpp @@ -30,8 +30,8 @@ #include #include -#include #include +#include #include #include @@ -165,7 +165,7 @@ static void WifiStaConnected(void) chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::WiFiConnectionStatus::kConnected)); } } -typedef void (*aos_event_cb)(input_event_t *event, void *private_data); +typedef void (*aos_event_cb)(input_event_t * event, void * private_data); void OnWiFiPlatformEvent(input_event_t * event, void * private_data) { @@ -220,7 +220,7 @@ void OnWiFiPlatformEvent(input_event_t * event, void * private_data) CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) { - CHIP_ERROR err = CHIP_NO_ERROR; + CHIP_ERROR err = CHIP_NO_ERROR; static uint8_t stack_wifi_init = 0; TaskHandle_t backup_eventLoopTask; diff --git a/src/platform/bouffalolab/BL602/PlatformManagerImpl.h b/src/platform/bouffalolab/BL602/PlatformManagerImpl.h index b90f2ef25c8c17..861e446f0beec3 100644 --- a/src/platform/bouffalolab/BL602/PlatformManagerImpl.h +++ b/src/platform/bouffalolab/BL602/PlatformManagerImpl.h @@ -24,13 +24,12 @@ #pragma once -#include #include +#include namespace chip { namespace DeviceLayer { - /** * Concrete implementation of the PlatformManager singleton object for the BL602 platform. */ diff --git a/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp b/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp index 5cb688fb8b8cee..0fb93c75826058 100644 --- a/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/ThreadStackManagerImpl.cpp @@ -127,42 +127,46 @@ extern "C" void otPlatFree(void * aPtr) } #ifdef OT_THREAD_PORT_1_3 -extern "C" uint32_t otrEnterCrit(void) +extern "C" uint32_t otrEnterCrit(void) { - if (xPortIsInsideInterrupt()) { + if (xPortIsInsideInterrupt()) + { return taskENTER_CRITICAL_FROM_ISR(); } - else { + else + { taskENTER_CRITICAL(); return 0; } } -extern "C" void otrExitCrit(uint32_t tag) +extern "C" void otrExitCrit(uint32_t tag) { - if (xPortIsInsideInterrupt()) { + if (xPortIsInsideInterrupt()) + { taskEXIT_CRITICAL_FROM_ISR(tag); } - else { + else + { taskEXIT_CRITICAL(); } } -extern "C" ot_system_event_t otrGetNotifyEvent(void) +extern "C" ot_system_event_t otrGetNotifyEvent(void) { ot_system_event_t sevent = OT_SYSTEM_EVENT_NONE; taskENTER_CRITICAL(); - sevent = ot_system_event_var; + sevent = ot_system_event_var; ot_system_event_var = OT_SYSTEM_EVENT_NONE; taskEXIT_CRITICAL(); return sevent; } -extern "C" void otrNotifyEvent(ot_system_event_t sevent) +extern "C" void otrNotifyEvent(ot_system_event_t sevent) { - uint32_t tag = otrEnterCrit(); + uint32_t tag = otrEnterCrit(); ot_system_event_var = (ot_system_event_t)(ot_system_event_var | sevent); otrExitCrit(tag); diff --git a/src/platform/bouffalolab/BL702/args.gni b/src/platform/bouffalolab/BL702/args.gni index 1fa7b11b6cb1af..6d7aad914b6a28 100644 --- a/src/platform/bouffalolab/BL702/args.gni +++ b/src/platform/bouffalolab/BL702/args.gni @@ -37,7 +37,8 @@ openthread_core_config_platform_check_file = "bl702-openthread-core-bl-config-check.h" openthread_project_include_dirs = [ "${chip_root}/src/platform/bouffalolab/BL702" ] -openthread_external_platform = "${bouffalolab_iot_sdk_build_root}/bl702:bl_iot_sdk" +openthread_external_platform = + "${bouffalolab_iot_sdk_build_root}/bl702:bl_iot_sdk" pw_build_LINK_DEPS = [ "$dir_pw_assert:impl", diff --git a/third_party/bouffalolab/bl602/bl_iot_sdk.gni b/third_party/bouffalolab/bl602/bl_iot_sdk.gni index 20335661afe739..f527f27132f791 100644 --- a/third_party/bouffalolab/bl602/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl602/bl_iot_sdk.gni @@ -18,7 +18,6 @@ import("//build_overrides/mbedtls.gni") import("${chip_root}/src/lib/lib.gni") declare_args() { - bl_iot_sdk_root = "${chip_root}/third_party/bouffalolab/repo" } @@ -33,7 +32,6 @@ template("bl_iot_sdk") { sdk_target_name = target_name config("${sdk_target_name}_config") { - defines = [ "__FILENAME__=strrchr(__FILE__,'/')?strrchr(__FILE__,'/')+1:__FILE__", "ARCH_RISCV", @@ -53,7 +51,7 @@ template("bl_iot_sdk") { if (defined(invoker.include_dirs)) { include_dirs += invoker.include_dirs } - + if (defined(invoker.defines)) { defines += invoker.defines } @@ -97,14 +95,11 @@ template("bl_iot_sdk") { "${chip_root}/third_party/mbedtls/repo/library/x509_create.c", "${chip_root}/third_party/mbedtls/repo/library/x509write_csr.c", ] - configs += [ - ":${sdk_target_name}_config_freertos", - ] + configs += [ ":${sdk_target_name}_config_freertos" ] public_configs = [ ":${sdk_target_name}_config" ] } source_set("${sdk_target_name}_soc") { - defines = [ "BL602_MATTER_SUPPORT" ] sources = [ @@ -169,12 +164,10 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/platform/soc/bl602/bl602_std/bl602_std/StdDriver/Src/bl602_xip_sflash_ext.c", ] - configs += [ - ":${sdk_target_name}_config_freertos" - ] - public_configs = [ - ":${sdk_target_name}_config", - ":${sdk_target_name}_config_BSP_Driver" + configs += [ ":${sdk_target_name}_config_freertos" ] + public_configs = [ + ":${sdk_target_name}_config", + ":${sdk_target_name}_config_BSP_Driver", ] cflags_c = [ "-Wno-sign-compare", @@ -192,9 +185,7 @@ template("bl_iot_sdk") { source_set("${sdk_target_name}_bl602_freertos") { defines = [ "portasmHANDLE_INTERRUPT=interrupt_entry" ] - include_dirs = [ - "${bl_iot_sdk_root}/components/platform/soc/bl602/freertos_riscv_ram/portable/GCC/RISC-V/chip_specific_extensions/RV32F_float_abi_single", - ] + include_dirs = [ "${bl_iot_sdk_root}/components/platform/soc/bl602/freertos_riscv_ram/portable/GCC/RISC-V/chip_specific_extensions/RV32F_float_abi_single" ] sources = [ "${bl_iot_sdk_root}/components/platform/soc/bl602/freertos_riscv_ram/event_groups.c", @@ -216,7 +207,7 @@ template("bl_iot_sdk") { "-Wno-old-style-declaration", ] - public_configs = [ + public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_freertos", ] @@ -230,11 +221,10 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/platform/hosal/sec_common", ] - cflags_cc = ["-Wno-literal-suffix"] + cflags_cc = [ "-Wno-literal-suffix" ] } source_set("${sdk_target_name}_hosal") { - sources = [ "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/bl_adc.c", "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/bl_boot2.c", @@ -274,8 +264,9 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hal_pds.c", "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hal_sys.c", "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hal_wifi.c", -# hosal_adc.c is included by the code in wifi module -# "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hosal_adc.c", + + # hosal_adc.c is included by the code in wifi module + # "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hosal_adc.c", "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hosal_dac.c", "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hosal_dma.c", "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hosal_efuse.c", @@ -290,7 +281,6 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hosal_timer.c", "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hosal_uart.c", "${bl_iot_sdk_root}/components/platform/hosal/bl602_hal/hosal_wdg.c", - "${bl_iot_sdk_root}/components/platform/hosal/sec_common/bl_sec_aes.c", "${bl_iot_sdk_root}/components/platform/hosal/sec_common/bl_sec_common.c", "${bl_iot_sdk_root}/components/platform/hosal/sec_common/bl_sec_pka.c", @@ -305,7 +295,7 @@ template("bl_iot_sdk") { "-Wno-stringop-overflow", "-Wno-format-truncation", ] - configs += [ + configs += [ ":${sdk_target_name}_config_wifi", ":${sdk_target_name}_config_BSP_Driver", ":${sdk_target_name}_config_stage", @@ -314,16 +304,14 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_utils", ":${sdk_target_name}_config_freertos", ] - public_configs = [ - ":${sdk_target_name}_config", - ":${sdk_target_name}_config_hosal" + public_configs = [ + ":${sdk_target_name}_config", + ":${sdk_target_name}_config_hosal", ] } config("${sdk_target_name}_config_fs") { - include_dirs = [ - "${bl_iot_sdk_root}/components/fs/vfs/include", - ] + include_dirs = [ "${bl_iot_sdk_root}/components/fs/vfs/include" ] } source_set("${sdk_target_name}_fs") { @@ -342,16 +330,16 @@ template("bl_iot_sdk") { "-Wno-sign-compare", "-Wno-builtin-declaration-mismatch", ] - configs += [ - ":${sdk_target_name}_config_hosal", - ":${sdk_target_name}_config_stage", - ":${sdk_target_name}_config_fs", + configs += [ + ":${sdk_target_name}_config_hosal", + ":${sdk_target_name}_config_stage", + ":${sdk_target_name}_config_fs", ":${sdk_target_name}_config_utils", ":${sdk_target_name}_config_freertos", ] - public_configs = [ - ":${sdk_target_name}_config", - ":${sdk_target_name}_config_fs" + public_configs = [ + ":${sdk_target_name}_config", + ":${sdk_target_name}_config_fs", ] } @@ -362,9 +350,7 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/libc/newlibc/syscalls.c", ] cflags_c = [ "-Wno-builtin-declaration-mismatch" ] - configs += [ - ":${sdk_target_name}_config_freertos", - ] + configs += [ ":${sdk_target_name}_config_freertos" ] public_configs = [ ":${sdk_target_name}_config" ] } @@ -380,7 +366,6 @@ template("bl_iot_sdk") { } source_set("${sdk_target_name}_stage") { - sources = [ "${bl_iot_sdk_root}/components/stage/blfdt/src/fdt.c", "${bl_iot_sdk_root}/components/stage/blfdt/src/fdt_addresses.c", @@ -410,9 +395,9 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_sys", ":${sdk_target_name}_config_utils", ] - public_configs = [ - ":${sdk_target_name}_config", - ":${sdk_target_name}_config_stage" + public_configs = [ + ":${sdk_target_name}_config", + ":${sdk_target_name}_config_stage", ] } @@ -426,10 +411,8 @@ template("bl_iot_sdk") { } source_set("${sdk_target_name}_sys") { - include_dirs = [ - "${bl_iot_sdk_root}/components/sys/bltime/include", - ] - sources = [ + include_dirs = [ "${bl_iot_sdk_root}/components/sys/bltime/include" ] + sources = [ "${bl_iot_sdk_root}/components/sys/blmtd/bl_mtd.c", "${bl_iot_sdk_root}/components/sys/bltime/bl_sys_time.c", ] @@ -439,16 +422,14 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_utils", ":${sdk_target_name}_config_freertos", ] - public_configs = [ + public_configs = [ ":${sdk_target_name}_config", - ":${sdk_target_name}_config_sys" + ":${sdk_target_name}_config_sys", ] } config("${sdk_target_name}_config_utils") { - include_dirs = [ - "${bl_iot_sdk_root}/components/utils/include/", - ] + include_dirs = [ "${bl_iot_sdk_root}/components/utils/include/" ] } source_set("${sdk_target_name}_utils") { @@ -482,9 +463,9 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_utils", ":${sdk_target_name}_config_freertos", ] - public_configs = [ + public_configs = [ ":${sdk_target_name}_config", - ":${sdk_target_name}_config_utils" + ":${sdk_target_name}_config_utils", ] } @@ -539,7 +520,7 @@ template("bl_iot_sdk") { "CONFIG_BT_SETTINGS_USE_PRINTK", ] - libs = [ "${bl_iot_sdk_root}/components/network/ble/blecontroller_602_m0s1/lib/libblecontroller_602_m0s1.a"] + libs = [ "${bl_iot_sdk_root}/components/network/ble/blecontroller_602_m0s1/lib/libblecontroller_602_m0s1.a" ] include_dirs = [ "${bl_iot_sdk_root}/components/network/ble/blestack/src/common", @@ -572,11 +553,11 @@ template("bl_iot_sdk") { configs += [ ":${sdk_target_name}_config_BSP_Driver", ":${sdk_target_name}_config_freertos", - ":${sdk_target_name}_config_utils" + ":${sdk_target_name}_config_utils", ] - public_configs = [ - ":${sdk_target_name}_config", - ":${sdk_target_name}_ble_config" + public_configs = [ + ":${sdk_target_name}_config", + ":${sdk_target_name}_ble_config", ] cflags_c = [ @@ -604,7 +585,7 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/security/blcrypto_suite/priv_inc", "${bl_iot_sdk_root}/components/security/blcrypto_suite/priv_inc", ] - sources = [ + sources = [ "${bl_iot_sdk_root}/components/security/blcrypto_suite/src/blcrypto_suite_aes.c", "${bl_iot_sdk_root}/components/security/blcrypto_suite/src/blcrypto_suite_bignum.c", "${bl_iot_sdk_root}/components/security/blcrypto_suite/src/blcrypto_suite_ecp.c", @@ -623,9 +604,9 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_hosal", ":${sdk_target_name}_config_freertos", ] - public_configs = [ + public_configs = [ ":${sdk_target_name}_config", - ":${sdk_target_name}_config_blcrypto_suite" + ":${sdk_target_name}_config_blcrypto_suite", ] } @@ -651,7 +632,6 @@ template("bl_iot_sdk") { } source_set("${sdk_target_name}_wifi") { - defines = [ "BL602_MATTER_SUPPORT" ] include_dirs = [ @@ -677,15 +657,12 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/security/wpa_supplicant/src/utils", ] - sources = [ - "${bl_iot_sdk_root}/components/os/bl_os_adapter/bl_os_adapter/bl_os_hal.c", - ] + sources = [ "${bl_iot_sdk_root}/components/os/bl_os_adapter/bl_os_adapter/bl_os_hal.c" ] sources += [ + "${bl_iot_sdk_root}/components/network/rfparam_adapter_tmp/rftlv/phy_rftlv.c", "${bl_iot_sdk_root}/components/network/wifi_hosal/port/wifi_hosal_bl602.c", "${bl_iot_sdk_root}/components/network/wifi_hosal/wifi_hosal.c", - - "${bl_iot_sdk_root}/components/network/rfparam_adapter_tmp/rftlv/phy_rftlv.c", "${bl_iot_sdk_root}/components/network/wifi_manager/bl60x_wifi_driver/bl_cmds.c", "${bl_iot_sdk_root}/components/network/wifi_manager/bl60x_wifi_driver/bl_irqs.c", "${bl_iot_sdk_root}/components/network/wifi_manager/bl60x_wifi_driver/bl_main.c", @@ -708,6 +685,7 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/wifi_manager/bl60x_wifi_driver/wifi_netif.c", #wap_supplicant + "${bl_iot_sdk_root}/components/network/dns_server/src/dns_server.c", "${bl_iot_sdk_root}/components/security/wpa_supplicant/port/os_bl.c", "${bl_iot_sdk_root}/components/security/wpa_supplicant/src/ap/ap_config.c", "${bl_iot_sdk_root}/components/security/wpa_supplicant/src/ap/wpa_auth_ie.c", @@ -753,13 +731,9 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/security/wpa_supplicant/src/wps/wps_registrar.c", "${bl_iot_sdk_root}/components/security/wpa_supplicant/src/wps/wps_validate.c", "${bl_iot_sdk_root}/components/security/wpa_supplicant/test/test_crypto-bl.c", - - "${bl_iot_sdk_root}/components/network/dns_server/src/dns_server.c", ] - libs = [ - "${bl_iot_sdk_root}/components/network/wifi/lib/libwifi.a", - ] + libs = [ "${bl_iot_sdk_root}/components/network/wifi/lib/libwifi.a" ] configs += [ ":${sdk_target_name}_config_BSP_Driver", @@ -769,9 +743,9 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_freertos", ":${sdk_target_name}_config_utils", ] - public_configs = [ - ":${sdk_target_name}_config", - ":${sdk_target_name}_config_wifi" + public_configs = [ + ":${sdk_target_name}_config", + ":${sdk_target_name}_config_wifi", ] deps = [ ":${sdk_target_name}_hosal" ] @@ -816,16 +790,15 @@ template("bl_iot_sdk") { } source_set("${sdk_target_name}_lwip") { - sources = [ "${bl_iot_sdk_root}/components/network/lwip/lwip-port/FreeRTOS/ethernetif.c", "${bl_iot_sdk_root}/components/network/lwip/lwip-port/FreeRTOS/sys_arch.c", ] sources += [ - "${bl_iot_sdk_root}/components/network/lwip/src/netif/slipif.c", "${bl_iot_sdk_root}/components/network/lwip/src/netif/bridgeif.c", "${bl_iot_sdk_root}/components/network/lwip/src/netif/bridgeif_fdb.c", "${bl_iot_sdk_root}/components/network/lwip/src/netif/ethernet.c", + "${bl_iot_sdk_root}/components/network/lwip/src/netif/slipif.c", "${bl_iot_sdk_root}/components/network/lwip/src/netif/zepif.c", ] sources += [ @@ -883,16 +856,12 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/lwip/src/api/sockets.c", "${bl_iot_sdk_root}/components/network/lwip/src/api/tcpip.c", ] - sources += [ - "${bl_iot_sdk_root}/components/network/lwip/src/apps/mdns/mdns.c" - ] - sources += [ - "${bl_iot_sdk_root}/components/network/lwip_dhcpd/dhcp_server_raw.c", - ] + sources += + [ "${bl_iot_sdk_root}/components/network/lwip/src/apps/mdns/mdns.c" ] + sources += + [ "${bl_iot_sdk_root}/components/network/lwip_dhcpd/dhcp_server_raw.c" ] - configs += [ - ":${sdk_target_name}_config_freertos", - ] + configs += [ ":${sdk_target_name}_config_freertos" ] public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_lwip", @@ -901,20 +870,20 @@ template("bl_iot_sdk") { group(sdk_target_name) { public_deps = [ - ":${sdk_target_name}_code", - ":${sdk_target_name}_soc", ":${sdk_target_name}_BSP_Driver", ":${sdk_target_name}_bl602_freertos", - ":${sdk_target_name}_hosal", + ":${sdk_target_name}_blcrypto_suite", + ":${sdk_target_name}_ble", + ":${sdk_target_name}_code", ":${sdk_target_name}_fs", + ":${sdk_target_name}_hosal", ":${sdk_target_name}_libc", + ":${sdk_target_name}_lwip", + ":${sdk_target_name}_soc", ":${sdk_target_name}_stage", ":${sdk_target_name}_sys", ":${sdk_target_name}_utils", - ":${sdk_target_name}_ble", - ":${sdk_target_name}_blcrypto_suite", ":${sdk_target_name}_wifi", - ":${sdk_target_name}_lwip", ] } } diff --git a/third_party/bouffalolab/bl702/bl_iot_sdk.gni b/third_party/bouffalolab/bl702/bl_iot_sdk.gni index 7a23a4901da3c4..9e96105373928a 100644 --- a/third_party/bouffalolab/bl702/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl702/bl_iot_sdk.gni @@ -21,7 +21,6 @@ import("${chip_root}/src/lib/lib.gni") import("${mbedtls_root}/mbedtls.gni") declare_args() { - bl_iot_sdk_root = "${chip_root}/third_party/bouffalolab/repo" enable_cdc_module = false @@ -60,7 +59,7 @@ template("bl_iot_sdk") { if (defined(invoker.include_dirs)) { include_dirs += invoker.include_dirs } - + if (defined(invoker.defines)) { defines += invoker.defines } @@ -73,11 +72,9 @@ template("bl_iot_sdk") { } } - config("${sdk_target_name}_config_soc") { - include_dirs = [ - "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_rf/include" - ] + include_dirs = + [ "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_rf/include" ] } source_set("${sdk_target_name}_soc") { @@ -103,16 +100,13 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/risc-v/Core/Include", "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/soft_crc", "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_std/MCU_Common/misc", - "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Common/platform/" + "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Common/platform/", ] - defines = [ - "bl706_iot", - ] + defines = [ "bl706_iot" ] } source_set("${sdk_target_name}_BSP_Driver") { - sources = [ "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_acomp.c", "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_adc.c", @@ -153,10 +147,8 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_std/BSP_Driver/std_drv/src/bl702_xip_sflash_ext.c", ] - configs += [ - ":${sdk_target_name}_config_freertos", - ] - public_configs = [ + configs += [ ":${sdk_target_name}_config_freertos" ] + public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_BSP_Driver", ] @@ -176,9 +168,7 @@ template("bl_iot_sdk") { source_set("${sdk_target_name}_bl702_freertos") { defines = [ "portasmHANDLE_INTERRUPT=interrupt_entry" ] - include_dirs = [ - "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_freertos/portable/GCC/RISC-V/chip_specific_extensions/RV32F_float_abi_single", - ] + include_dirs = [ "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_freertos/portable/GCC/RISC-V/chip_specific_extensions/RV32F_float_abi_single" ] sources = [ "${bl_iot_sdk_root}/components/platform/soc/bl702/bl702_freertos/event_groups.c", @@ -201,7 +191,7 @@ template("bl_iot_sdk") { "-Wno-old-style-declaration", ] - public_configs = [ + public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_freertos", ] @@ -239,13 +229,11 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/platform/hosal/sec_common", ] - cflags_cc = ["-Wno-literal-suffix"] + cflags_cc = [ "-Wno-literal-suffix" ] } source_set("${sdk_target_name}_hosal") { - defines = [ - "CFG_USE_XTAL32K=1", - ] + defines = [ "CFG_USE_XTAL32K=1" ] sources = [ "${bl_iot_sdk_root}/components/platform/hosal/bl702_hal/bl_adc.c", @@ -293,7 +281,6 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/platform/hosal/bl702_hal/hosal_timer.c", "${bl_iot_sdk_root}/components/platform/hosal/bl702_hal/hosal_uart.c", "${bl_iot_sdk_root}/components/platform/hosal/bl702_hal/hosal_wdg.c", - "${bl_iot_sdk_root}/components/platform/hosal/sec_common/bl_sec_aes.c", "${bl_iot_sdk_root}/components/platform/hosal/sec_common/bl_sec_common.c", "${bl_iot_sdk_root}/components/platform/hosal/sec_common/bl_sec_pka.c", @@ -310,7 +297,7 @@ template("bl_iot_sdk") { "-Wno-stringop-overflow", "-Wno-format-truncation", ] - configs += [ + configs += [ ":${sdk_target_name}_config_soc", ":${sdk_target_name}_config_BSP_Driver", ":${sdk_target_name}_config_stage", @@ -319,16 +306,14 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_utils", ":${sdk_target_name}_config_freertos", ] - public_configs = [ - ":${sdk_target_name}_config", - ":${sdk_target_name}_config_hosal" + public_configs = [ + ":${sdk_target_name}_config", + ":${sdk_target_name}_config_hosal", ] } config("${sdk_target_name}_config_fs") { - include_dirs = [ - "${bl_iot_sdk_root}/components/fs/vfs/include", - ] + include_dirs = [ "${bl_iot_sdk_root}/components/fs/vfs/include" ] } source_set("${sdk_target_name}_fs") { @@ -347,16 +332,16 @@ template("bl_iot_sdk") { "-Wno-sign-compare", "-Wno-builtin-declaration-mismatch", ] - configs += [ - ":${sdk_target_name}_config_hosal", - ":${sdk_target_name}_config_stage", - ":${sdk_target_name}_config_fs", + configs += [ + ":${sdk_target_name}_config_hosal", + ":${sdk_target_name}_config_stage", + ":${sdk_target_name}_config_fs", ":${sdk_target_name}_config_utils", ":${sdk_target_name}_config_freertos", ] - public_configs = [ - ":${sdk_target_name}_config", - ":${sdk_target_name}_config_fs" + public_configs = [ + ":${sdk_target_name}_config", + ":${sdk_target_name}_config_fs", ] } @@ -367,9 +352,7 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/libc/newlibc/syscalls.c", ] cflags_c = [ "-Wno-builtin-declaration-mismatch" ] - configs += [ - ":${sdk_target_name}_config_freertos", - ] + configs += [ ":${sdk_target_name}_config_freertos" ] public_configs = [ ":${sdk_target_name}_config" ] } @@ -385,7 +368,6 @@ template("bl_iot_sdk") { } source_set("${sdk_target_name}_stage") { - sources = [ "${bl_iot_sdk_root}/components/stage/blfdt/src/fdt.c", "${bl_iot_sdk_root}/components/stage/blfdt/src/fdt_addresses.c", @@ -415,9 +397,9 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_sys", ":${sdk_target_name}_config_utils", ] - public_configs = [ - ":${sdk_target_name}_config", - ":${sdk_target_name}_config_stage" + public_configs = [ + ":${sdk_target_name}_config", + ":${sdk_target_name}_config_stage", ] } @@ -431,10 +413,8 @@ template("bl_iot_sdk") { } source_set("${sdk_target_name}_sys") { - include_dirs = [ - "${bl_iot_sdk_root}/components/sys/bltime/include", - ] - sources = [ + include_dirs = [ "${bl_iot_sdk_root}/components/sys/bltime/include" ] + sources = [ "${bl_iot_sdk_root}/components/sys/blmtd/bl_mtd.c", "${bl_iot_sdk_root}/components/sys/bltime/bl_sys_time.c", ] @@ -444,16 +424,14 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_utils", ":${sdk_target_name}_config_freertos", ] - public_configs = [ + public_configs = [ ":${sdk_target_name}_config", - ":${sdk_target_name}_config_sys" + ":${sdk_target_name}_config_sys", ] } config("${sdk_target_name}_config_utils") { - include_dirs = [ - "${bl_iot_sdk_root}/components/utils/include/", - ] + include_dirs = [ "${bl_iot_sdk_root}/components/utils/include/" ] } source_set("${sdk_target_name}_utils") { @@ -487,9 +465,9 @@ template("bl_iot_sdk") { ":${sdk_target_name}_config_utils", ":${sdk_target_name}_config_freertos", ] - public_configs = [ + public_configs = [ ":${sdk_target_name}_config", - ":${sdk_target_name}_config_utils" + ":${sdk_target_name}_config_utils", ] } @@ -577,11 +555,11 @@ template("bl_iot_sdk") { configs += [ ":${sdk_target_name}_config_BSP_Driver", ":${sdk_target_name}_config_freertos", - ":${sdk_target_name}_config_utils" + ":${sdk_target_name}_config_utils", ] - public_configs = [ - ":${sdk_target_name}_config", - ":${sdk_target_name}_ble_config" + public_configs = [ + ":${sdk_target_name}_config", + ":${sdk_target_name}_ble_config", ] cflags_c = [ @@ -611,7 +589,9 @@ template("bl_iot_sdk") { ] if (thread_port_1_3) { - include_dirs += [ "${bl_iot_sdk_root}/components/network/thread/openthread_utils/include" ] + include_dirs += [ + "${bl_iot_sdk_root}/components/network/thread/openthread_utils/include", + ] } } @@ -638,9 +618,7 @@ template("bl_iot_sdk") { libs = [ "${bl_iot_sdk_root}/components/network/lmac154/lib/liblmac154.a" ] if (thread_port_1_3) { - sources += [ - "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_linkmetric.c", - ] + sources += [ "${bl_iot_sdk_root}/components/network/thread/openthread_port/ot_linkmetric.c" ] libs += [ "${bl_iot_sdk_root}/components/network/thread/openthread_utils/lib/libopenthread_utils.a" ] } @@ -742,16 +720,15 @@ template("bl_iot_sdk") { } source_set("${sdk_target_name}_lwip") { - sources = [ "${bl_iot_sdk_root}/components/network/lwip/lwip-port/FreeRTOS/ethernetif.c", "${bl_iot_sdk_root}/components/network/lwip/lwip-port/FreeRTOS/sys_arch.c", ] sources += [ - "${bl_iot_sdk_root}/components/network/lwip/src/netif/slipif.c", "${bl_iot_sdk_root}/components/network/lwip/src/netif/bridgeif.c", "${bl_iot_sdk_root}/components/network/lwip/src/netif/bridgeif_fdb.c", "${bl_iot_sdk_root}/components/network/lwip/src/netif/ethernet.c", + "${bl_iot_sdk_root}/components/network/lwip/src/netif/slipif.c", "${bl_iot_sdk_root}/components/network/lwip/src/netif/zepif.c", ] sources += [ @@ -809,13 +786,10 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/lwip/src/api/sockets.c", "${bl_iot_sdk_root}/components/network/lwip/src/api/tcpip.c", ] - sources += [ - "${bl_iot_sdk_root}/components/network/lwip/src/apps/mdns/mdns.c" - ] + sources += + [ "${bl_iot_sdk_root}/components/network/lwip/src/apps/mdns/mdns.c" ] - configs += [ - ":${sdk_target_name}_config_freertos", - ] + configs += [ ":${sdk_target_name}_config_freertos" ] public_configs = [ ":${sdk_target_name}_config", ":${sdk_target_name}_config_lwip", @@ -824,16 +798,16 @@ template("bl_iot_sdk") { group(sdk_target_name) { public_deps = [ - ":${sdk_target_name}_soc", ":${sdk_target_name}_BSP_Driver", ":${sdk_target_name}_bl702_freertos", - ":${sdk_target_name}_hosal", + ":${sdk_target_name}_ble", ":${sdk_target_name}_fs", + ":${sdk_target_name}_hosal", ":${sdk_target_name}_libc", + ":${sdk_target_name}_soc", ":${sdk_target_name}_stage", ":${sdk_target_name}_sys", ":${sdk_target_name}_utils", - ":${sdk_target_name}_ble", ] if (chip_enable_openthread) { @@ -846,9 +820,7 @@ template("bl_iot_sdk") { } if (enable_cdc_module) { - public_deps += [ - ":${sdk_target_name}_bl702_usb_cdc", - ] + public_deps += [ ":${sdk_target_name}_bl702_usb_cdc" ] } } } diff --git a/third_party/bouffalolab/common/bouffalolab_executable.gni b/third_party/bouffalolab/common/bouffalolab_executable.gni index 3dd124c911548a..54f4c031ee263c 100644 --- a/third_party/bouffalolab/common/bouffalolab_executable.gni +++ b/third_party/bouffalolab/common/bouffalolab_executable.gni @@ -44,9 +44,7 @@ template("bouffalolab_executable") { ] if (invoker.bl_plat_name == "bl602") { - flashing_script_inputs += [ - "${chip_root}/examples/platform/bouffalolab/${invoker.bl_plat_name}/flash_config/partition_cfg_4M.toml", - ] + flashing_script_inputs += [ "${chip_root}/examples/platform/bouffalolab/${invoker.bl_plat_name}/flash_config/partition_cfg_4M.toml" ] } copy(flashing_runtime_target) { @@ -63,8 +61,7 @@ template("bouffalolab_executable") { flashing_options += [ "--xtal" ] if (invoker.bl_plat_name == "bl602") { flashing_options += [ "40M" ] - } - else if (invoker.bl_plat_name == "bl702") { + } else if (invoker.bl_plat_name == "bl702") { flashing_options += [ "32M" ] }