From 3035961064d97d1f61fdfacb863cd862def50316 Mon Sep 17 00:00:00 2001 From: wyhong <30567533+wy-hh@users.noreply.github.com> Date: Mon, 23 Jan 2023 03:33:10 +0800 Subject: [PATCH] [Bouffalolab] Improve BL602&BL702 key-value accessing (#24574) * enable hardware crypto engine for mbedtls * remove duplicate dependency * fix restyle * move platform init to platform.cpp * update PSM region * enable ipv6 for wifi sub-module * fix restyle * fix compile error --- .../lighting-app/bouffalolab/bl602/BUILD.gn | 1 + .../bouffalolab/bl602/CHIPProjectConfig.h | 2 + .../lighting-app/bouffalolab/bl702/BUILD.gn | 1 + .../bouffalolab/bl702/CHIPProjectConfig.h | 2 + .../bouffalolab/common/AppTask.cpp | 134 +------------ .../lighting-app/bouffalolab/common/AppTask.h | 9 +- .../bouffalolab/common/ZclCallbacks.cpp | 2 +- .../bl602/flash_config/partition_cfg_2M.toml | 2 +- .../bl602/flash_config/partition_cfg_4M.toml | 2 +- .../bouffalolab/common/plat/MemMonitoring.cpp | 7 +- .../bouffalolab/common/plat/aos_task.c | 5 +- .../platform/bouffalolab/common/plat/main.cpp | 3 +- .../bouffalolab/common/plat/plat.h} | 23 +-- .../bouffalolab/common/plat/platform.cpp | 186 ++++++++++++++++++ .../BL702/DiagnosticDataProviderImpl.cpp | 3 +- third_party/bouffalolab/bl602/bl_iot_sdk.gni | 7 +- third_party/bouffalolab/bl702/bl_iot_sdk.gni | 1 + 17 files changed, 226 insertions(+), 164 deletions(-) rename examples/{lighting-app/bouffalolab/common/AppConfig.h => platform/bouffalolab/common/plat/plat.h} (69%) create mode 100644 examples/platform/bouffalolab/common/plat/platform.cpp diff --git a/examples/lighting-app/bouffalolab/bl602/BUILD.gn b/examples/lighting-app/bouffalolab/bl602/BUILD.gn index 0b341d50c32675..7389d3b0e17b07 100644 --- a/examples/lighting-app/bouffalolab/bl602/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl602/BUILD.gn @@ -110,6 +110,7 @@ bouffalolab_executable("lighting_app") { "${examples_plat_common_dir}/plat/aos_task.c", "${examples_plat_common_dir}/plat/demo_pwm.c", "${examples_plat_common_dir}/plat/main.cpp", + "${examples_plat_common_dir}/plat/platform.cpp", "${examples_plat_common_dir}/plat/uart.c", ] diff --git a/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h b/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h index 9e9934c227c465..3e1a577917a089 100644 --- a/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h +++ b/examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h @@ -146,3 +146,5 @@ #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #define CHIP_SYSTEM_CRYPTO_HEADER_RESERVE_SIZE 128 + +#define CHIP_BLE_DEVICE_NAME "MatterLight" diff --git a/examples/lighting-app/bouffalolab/bl702/BUILD.gn b/examples/lighting-app/bouffalolab/bl702/BUILD.gn index 3204242ceb1c54..6812d95f6de9c1 100644 --- a/examples/lighting-app/bouffalolab/bl702/BUILD.gn +++ b/examples/lighting-app/bouffalolab/bl702/BUILD.gn @@ -122,6 +122,7 @@ bouffalolab_executable("lighting_app") { "${examples_plat_common_dir}/plat/LEDWidget.cpp", "${examples_plat_common_dir}/plat/demo_pwm.c", "${examples_plat_common_dir}/plat/main.cpp", + "${examples_plat_common_dir}/plat/platform.cpp", "${examples_plat_common_dir}/plat/uart.c", ] diff --git a/examples/lighting-app/bouffalolab/bl702/CHIPProjectConfig.h b/examples/lighting-app/bouffalolab/bl702/CHIPProjectConfig.h index e83ec45117296f..eb7eab038c9baa 100644 --- a/examples/lighting-app/bouffalolab/bl702/CHIPProjectConfig.h +++ b/examples/lighting-app/bouffalolab/bl702/CHIPProjectConfig.h @@ -133,3 +133,5 @@ #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #define CHIP_CONFIG_MAX_DEVICE_ADMINS 4 // 3 fabrics + 1 for rotation slack + +#define CHIP_BLE_DEVICE_NAME "MatterLight" diff --git a/examples/lighting-app/bouffalolab/common/AppTask.cpp b/examples/lighting-app/bouffalolab/common/AppTask.cpp index e43dc59564f4cb..49c0e0f3443071 100644 --- a/examples/lighting-app/bouffalolab/common/AppTask.cpp +++ b/examples/lighting-app/bouffalolab/common/AppTask.cpp @@ -17,8 +17,8 @@ * limitations under the License. */ -#include "AppConfig.h" -#include "LEDWidget.h" +#include +#include #include #include @@ -42,10 +42,8 @@ #if CHIP_DEVICE_CONFIG_ENABLE_WIFI #include -#include #include #endif -#include #if HEAP_MONITORING #include "MemMonitoring.h" @@ -58,20 +56,11 @@ #include #endif -#if PW_RPC_ENABLED -#include "PigweedLogger.h" -#include "Rpc.h" -#endif - #if CONFIG_ENABLE_CHIP_SHELL #include #include #endif -#if CONFIG_ENABLE_CHIP_SHELL || PW_RPC_ENABLED -#include "uart.h" -#endif - extern "C" { #include "board.h" #include @@ -84,11 +73,6 @@ extern "C" { namespace { -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI -chip::app::Clusters::NetworkCommissioning::Instance - sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::BLWiFiDriver::GetInstance())); -#endif - #if defined(BL706_NIGHT_LIGHT) || defined(BL602_NIGHT_LIGHT) ColorLEDWidget sLightLED; #else @@ -117,118 +101,6 @@ AppTask AppTask::sAppTask; StackType_t AppTask::appStack[APP_TASK_STACK_SIZE / sizeof(StackType_t)]; StaticTask_t AppTask::appTaskStruct; -void PlatformManagerImpl::PlatformInit(void) -{ -#if CONFIG_ENABLE_CHIP_SHELL || PW_RPC_ENABLED - uartInit(); -#endif - -#if PW_RPC_ENABLED - PigweedLogger::pw_init(); -#elif CONFIG_ENABLE_CHIP_SHELL - AppTask::StartAppShellTask(); -#endif - -#if HEAP_MONITORING - MemMonitoring::startHeapMonitoring(); -#endif - - ChipLogProgress(NotSpecified, "Initializing CHIP stack"); - CHIP_ERROR ret = PlatformMgr().InitChipStack(); - if (ret != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "PlatformMgr().InitChipStack() failed"); - appError(ret); - } - - chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName("MatterLight"); - -#if CHIP_ENABLE_OPENTHREAD - -#if CONFIG_ENABLE_CHIP_SHELL - cmd_otcli_init(); -#endif - - ChipLogProgress(NotSpecified, "Initializing OpenThread stack"); - ret = ThreadStackMgr().InitThreadStack(); - if (ret != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "ThreadStackMgr().InitThreadStack() failed"); - appError(ret); - } - -#if CHIP_DEVICE_CONFIG_THREAD_FTD - ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router); -#else - ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); -#endif - if (ret != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "ConnectivityMgr().SetThreadDeviceType() failed"); - appError(ret); - } - -#elif CHIP_DEVICE_CONFIG_ENABLE_WIFI - - ret = sWiFiNetworkCommissioningInstance.Init(); - if (CHIP_NO_ERROR != ret) - { - ChipLogError(NotSpecified, "sWiFiNetworkCommissioningInstance.Init() failed"); - } -#endif - - chip::DeviceLayer::PlatformMgr().LockChipStack(); - - // Initialize device attestation config - SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); - -#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY - chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(EXT_DISCOVERY_TIMEOUT_SECS); -#endif - - // Init ZCL Data Model - static chip::CommonCaseDeviceServerInitParams initParams; - (void) initParams.InitializeStaticResourcesBeforeServerInit(); - - ret = chip::Server::GetInstance().Init(initParams); - if (ret != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "chip::Server::GetInstance().Init(initParams) failed"); - appError(ret); - } - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); - -#if CHIP_ENABLE_OPENTHREAD - ChipLogProgress(NotSpecified, "Starting OpenThread task"); - // Start OpenThread task - ret = ThreadStackMgrImpl().StartThreadTask(); - if (ret != CHIP_NO_ERROR) - { - ChipLogError(NotSpecified, "ThreadStackMgr().StartThreadTask() failed"); - appError(ret); - } -#endif - - ConfigurationMgr().LogDeviceConfig(); - - PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); - PlatformMgr().AddEventHandler(AppTask::ChipEventHandler, 0); - -#ifdef OTA_ENABLED - chip::DeviceLayer::PlatformMgr().LockChipStack(); - OTAConfig::Init(); - chip::DeviceLayer::PlatformMgr().UnlockChipStack(); -#endif // OTA_ENABLED - -#if PW_RPC_ENABLED - chip::rpc::Init(); -#endif - - GetAppTask().PostEvent(AppTask::APP_EVENT_TIMER); - - vTaskResume(GetAppTask().sAppTaskHandle); -} - void StartAppTask(void) { GetAppTask().sAppTaskHandle = xTaskCreateStatic(GetAppTask().AppTaskMain, APP_TASK_NAME, ArraySize(GetAppTask().appStack), NULL, @@ -298,6 +170,8 @@ void AppTask::AppTaskMain(void * pvParameter) ChipLogError(NotSpecified, "PlatformMgr().StartEventLoopTask() failed"); appError(ret); } + + GetAppTask().PostEvent(AppTask::APP_EVENT_TIMER); vTaskSuspend(NULL); #ifndef LED_BTN_RESET diff --git a/examples/lighting-app/bouffalolab/common/AppTask.h b/examples/lighting-app/bouffalolab/common/AppTask.h index 3aeb06085f1f48..622c1e93ed0001 100644 --- a/examples/lighting-app/bouffalolab/common/AppTask.h +++ b/examples/lighting-app/bouffalolab/common/AppTask.h @@ -1,7 +1,6 @@ /* * * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,6 +30,14 @@ using namespace ::chip; using namespace ::chip::DeviceLayer; +#define APP_BUTTON_PRESS_JITTER 50 +#define APP_BUTTON_PRESS_SHORT 1000 +#define APP_BUTTON_PRESS_LONG 4000 + +#define APP_LIGHT_ENDPOINT_ID 1 +#define APP_REBOOT_RESET_COUNT 3 +#define APP_REBOOT_RESET_COUNT_KEY "app_reset_cnt" + // Application-defined error codes in the CHIP_ERROR space. #define APP_ERROR_EVENT_QUEUE_FAILED CHIP_APPLICATION_ERROR(0x01) #define APP_ERROR_CREATE_TASK_FAILED CHIP_APPLICATION_ERROR(0x02) diff --git a/examples/lighting-app/bouffalolab/common/ZclCallbacks.cpp b/examples/lighting-app/bouffalolab/common/ZclCallbacks.cpp index 963c169c062912..e987fcbd325112 100644 --- a/examples/lighting-app/bouffalolab/common/ZclCallbacks.cpp +++ b/examples/lighting-app/bouffalolab/common/ZclCallbacks.cpp @@ -20,7 +20,7 @@ * This file implements the handler for data model messages. */ -#include "AppConfig.h" +#include #include #include diff --git a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml b/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml index 4705a3891e0a25..eb53723a9f8255 100644 --- a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml +++ b/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_2M.toml @@ -41,7 +41,7 @@ type = 4 name = "PSM" device = 0 address0 = 0x1E9000 -size0 = 0x8000 +size0 = 0x4000 address1 = 0 size1 = 0 # compressed image must set len,normal image can left it to 0 diff --git a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_4M.toml b/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_4M.toml index 4e44d018cea65d..ceb90cc3cb27a2 100644 --- a/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_4M.toml +++ b/examples/platform/bouffalolab/bl602/flash_config/partition_cfg_4M.toml @@ -41,7 +41,7 @@ type = 4 name = "PSM" device = 0 address0 = 0x3C3000 -size0 = 0x33000 +size0 = 0x4000 address1 = 0 size1 = 0 # compressed image must set len,normal image can left it to 0 diff --git a/examples/platform/bouffalolab/common/plat/MemMonitoring.cpp b/examples/platform/bouffalolab/common/plat/MemMonitoring.cpp index e0207285db6928..f4dc267f0bb547 100644 --- a/examples/platform/bouffalolab/common/plat/MemMonitoring.cpp +++ b/examples/platform/bouffalolab/common/plat/MemMonitoring.cpp @@ -16,10 +16,9 @@ * limitations under the License. */ -#include "MemMonitoring.h" - -#include "AppConfig.h" -#include "FreeRTOS.h" +#include +#include +#include #include static StackType_t monitoringStack[MONITORING_STACK_SIZE_byte / sizeof(StackType_t)]; diff --git a/examples/platform/bouffalolab/common/plat/aos_task.c b/examples/platform/bouffalolab/common/plat/aos_task.c index c1451abdd937f8..0f95bfc721f0be 100644 --- a/examples/platform/bouffalolab/common/plat/aos_task.c +++ b/examples/platform/bouffalolab/common/plat/aos_task.c @@ -6,17 +6,18 @@ * web site: https://www.bouffalolab.com/ */ +#ifdef SYS_AOS_LOOP_ENABLE + #include #include -#ifdef SYS_AOS_LOOP_ENABLE #include #include #include #include -#include +#include static void aos_loop_proc(void * pvParameters) { diff --git a/examples/platform/bouffalolab/common/plat/main.cpp b/examples/platform/bouffalolab/common/plat/main.cpp index 690315082458fe..2aa3c99b8dc500 100644 --- a/examples/platform/bouffalolab/common/plat/main.cpp +++ b/examples/platform/bouffalolab/common/plat/main.cpp @@ -25,11 +25,11 @@ #include -#include "AppConfig.h" #include #include #include #include +#include extern "C" { @@ -329,6 +329,7 @@ extern "C" void START_ENTRY(void) app_init(); easyflash_init(); + ef_load_env_cache(); ChipLogProgress(NotSpecified, "Init CHIP Memory"); chip::Platform::MemoryInit(NULL, 0); diff --git a/examples/lighting-app/bouffalolab/common/AppConfig.h b/examples/platform/bouffalolab/common/plat/plat.h similarity index 69% rename from examples/lighting-app/bouffalolab/common/AppConfig.h rename to examples/platform/bouffalolab/common/plat/plat.h index 2c35d9bdd4677b..8235304f42c551 100644 --- a/examples/lighting-app/bouffalolab/common/AppConfig.h +++ b/examples/platform/bouffalolab/common/plat/plat.h @@ -1,7 +1,6 @@ /* * * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2019 Google LLC. * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,30 +18,14 @@ #pragma once -// ---- Lighting Example App Config ---- - #define APP_TASK_NAME "APP" - -#define APP_BUTTON_PRESS_JITTER 50 -#define APP_BUTTON_PRESS_SHORT 1000 -#define APP_BUTTON_PRESS_LONG 4000 - #define APP_TASK_PRIORITY 15 -#define EXT_DISCOVERY_TIMEOUT_SECS 20 -#define APP_LIGHT_ENDPOINT_ID 1 -#define APP_REBOOT_RESET_COUNT 3 -#define APP_REBOOT_RESET_COUNT_KEY "app_reset_cnt" -#ifdef __cplusplus -extern "C" { -#endif - -#define BL_LOG(...) printf(__VA_ARGS__); -void appError(int err); +#define EXT_DISCOVERY_TIMEOUT_SECS 20 #ifdef __cplusplus -} - #include void appError(CHIP_ERROR error); +#else +void appError(int err); #endif diff --git a/examples/platform/bouffalolab/common/plat/platform.cpp b/examples/platform/bouffalolab/common/plat/platform.cpp new file mode 100644 index 00000000000000..75dc55b3ec781c --- /dev/null +++ b/examples/platform/bouffalolab/common/plat/platform.cpp @@ -0,0 +1,186 @@ +/* + * + * Copyright (c) 2020 Project CHIP Authors + * All rights reserved. + * + * 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef OTA_ENABLED +#include "OTAConfig.h" +#endif // OTA_ENABLED + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI +#include +#include +#endif +#include + +#if HEAP_MONITORING +#include +#include +#endif + +#if CHIP_ENABLE_OPENTHREAD +#include +#include +#include +#include +#endif + +#if CONFIG_ENABLE_CHIP_SHELL +#include +#include +#endif + +#if PW_RPC_ENABLED +#include "PigweedLogger.h" +#include "Rpc.h" +#endif + +#if CONFIG_ENABLE_CHIP_SHELL || PW_RPC_ENABLED +#include "uart.h" +#endif + +#include +#include + +using namespace ::chip; +using namespace ::chip::app; +using namespace ::chip::Credentials; +using namespace ::chip::DeviceLayer; + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI +namespace { +chip::app::Clusters::NetworkCommissioning::Instance + sWiFiNetworkCommissioningInstance(0 /* Endpoint Id */, &(NetworkCommissioning::BLWiFiDriver::GetInstance())); +} +#endif + +void PlatformManagerImpl::PlatformInit(void) +{ +#if CONFIG_ENABLE_CHIP_SHELL || PW_RPC_ENABLED + uartInit(); +#endif + +#if PW_RPC_ENABLED + PigweedLogger::pw_init(); +#elif CONFIG_ENABLE_CHIP_SHELL + AppTask::StartAppShellTask(); +#endif + +#if HEAP_MONITORING + MemMonitoring::startHeapMonitoring(); +#endif + + ChipLogProgress(NotSpecified, "Initializing CHIP stack"); + CHIP_ERROR ret = PlatformMgr().InitChipStack(); + if (ret != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "PlatformMgr().InitChipStack() failed"); + appError(ret); + } + + chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(CHIP_BLE_DEVICE_NAME); + +#if CHIP_ENABLE_OPENTHREAD + +#if CONFIG_ENABLE_CHIP_SHELL + cmd_otcli_init(); +#endif + + ChipLogProgress(NotSpecified, "Initializing OpenThread stack"); + ret = ThreadStackMgr().InitThreadStack(); + if (ret != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "ThreadStackMgr().InitThreadStack() failed"); + appError(ret); + } + +#if CHIP_DEVICE_CONFIG_THREAD_FTD + ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router); +#else + ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); +#endif + if (ret != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "ConnectivityMgr().SetThreadDeviceType() failed"); + appError(ret); + } + +#elif CHIP_DEVICE_CONFIG_ENABLE_WIFI + + ret = sWiFiNetworkCommissioningInstance.Init(); + if (CHIP_NO_ERROR != ret) + { + ChipLogError(NotSpecified, "sWiFiNetworkCommissioningInstance.Init() failed"); + } +#endif + + chip::DeviceLayer::PlatformMgr().LockChipStack(); + + // Initialize device attestation config + SetDeviceAttestationCredentialsProvider(Examples::GetExampleDACProvider()); + +#if CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY + chip::app::DnssdServer::Instance().SetExtendedDiscoveryTimeoutSecs(EXT_DISCOVERY_TIMEOUT_SECS); +#endif + + // Init ZCL Data Model + static chip::CommonCaseDeviceServerInitParams initParams; + (void) initParams.InitializeStaticResourcesBeforeServerInit(); + + ret = chip::Server::GetInstance().Init(initParams); + if (ret != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "chip::Server::GetInstance().Init(initParams) failed"); + appError(ret); + } + chip::DeviceLayer::PlatformMgr().UnlockChipStack(); + +#if CHIP_ENABLE_OPENTHREAD + ChipLogProgress(NotSpecified, "Starting OpenThread task"); + // Start OpenThread task + ret = ThreadStackMgrImpl().StartThreadTask(); + if (ret != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "ThreadStackMgr().StartThreadTask() failed"); + appError(ret); + } +#endif + + ConfigurationMgr().LogDeviceConfig(); + + PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); + PlatformMgr().AddEventHandler(AppTask::ChipEventHandler, 0); + +#ifdef OTA_ENABLED + chip::DeviceLayer::PlatformMgr().LockChipStack(); + OTAConfig::Init(); + chip::DeviceLayer::PlatformMgr().UnlockChipStack(); +#endif // OTA_ENABLED + +#if PW_RPC_ENABLED + chip::rpc::Init(); +#endif + + vTaskResume(GetAppTask().sAppTaskHandle); +} diff --git a/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp b/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp index 5cc8f9137f5a8f..9d12fab7ce517c 100644 --- a/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp +++ b/src/platform/bouffalolab/BL702/DiagnosticDataProviderImpl.cpp @@ -23,8 +23,7 @@ #include -#include "AppConfig.h" -#include "FreeRTOS.h" +#include using namespace ::chip::app::Clusters::GeneralDiagnostics; diff --git a/third_party/bouffalolab/bl602/bl_iot_sdk.gni b/third_party/bouffalolab/bl602/bl_iot_sdk.gni index a36b8bc6a210b9..c52a5dbdcdbfb6 100644 --- a/third_party/bouffalolab/bl602/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl602/bl_iot_sdk.gni @@ -355,6 +355,8 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/stage/yloop/src/select.c", "${bl_iot_sdk_root}/components/stage/yloop/src/yloop.c", ] + + defines = [ "EF_ENV_CACHE_TABLE_SIZE=32" ] cflags_c = [ "-Wno-sign-compare" ] configs += [ ":${sdk_target_name}_config_BSP_Driver", @@ -682,7 +684,10 @@ template("bl_iot_sdk") { } source_set("${sdk_target_name}_wifi") { - defines = [ "BL602_MATTER_SUPPORT" ] + defines = [ + "BL602_MATTER_SUPPORT", + "LWIP_IPV6", + ] include_dirs = [ "${bl_iot_sdk_root}/components/os/bl_os_adapter/bl_os_adapter", diff --git a/third_party/bouffalolab/bl702/bl_iot_sdk.gni b/third_party/bouffalolab/bl702/bl_iot_sdk.gni index 5ce11ad0a384a6..307471133c2c0d 100644 --- a/third_party/bouffalolab/bl702/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl702/bl_iot_sdk.gni @@ -385,6 +385,7 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/stage/yloop/src/select.c", "${bl_iot_sdk_root}/components/stage/yloop/src/yloop.c", ] + defines = [ "EF_ENV_CACHE_TABLE_SIZE=32" ] cflags_c = [ "-Wno-sign-compare" ] configs += [ ":${sdk_target_name}_config_BSP_Driver",