From 9770933ba1f21eebd7660d939d52de0ffde06461 Mon Sep 17 00:00:00 2001 From: Marius Tache Date: Tue, 26 Jul 2022 02:37:23 -0700 Subject: [PATCH] [MATTER-247][K32W0] Enable dynamic allocation of packet buffers * increased maximum number of fabrics supported * RAM1 is now entirely reserved for heap usage Signed-off-by: Marius Tache --- .../nxp/k32w/k32w0/include/CHIPProjectConfig.h | 2 +- .../lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h | 2 +- examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h | 2 +- .../nxp/k32w/k32w0/app/ldscripts/chip-k32w0x-linker.ld | 3 +-- src/platform/nxp/k32w/k32w0/SystemPlatformConfig.h | 2 +- third_party/nxp/k32w0_sdk/k32w0_sdk.gni | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 940ff593ab7b06..ed5afc2b7eb3e7 100755 --- a/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/contact-sensor-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -136,7 +136,7 @@ * provision the device with its unique operational credentials and manage * its own access control lists. */ -#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 5 // 5 is the minimum number of supported fabrics #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 #define CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL 1000_ms32 diff --git a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index e0b01be6a7a421..f2d3fcfd9a4f51 100644 --- a/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lighting-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -126,7 +126,7 @@ * provision the device with its unique operational credentials and manage * its own access control lists. */ -#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 5 // 5 is the minimum number of supported fabrics /** * @def CHIP_IM_MAX_NUM_COMMAND_HANDLER diff --git a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h index 26b42ea1acd871..ea40d95068a6e5 100644 --- a/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h +++ b/examples/lock-app/nxp/k32w/k32w0/include/CHIPProjectConfig.h @@ -126,7 +126,7 @@ * provision the device with its unique operational credentials and manage * its own access control lists. */ -#define CHIP_CONFIG_MAX_FABRICS 4 // 3 fabrics + 1 for rotation slack +#define CHIP_CONFIG_MAX_FABRICS 5 // 5 is the minimum number of supported fabrics #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 #define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 1000_ms32 diff --git a/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w0x-linker.ld b/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w0x-linker.ld index 359a9ef790336d..aa9706324d8a6b 100644 --- a/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w0x-linker.ld +++ b/examples/platform/nxp/k32w/k32w0/app/ldscripts/chip-k32w0x-linker.ld @@ -213,9 +213,8 @@ SECTIONS _etext = .; - .heap_packet_buffer (COPY): + .heap (COPY): { - *(.bss._ZN4chip6System12PacketBuffer11sBufferPoolE) __HeapBase = .; _heap = .; KEEP(*(.heap*)) diff --git a/src/platform/nxp/k32w/k32w0/SystemPlatformConfig.h b/src/platform/nxp/k32w/k32w0/SystemPlatformConfig.h index f9bbb7cee49701..bda39157039697 100644 --- a/src/platform/nxp/k32w/k32w0/SystemPlatformConfig.h +++ b/src/platform/nxp/k32w/k32w0/SystemPlatformConfig.h @@ -37,6 +37,6 @@ struct ChipDeviceEvent; // ==================== Platform Adaptations ==================== #define CHIP_SYSTEM_CONFIG_PLATFORM_PROVIDES_TIME 1 #define CHIP_SYSTEM_CONFIG_EVENT_OBJECT_TYPE const struct ::chip::DeviceLayer::ChipDeviceEvent * -#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 9 +#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 0 // ========== Platform-specific Configuration Overrides ========= diff --git a/third_party/nxp/k32w0_sdk/k32w0_sdk.gni b/third_party/nxp/k32w0_sdk/k32w0_sdk.gni index 22efd74b022580..2131cd4548f272 100755 --- a/third_party/nxp/k32w0_sdk/k32w0_sdk.gni +++ b/third_party/nxp/k32w0_sdk/k32w0_sdk.gni @@ -245,7 +245,7 @@ template("k32w0_sdk") { "USE_SDK_OSA=0", "gSerialManagerMaxInterfaces_c=2", "FSL_RTOS_FREE_RTOS=1", - "gTotalHeapSize_c=0xC700", + "gTotalHeapSize_c=0x10000", "gUartDebugConsole_d=1", "DEBUG_SERIAL_INTERFACE_INSTANCE=0", "APP_SERIAL_INTERFACE_INSTANCE=1",