Skip to content

Commit

Permalink
bugfix/ble_defines_mem_monitoring (#23531)
Browse files Browse the repository at this point in the history
* Added defines for BLE tasks to allow heap monitoring to get their task handles

* Adjustements to keep previous task names size unless using heap monitoring and to have significative names when using heap monitoring

* Restyled by clang-format

Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Jul 31, 2023
1 parent c23d916 commit 1795225
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ efr32_sdk("sdk") {
"OTA_PERIODIC_TIMEOUT=${OTA_periodic_query_timeout}",
]

if (enable_heap_monitoring) {
defines += [ "HEAP_MONITORING" ]
}

if (chip_enable_pw_rpc) {
defines += [
"HAL_VCOM_ENABLE=1",
Expand Down
6 changes: 6 additions & 0 deletions examples/platform/efr32/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,13 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configUSE_TICKLESS_IDLE_SIMPLE_DEBUG (1) /* See into vPortSuppressTicksAndSleep source code for explanation */
#define configMAX_PRIORITIES (56)
#define configMINIMAL_STACK_SIZE (320) /* Number of words to use for Idle and Timer stacks */

#ifdef HEAP_MONITORING
#define configMAX_TASK_NAME_LEN (24)
#else
#define configMAX_TASK_NAME_LEN (10)
#endif // HEAP_MONITORING

#define configUSE_16_BIT_TICKS (0)
#define configIDLE_SHOULD_YIELD (1)
#define configUSE_MUTEXES (1)
Expand Down
3 changes: 3 additions & 0 deletions examples/platform/efr32/MemMonitoring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include "FreeRTOS.h"
#include <platform/CHIPDeviceLayer.h>

#define BLE_STACK_TASK_NAME "Bluetooth stack"
#define BLE_LINK_TASK_NAME "Bluetooth linklayer"

static StackType_t monitoringStack[MONITORING_STACK_SIZE_byte / sizeof(StackType_t)];
static StaticTask_t monitoringTaskStruct;

Expand Down
2 changes: 1 addition & 1 deletion src/platform/EFR32/CHIPDevicePlatformConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL 0

#ifndef CHIP_DEVICE_CONFIG_BLE_APP_TASK_NAME
#define CHIP_DEVICE_CONFIG_BLE_APP_TASK_NAME "BLE_EVENT"
#define CHIP_DEVICE_CONFIG_BLE_APP_TASK_NAME "Bluetooth event handler"
#endif // CHIP_DEVICE_CONFIG_BLE_APP_TASK_NAME

#define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 25

0 comments on commit 1795225

Please sign in to comment.