Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bouffalolab] Update resource configuration #25641

Merged
merged 2 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/lighting-app/bouffalolab/bl602/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ bl_iot_sdk("sdk") {

defines = [
"INCLUDE_xSemaphoreGetMutexHolder=1",
"OTA_PERIODIC_TIMEOUT=${ota_periodic_query_timeout}",
"CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE=${setupPinCode}",
"OTA_PERIODIC_QUERY_TIMEOUT=${ota_periodic_query_timeout}",
"CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR=${setupDiscriminator}",
"OTA_PERIODIC_TIMEOUT=${ota_periodic_query_timeout}",
"CHIP_UART_BAUDRATE=${baudrate}",
"SYS_AOS_LOOP_ENABLE",
]
Expand Down
4 changes: 3 additions & 1 deletion examples/lighting-app/bouffalolab/bl602/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@
#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
#endif
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00

#ifndef CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
#endif
// For convenience, Chip Security Test Mode can be enabled and the
// requirement for authentication in various protocols can be disabled.
//
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/bouffalolab/bl702/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,4 @@

#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"
7 changes: 3 additions & 4 deletions src/lwip/bl702/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@

#define LWIP_IPV4 0
#define LWIP_IPV6 1
#define LWIP_IPV6_ROUTE_TABLE_SUPPORT 1
#define LWIP_ARP (0)
#define LWIP_DNS (0)
#define LWIP_ICMP (0)
Expand All @@ -92,8 +91,8 @@
#define MEMP_SEPARATE_POOLS (1)
#define LWIP_PBUF_FROM_CUSTOM_POOLS (0)
#define MEMP_USE_CUSTOM_POOLS (0)
#define PBUF_POOL_SIZE (10)
#define PBUF_POOL_BUFSIZE (1280 + 150)
#define PBUF_POOL_SIZE (8)
#define PBUF_POOL_BUFSIZE (1280)
#define PBUF_CUSTOM_POOL_IDX_START (MEMP_PBUF_POOL_SMALL)
#define PBUF_CUSTOM_POOL_IDX_END (MEMP_PBUF_POOL_LARGE)

Expand All @@ -106,7 +105,7 @@
#define PBUF_LINK_HLEN (0)

#define TCPIP_THREAD_STACKSIZE (2048)
#define TCPIP_THREAD_PRIO (2)
#define TCPIP_THREAD_PRIO (29)

#define NETIF_MAX_HWADDR_LEN 8U

Expand Down
5 changes: 5 additions & 0 deletions src/platform/bouffalolab/BL702/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ CHIP_ERROR ConfigurationManagerImpl::Init()
WriteConfigValue(BL702Config::kCounterKey_RebootCount, rebootCount + 1);
}

if (!BL702Config::ConfigValueExists(BL702Config::kCounterKey_TotalOperationalHours))
{
ReturnErrorOnFailure(StoreTotalOperationalHours(0));
}

// If the fail-safe was armed when the device last shutdown, initiate a factory reset.
if (GetFailSafeArmed(failSafeArmed) == CHIP_NO_ERROR && failSafeArmed)
{
Expand Down
6 changes: 0 additions & 6 deletions src/platform/bouffalolab/BL702/SystemPlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,3 @@ struct ChipDeviceEvent;
#define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_EVENT_FUNCTIONS 1
#define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1
#define CHIP_SYSTEM_CONFIG_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent *

// ========== Platform-specific Configuration Overrides =========

#ifndef CHIP_SYSTEM_CONFIG_NUM_TIMERS
#define CHIP_SYSTEM_CONFIG_NUM_TIMERS 16
#endif // CHIP_SYSTEM_CONFIG_NUM_TIMERS
3 changes: 2 additions & 1 deletion third_party/bouffalolab/bl602/bl_iot_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -836,8 +836,9 @@ template("bl_iot_sdk") {
"LWIP_AUTOIP=1",
"LWIP_IPV6_MLD=1",
"LWIP_ND6_RDNSS_MAX_DNS_SERVERS=1",
"MEMP_NUM_MLD6_GROUP=10",
"PBUF_POOL_SIZE=20",
"PBUF_POOL_BUFSIZE=(1280+150)",
"PBUF_POOL_BUFSIZE=(1600)",
"CONFIG_ENABLE_IPV6_ADDR_CALLBACK",
"CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT",
"CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT",
Expand Down