From 2aa6a13ee1561dc9c82da68589dd422fb8128c6c Mon Sep 17 00:00:00 2001 From: Anthony Doud Date: Sat, 26 Apr 2025 22:11:25 -0500 Subject: [PATCH 1/7] Update esp_nimble_cfg.h --- src/nimble/esp_port/port/include/esp_nimble_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nimble/esp_port/port/include/esp_nimble_cfg.h b/src/nimble/esp_port/port/include/esp_nimble_cfg.h index a81162ee..c1a6d1af 100644 --- a/src/nimble/esp_port/port/include/esp_nimble_cfg.h +++ b/src/nimble/esp_port/port/include/esp_nimble_cfg.h @@ -19,7 +19,7 @@ #define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val #ifndef IRAM_ATTR_64MCPU -#define IRAM_ATTR_64MCPU IRAM_ATTR +#define IRAM_ATTR_64MCPU ARDUINO_ISR_ATTR #endif From 25a25215eb049ed47ddeb9bdeaef3bf744efb40f Mon Sep 17 00:00:00 2001 From: Anthony Doud Date: Sat, 26 Apr 2025 22:12:20 -0500 Subject: [PATCH 2/7] Update exp_nimble_mem.c --- src/nimble/esp_port/port/src/exp_nimble_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nimble/esp_port/port/src/exp_nimble_mem.c b/src/nimble/esp_port/port/src/exp_nimble_mem.c index 384f8aca..ca11092a 100644 --- a/src/nimble/esp_port/port/src/exp_nimble_mem.c +++ b/src/nimble/esp_port/port/src/exp_nimble_mem.c @@ -11,7 +11,7 @@ #include "nimconfig.h" #include "../include/esp_nimble_mem.h" - IRAM_ATTR void *nimble_platform_mem_malloc(size_t size) + ARDUINO_ISR_ATTR void *nimble_platform_mem_malloc(size_t size) { #ifdef CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL return heap_caps_malloc(size, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT); @@ -24,7 +24,7 @@ #endif } - IRAM_ATTR void *nimble_platform_mem_calloc(size_t n, size_t size) + ARDUINO_ISR_ATTR void *nimble_platform_mem_calloc(size_t n, size_t size) { #ifdef CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL return heap_caps_calloc(n, size, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT); From 2e74d7674aab96d4d048b1032a7a938b7b4b7a20 Mon Sep 17 00:00:00 2001 From: Anthony Doud Date: Sat, 26 Apr 2025 22:14:13 -0500 Subject: [PATCH 3/7] Update os_msys_init.c --- src/nimble/porting/nimble/src/os_msys_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nimble/porting/nimble/src/os_msys_init.c b/src/nimble/porting/nimble/src/os_msys_init.c index e39f6803..aaf8ec00 100644 --- a/src/nimble/porting/nimble/src/os_msys_init.c +++ b/src/nimble/porting/nimble/src/os_msys_init.c @@ -98,7 +98,7 @@ static struct os_sanity_check os_msys_sc; * @return The msys pool's minimum safe buffer count. */ static int -IRAM_ATTR os_msys_sanity_min_count(int idx) +ARDUINO_ISR_ATTR os_msys_sanity_min_count(int idx) { switch (idx) { case 0: @@ -114,7 +114,7 @@ IRAM_ATTR os_msys_sanity_min_count(int idx) } static int -IRAM_ATTR os_msys_sanity(struct os_sanity_check *sc, void *arg) +ARDUINO_ISR_ATTR os_msys_sanity(struct os_sanity_check *sc, void *arg) { const struct os_mbuf_pool *omp; int min_count; From aadd69741cca8fd5deed361fe15df76fde38f67c Mon Sep 17 00:00:00 2001 From: Anthony Doud Date: Sat, 26 Apr 2025 22:15:58 -0500 Subject: [PATCH 4/7] Update nimble_port.c --- src/nimble/porting/nimble/src/nimble_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nimble/porting/nimble/src/nimble_port.c b/src/nimble/porting/nimble/src/nimble_port.c index f8454eba..9d7779e1 100644 --- a/src/nimble/porting/nimble/src/nimble_port.c +++ b/src/nimble/porting/nimble/src/nimble_port.c @@ -312,7 +312,7 @@ nimble_port_stop(void) } void -IRAM_ATTR nimble_port_run(void) +ARDUINO_ISR_ATTR nimble_port_run(void) { struct ble_npl_event *ev; @@ -328,7 +328,7 @@ IRAM_ATTR nimble_port_run(void) } struct ble_npl_eventq * -IRAM_ATTR nimble_port_get_dflt_eventq(void) +ARDUINO_ISR_ATTR nimble_port_get_dflt_eventq(void) { return &g_eventq_dflt; } From 5db8c99f08dd7e4baa641878852d419864af0df5 Mon Sep 17 00:00:00 2001 From: Anthony Doud Date: Sat, 26 Apr 2025 22:21:46 -0500 Subject: [PATCH 5/7] Update exp_nimble_mem.c --- src/nimble/esp_port/port/src/exp_nimble_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nimble/esp_port/port/src/exp_nimble_mem.c b/src/nimble/esp_port/port/src/exp_nimble_mem.c index ca11092a..384f8aca 100644 --- a/src/nimble/esp_port/port/src/exp_nimble_mem.c +++ b/src/nimble/esp_port/port/src/exp_nimble_mem.c @@ -11,7 +11,7 @@ #include "nimconfig.h" #include "../include/esp_nimble_mem.h" - ARDUINO_ISR_ATTR void *nimble_platform_mem_malloc(size_t size) + IRAM_ATTR void *nimble_platform_mem_malloc(size_t size) { #ifdef CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL return heap_caps_malloc(size, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT); @@ -24,7 +24,7 @@ #endif } - ARDUINO_ISR_ATTR void *nimble_platform_mem_calloc(size_t n, size_t size) + IRAM_ATTR void *nimble_platform_mem_calloc(size_t n, size_t size) { #ifdef CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL return heap_caps_calloc(n, size, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT); From 66ca7f9322d9cbac1b5cbf236a5a369f8c788dce Mon Sep 17 00:00:00 2001 From: Anthony Doud Date: Sun, 27 Apr 2025 15:14:15 -0500 Subject: [PATCH 6/7] Removed IRAM/ISR --- src/nimble/esp_port/port/include/esp_nimble_cfg.h | 2 +- src/nimble/esp_port/port/src/exp_nimble_mem.c | 6 +++--- src/nimble/porting/nimble/src/nimble_port.c | 4 ++-- src/nimble/porting/nimble/src/os_msys_init.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/nimble/esp_port/port/include/esp_nimble_cfg.h b/src/nimble/esp_port/port/include/esp_nimble_cfg.h index c1a6d1af..76b4f825 100644 --- a/src/nimble/esp_port/port/include/esp_nimble_cfg.h +++ b/src/nimble/esp_port/port/include/esp_nimble_cfg.h @@ -19,7 +19,7 @@ #define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val #ifndef IRAM_ATTR_64MCPU -#define IRAM_ATTR_64MCPU ARDUINO_ISR_ATTR +#define IRAM_ATTR_64MCPU #endif diff --git a/src/nimble/esp_port/port/src/exp_nimble_mem.c b/src/nimble/esp_port/port/src/exp_nimble_mem.c index 384f8aca..633a4209 100644 --- a/src/nimble/esp_port/port/src/exp_nimble_mem.c +++ b/src/nimble/esp_port/port/src/exp_nimble_mem.c @@ -11,7 +11,7 @@ #include "nimconfig.h" #include "../include/esp_nimble_mem.h" - IRAM_ATTR void *nimble_platform_mem_malloc(size_t size) + void *nimble_platform_mem_malloc(size_t size) { #ifdef CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL return heap_caps_malloc(size, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT); @@ -24,7 +24,7 @@ #endif } - IRAM_ATTR void *nimble_platform_mem_calloc(size_t n, size_t size) + void *nimble_platform_mem_calloc(size_t n, size_t size) { #ifdef CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_INTERNAL return heap_caps_calloc(n, size, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT); @@ -37,7 +37,7 @@ #endif } - IRAM_ATTR void nimble_platform_mem_free(void *ptr) + void nimble_platform_mem_free(void *ptr) { heap_caps_free(ptr); } diff --git a/src/nimble/porting/nimble/src/nimble_port.c b/src/nimble/porting/nimble/src/nimble_port.c index 9d7779e1..3c3f4820 100644 --- a/src/nimble/porting/nimble/src/nimble_port.c +++ b/src/nimble/porting/nimble/src/nimble_port.c @@ -312,7 +312,7 @@ nimble_port_stop(void) } void -ARDUINO_ISR_ATTR nimble_port_run(void) +nimble_port_run(void) { struct ble_npl_event *ev; @@ -328,7 +328,7 @@ ARDUINO_ISR_ATTR nimble_port_run(void) } struct ble_npl_eventq * -ARDUINO_ISR_ATTR nimble_port_get_dflt_eventq(void) +nimble_port_get_dflt_eventq(void) { return &g_eventq_dflt; } diff --git a/src/nimble/porting/nimble/src/os_msys_init.c b/src/nimble/porting/nimble/src/os_msys_init.c index aaf8ec00..b824f793 100644 --- a/src/nimble/porting/nimble/src/os_msys_init.c +++ b/src/nimble/porting/nimble/src/os_msys_init.c @@ -98,7 +98,7 @@ static struct os_sanity_check os_msys_sc; * @return The msys pool's minimum safe buffer count. */ static int -ARDUINO_ISR_ATTR os_msys_sanity_min_count(int idx) +os_msys_sanity_min_count(int idx) { switch (idx) { case 0: @@ -114,7 +114,7 @@ ARDUINO_ISR_ATTR os_msys_sanity_min_count(int idx) } static int -ARDUINO_ISR_ATTR os_msys_sanity(struct os_sanity_check *sc, void *arg) +os_msys_sanity(struct os_sanity_check *sc, void *arg) { const struct os_mbuf_pool *omp; int min_count; From 782fc69da5628f885b858edb8208071c5af84ba4 Mon Sep 17 00:00:00 2001 From: Anthony Doud Date: Sun, 27 Apr 2025 17:58:05 -0700 Subject: [PATCH 7/7] removed unused compiler macro --- src/nimble/esp_port/port/include/esp_nimble_cfg.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/nimble/esp_port/port/include/esp_nimble_cfg.h b/src/nimble/esp_port/port/include/esp_nimble_cfg.h index 76b4f825..4f9d1a15 100644 --- a/src/nimble/esp_port/port/include/esp_nimble_cfg.h +++ b/src/nimble/esp_port/port/include/esp_nimble_cfg.h @@ -18,11 +18,6 @@ #define MYNEWT_VAL(x) MYNEWT_VAL_ ## x #define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val -#ifndef IRAM_ATTR_64MCPU -#define IRAM_ATTR_64MCPU -#endif - - #if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32S3 #define NIMBLE_CFG_CONTROLLER 0 #else