diff --git a/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h b/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h index c90619bdddc040..0c263fc6ae3cfa 100644 --- a/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h +++ b/src/platform/nxp/common/CHIPNXPPlatformDefaultConfig.h @@ -253,8 +253,3 @@ */ #define CHIP_CONFIG_RMP_DEFAULT_MAX_RETRANS 10 #endif - -#ifndef NXP_USE_MML -/* Do not use Memory Manager Light for dynamic memory allocation by default. */ -#define NXP_USE_MML 0 -#endif // NXP_USE_MML diff --git a/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp b/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp index 09d8a7d266a8ca..dd102217482de3 100644 --- a/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp +++ b/src/platform/nxp/common/DiagnosticDataProviderImpl.cpp @@ -42,17 +42,6 @@ extern "C" { } #endif -#if NXP_USE_MML -#include "fsl_component_mem_manager.h" -#define GetFreeHeapSize MEM_GetFreeHeapSize -#define HEAP_SIZE MinimalHeapSize_c -#define GetMinimumEverFreeHeapSize MEM_GetFreeHeapSizeLowWaterMark -#else -#define GetFreeHeapSize xPortGetFreeHeapSize -#define HEAP_SIZE configTOTAL_HEAP_SIZE -#define GetMinimumEverFreeHeapSize xPortGetMinimumEverFreeHeapSize -#endif // NXP_USE_MML - // Not implement into the SDK // extern "C" void xPortResetHeapMinimumEverFreeHeapSize(void); @@ -68,8 +57,8 @@ DiagnosticDataProviderImpl & DiagnosticDataProviderImpl::GetDefaultInstance() CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapFree(uint64_t & currentHeapFree) { size_t freeHeapSize; - freeHeapSize = GetFreeHeapSize(); + freeHeapSize = xPortGetFreeHeapSize(); currentHeapFree = static_cast(freeHeapSize); return CHIP_NO_ERROR; } @@ -79,8 +68,8 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed(uint64_t & currentHeap size_t freeHeapSize; size_t usedHeapSize; - freeHeapSize = GetFreeHeapSize(); - usedHeapSize = HEAP_SIZE - freeHeapSize; + freeHeapSize = xPortGetFreeHeapSize(); + usedHeapSize = configTOTAL_HEAP_SIZE - freeHeapSize; currentHeapUsed = static_cast(usedHeapSize); return CHIP_NO_ERROR; @@ -90,8 +79,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu { size_t highWatermarkHeapSize; - highWatermarkHeapSize = HEAP_SIZE - GetMinimumEverFreeHeapSize(); - + highWatermarkHeapSize = configTOTAL_HEAP_SIZE - xPortGetMinimumEverFreeHeapSize(); currentHeapHighWatermark = static_cast(highWatermarkHeapSize); return CHIP_NO_ERROR; } @@ -101,16 +89,12 @@ CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() // If implemented, the server SHALL set the value of the CurrentHeapHighWatermark attribute to the // value of the CurrentHeapUsed. -#if NXP_USE_MML - MEM_ResetFreeHeapSizeLowWaterMark(); - - return CHIP_NO_ERROR; -#else // Not implement into the SDK // xPortResetHeapMinimumEverFreeHeapSize(); + // return CHIP_NO_ERROR; + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -#endif } CHIP_ERROR DiagnosticDataProviderImpl::GetThreadMetrics(ThreadMetrics ** threadMetricsOut) diff --git a/src/platform/nxp/common/DiagnosticDataProviderImpl.h b/src/platform/nxp/common/DiagnosticDataProviderImpl.h index 27b2e35365a1c6..5b9fc4c9ae894b 100644 --- a/src/platform/nxp/common/DiagnosticDataProviderImpl.h +++ b/src/platform/nxp/common/DiagnosticDataProviderImpl.h @@ -39,10 +39,6 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider static DiagnosticDataProviderImpl & GetDefaultInstance(); // ===== Methods that implement the PlatformManager abstract interface. - -#if NXP_USE_MML - bool SupportsWatermarks() override { return true; } -#endif CHIP_ERROR GetCurrentHeapFree(uint64_t & currentHeapFree) override; CHIP_ERROR GetCurrentHeapUsed(uint64_t & currentHeapUsed) override; CHIP_ERROR GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) override; diff --git a/src/platform/nxp/mcxw71_k32w1/BUILD.gn b/src/platform/nxp/mcxw71_k32w1/BUILD.gn index 6b399a1c1dbf27..253e21e4ef6a97 100644 --- a/src/platform/nxp/mcxw71_k32w1/BUILD.gn +++ b/src/platform/nxp/mcxw71_k32w1/BUILD.gn @@ -90,15 +90,10 @@ config("nxp_platform_config") { static_library("nxp_platform") { deps = [] - defines = [ - "CHIP_DEVICE_K32W1=1", - "NXP_USE_MML=1", - ] + defines = [ "CHIP_DEVICE_K32W1=1" ] sources = [ "../../SingletonConfigurationManager.cpp", - "../common/DiagnosticDataProviderImpl.cpp", - "../common/DiagnosticDataProviderImpl.h", "../common/ble/BLEManagerCommon.cpp", "../common/ble/BLEManagerCommon.h", "../common/ble/BLEManagerImpl.cpp", @@ -109,6 +104,8 @@ static_library("nxp_platform") { "ConfigurationManagerImpl.h", "ConnectivityManagerImpl.cpp", "ConnectivityManagerImpl.h", + "DiagnosticDataProviderImpl.cpp", + "DiagnosticDataProviderImpl.h", "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", "SystemTimeSupport.cpp",