Skip to content

Commit

Permalink
Merge branch 'bugfix/resolve_watchdog_crash_v5.4' into 'release/v5.4'
Browse files Browse the repository at this point in the history
fix(nimble): Resolved watchdog due to memory exceed prints (v5.4)

See merge request espressif/esp-idf!35209
  • Loading branch information
rahult-github committed Nov 28, 2024
2 parents 830d836 + 2f6a7ec commit 5af12cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/bt/host/nimble/nimble
9 changes: 7 additions & 2 deletions components/bt/porting/mem/bt_osi_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "esp_log.h"
#include <assert.h>

static uint8_t log_count;
IRAM_ATTR void *bt_osi_mem_malloc(size_t size)
{
void *mem = NULL;
Expand All @@ -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;
Expand Down

0 comments on commit 5af12cf

Please sign in to comment.