From 8d8da1d7ed62cb0ab95f17524617c471c3310da9 Mon Sep 17 00:00:00 2001 From: Abhinav Kudnar Date: Fri, 22 Nov 2024 16:36:34 +0800 Subject: [PATCH] fix(nimble): Resolved watchdog due to memory exceed prints --- components/bt/host/nimble/nimble | 2 +- components/bt/porting/mem/bt_osi_mem.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 0255fee0e6..a37b3a2904 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 0255fee0e6417595cb6e5a8affbc3562098647ce +Subproject commit a37b3a2904c1c93a18e3bcf7853d9dc894c7fe80 diff --git a/components/bt/porting/mem/bt_osi_mem.c b/components/bt/porting/mem/bt_osi_mem.c index b5173fba79..d6bb800a49 100644 --- a/components/bt/porting/mem/bt_osi_mem.c +++ b/components/bt/porting/mem/bt_osi_mem.c @@ -10,6 +10,7 @@ #include "esp_log.h" #include +static uint8_t log_count; IRAM_ATTR void *bt_osi_mem_malloc(size_t size) { void *mem = NULL; @@ -22,8 +23,12 @@ IRAM_ATTR void *bt_osi_mem_malloc(size_t size) #else mem = malloc(size); #endif - if(!mem){ - ESP_LOGI("ESP_LOG_INFO","malloc failed (size %zu)",size); + if (!mem) { + log_count ++; + if ((log_count % 40) == 0) { + esp_rom_printf("malloc failed (size %zu)",size); + log_count = 0; + } assert(mem != NULL); } return mem;