diff --git a/examples/lighting-app/bouffalolab/README.md b/examples/lighting-app/bouffalolab/README.md index b8a2661f2a80fe..83ff6a87b6a0f4 100644 --- a/examples/lighting-app/bouffalolab/README.md +++ b/examples/lighting-app/bouffalolab/README.md @@ -80,31 +80,33 @@ Mac OS. ## Build CHIP Lighting App example -The following steps take examples for `BL602-IoT-Matter-V1` bl602 board, BL706 -develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board . +The following steps take examples for `BL602-IoT-Matter-V1` BL602 board, +`BL706DK` BL706 board, and `BL704LDK` BL704L board . - Build lighting app with UART baudrate 2000000 ``` ./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light build - ./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light build - ./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light build + ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light build ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-ethernet build ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-wifi build + ./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light build ``` - Build lighting app with UART baudrate 115200 ``` ./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light-115200 build - ./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-115200 build + ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-light-115200 build + ./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light-light-115200 build ``` - Build lighting app with RPC enabled and UART baudrate 115200. ``` ./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light-rpc build - ./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-rpc build + ./scripts/build/build_examples.py --target bouffalolab-bl706dk-light-light-rpc build + ./scripts/build/build_examples.py --target bouffalolab-bl704ldk-light-light-rpc build ``` ### Build options with build_examples.py @@ -165,19 +167,19 @@ develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board . - Type following command for image download. Please set serial port accordingly, here we use /dev/ttyACM0 as a serial port example. - - `bl602-iot-matter-v1`, `xt-zb6-devkit` and `bl704ldk` without - additional build options + - `bl602-iot-matter-v1`, `bl706dk` and `bl704ldk` without additional + build options ```shell ./out/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 - ./out/bouffalolab-xt-zb6-devkit-light/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl706dk-light/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 ./out/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 ``` - - `xt-zb6-devkit` with 115200 baudrate setting + - `bl706dk` with 115200 baudrate setting ```shell - ./out/bouffalolab-xt-zb6-devkit-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 + ./out/bouffalolab-bl706dk-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 ``` - To wipe out flash and download image, please append `--erase` to the @@ -185,7 +187,7 @@ develop `XT-ZB6-DevKit` and `BL706DK` bl706 board, and `BL704LDK` BL704L board . ```shell ./out/bouffalolab-bl602-iot-matter-v1-light/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0 --erase - ./out/bouffalolab-xt-zb6-devkit-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 --erase + ./out/bouffalolab-bl706dk-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0 --erase ./out/bouffalolab-bl704ldk-light/chip-bl702l-lighting-example.flash.py --port /dev/ttyACM0 --erase ``` diff --git a/examples/platform/bouffalolab/common/iot_sdk/platform_port.cpp b/examples/platform/bouffalolab/common/iot_sdk/platform_port.cpp index 55748704056a82..2326ff96bbec4d 100644 --- a/examples/platform/bouffalolab/common/iot_sdk/platform_port.cpp +++ b/examples/platform/bouffalolab/common/iot_sdk/platform_port.cpp @@ -53,6 +53,8 @@ extern "C" { #include #if CHIP_DEVICE_LAYER_TARGET_BL602 #include +#elif CHIP_DEVICE_LAYER_TARGET_BL702L +#include #endif #if CHIP_DEVICE_LAYER_TARGET_BL702L @@ -373,9 +375,10 @@ extern "C" void app_init(void) bl_sys_early_init(); #if CHIP_DEVICE_LAYER_TARGET_BL702L + bl_flash_init(); + rom_freertos_init(256, 400); rom_hal_init(); - rom_lmac154_hook_init(); #endif hosal_uart_init(&uart_stdio); diff --git a/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp b/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp index 2b09225b2259c2..7ee773fafb5b20 100644 --- a/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp @@ -22,9 +22,7 @@ #endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI #if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET -extern "C" { -#include -} +#include "EthernetInterface.h" #endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET namespace chip { @@ -45,7 +43,7 @@ CHIP_ERROR ConfigurationManagerImpl::GetPrimaryMACAddress(MutableByteSpan buf) if (buf.size() != ConfigurationManager::kPrimaryMACAddressLength) return CHIP_ERROR_INVALID_ARGUMENT; - eth_get_mac(buf.data()); + memcpy(buf.data(), deviceInterface_getNetif()->hwaddr, ConfigurationManager::kPrimaryMACAddressLength); return CHIP_NO_ERROR; } diff --git a/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp b/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp index 1edc80bb21eed4..a9c532d93f69ce 100644 --- a/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702/PlatformManagerImpl.cpp @@ -44,7 +44,7 @@ extern "C" { namespace chip { namespace DeviceLayer { -extern "C" void bl_rand_stream(unsigned char *, int); +extern "C" int bl_rand_stream(unsigned char *, int); static int app_entropy_source(void * data, unsigned char * output, size_t len, size_t * olen) { diff --git a/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp b/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp index 3072f3aa26dcab..ef9adadc941d8c 100644 --- a/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp +++ b/src/platform/bouffalolab/BL702L/PlatformManagerImpl.cpp @@ -36,7 +36,7 @@ namespace chip { namespace DeviceLayer { extern "C" void (*ot_otrNotifyEvent_ptr)(ot_system_event_t sevent); -extern "C" void bl_rand_stream(unsigned char *, int); +extern "C" int bl_rand_stream(unsigned char *, int); extern "C" void otrNotifyEvent(ot_system_event_t sevent); static int app_entropy_source(void * data, unsigned char * output, size_t len, size_t * olen) diff --git a/src/platform/bouffalolab/common/SystemPlatformConfig.h b/src/platform/bouffalolab/common/SystemPlatformConfig.h index 3b821b14b5d43d..0441601762ced5 100644 --- a/src/platform/bouffalolab/common/SystemPlatformConfig.h +++ b/src/platform/bouffalolab/common/SystemPlatformConfig.h @@ -31,4 +31,4 @@ struct ChipDeviceEvent; #define CHIP_SYSTEM_CONFIG_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent * // #define CHIP_CONFIG_SHA256_CONTEXT_SIZE sizeof(bl_sha_ctx_t) -#define CHIP_CONFIG_SHA256_CONTEXT_SIZE ((1 + 5 + 18 + 16 + 16) * sizeof(unsigned int)) +#define CHIP_CONFIG_SHA256_CONTEXT_SIZE ((7 + 1 + 5 + 18 + 16 + 16 + 7) * sizeof(unsigned int)) diff --git a/third_party/bouffalolab/bl602/bl_iot_sdk.gni b/third_party/bouffalolab/bl602/bl_iot_sdk.gni index d8dd045698bda1..a9acca8efd19f4 100644 --- a/third_party/bouffalolab/bl602/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl602/bl_iot_sdk.gni @@ -272,8 +272,10 @@ template("bl_iot_sdk") { "${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_ghash.c", "${bl_iot_sdk_root}/components/platform/hosal/sec_common/bl_sec_pka.c", "${bl_iot_sdk_root}/components/platform/hosal/sec_common/bl_sec_sha.c", + "${bl_iot_sdk_root}/components/platform/hosal/sec_common/bl_sec_trng.c", ] cflags_c = [ @@ -454,6 +456,7 @@ template("bl_iot_sdk") { cflags_c = [ "-Wno-shadow", "-Wno-sign-compare", + "-Wno-incompatible-pointer-types", ] configs += [ ":${sdk_target_name}_config_hosal", @@ -569,7 +572,6 @@ template("bl_iot_sdk") { "CFG_CON=1", "CFG_BLE", "CFG_SLEEP", - "CFG_BT_RESET", "CONFIG_BT_PERIPHERAL=1", "CFG_BLE_TX_BUFF_DATA=2", "CONFIG_BT_GATT_DYNAMIC_DB", @@ -621,7 +623,6 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/ble/blestack/src/common/work_q.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/hci_onchip/hci_driver.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/att.c", - "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/bl_host_assist.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/conn.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/crypto.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/gatt.c", @@ -866,14 +867,13 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/lwip/lwip-port", "${bl_iot_sdk_root}/components/network/lwip/lwip-port/FreeRTOS", "${bl_iot_sdk_root}/components/network/lwip/lwip-port/hook", + "${bl_iot_sdk_root}/components/network/lwip_dhcpd", ] defines = [ "LWIP_IPV6=1" ] } source_set("${sdk_target_name}_lwip") { - include_dirs = [ "${bl_iot_sdk_root}/components/network/lwip_dhcpd" ] - 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", diff --git a/third_party/bouffalolab/bl702/bl_iot_sdk.gni b/third_party/bouffalolab/bl702/bl_iot_sdk.gni index 1a8db3440e12f5..41f4c7fb7310a0 100644 --- a/third_party/bouffalolab/bl702/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl702/bl_iot_sdk.gni @@ -502,6 +502,7 @@ template("bl_iot_sdk") { cflags_c = [ "-Wno-shadow", "-Wno-sign-compare", + "-Wno-incompatible-pointer-types", ] configs += [ ":${sdk_target_name}_config_hosal", @@ -624,7 +625,6 @@ template("bl_iot_sdk") { "CFG_CON=1", "CFG_BLE", "CFG_SLEEP", - "CFG_BT_RESET", "CONFIG_BT_PERIPHERAL=1", "CFG_BLE_TX_BUFF_DATA=2", "CONFIG_BT_GATT_DYNAMIC_DB", @@ -676,7 +676,6 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/ble/blestack/src/common/work_q.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/hci_onchip/hci_driver.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/att.c", - "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/bl_host_assist.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/conn.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/crypto.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/gatt.c", diff --git a/third_party/bouffalolab/bl702l/bl_iot_sdk.gni b/third_party/bouffalolab/bl702l/bl_iot_sdk.gni index c0fdd3e41d3b8f..2041432e3178bd 100644 --- a/third_party/bouffalolab/bl702l/bl_iot_sdk.gni +++ b/third_party/bouffalolab/bl702l/bl_iot_sdk.gni @@ -426,6 +426,7 @@ template("bl_iot_sdk") { cflags_c = [ "-Wno-shadow", "-Wno-sign-compare", + "-Wno-incompatible-pointer-types", ] configs += [ ":${sdk_target_name}_config_bl702l_rom_a0", @@ -549,7 +550,6 @@ template("bl_iot_sdk") { "CFG_CON=1", "CFG_BLE", "CFG_SLEEP", - "CFG_BT_RESET", "CONFIG_BT_PERIPHERAL=1", "CFG_BLE_TX_BUFF_DATA=2", "CONFIG_BT_GATT_DYNAMIC_DB", @@ -606,7 +606,6 @@ template("bl_iot_sdk") { "${bl_iot_sdk_root}/components/network/ble/blestack/src/common/work_q.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/hci_onchip/hci_driver.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/att.c", - "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/bl_host_assist.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/conn.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/crypto.c", "${bl_iot_sdk_root}/components/network/ble/blestack/src/host/gatt.c", diff --git a/third_party/bouffalolab/repo b/third_party/bouffalolab/repo index f65861db5bee5b..a57482f469fe2b 160000 --- a/third_party/bouffalolab/repo +++ b/third_party/bouffalolab/repo @@ -1 +1 @@ -Subproject commit f65861db5bee5b24aeeae5b6039cefabcdc57294 +Subproject commit a57482f469fe2bbe4ab96b5b6034550ab61a302e