diff --git a/nimble/host/mesh/src/adv.c b/nimble/host/mesh/src/adv.c index d7a8c123c..0421da028 100644 --- a/nimble/host/mesh/src/adv.c +++ b/nimble/host/mesh/src/adv.c @@ -14,6 +14,7 @@ #include "host/ble_hs_adv.h" #include "host/ble_gap.h" #include "mesh/porting.h" +#include "nimble/nimble_port.h" #include "adv.h" #include "net.h" diff --git a/porting/nimble/include/nimble/nimble_port.h b/porting/nimble/include/nimble/nimble_port.h index 28065cf8e..88511381a 100644 --- a/porting/nimble/include/nimble/nimble_port.h +++ b/porting/nimble/include/nimble/nimble_port.h @@ -22,6 +22,8 @@ #include "nimble/nimble_npl.h" +#define NIMBLE_CORE (CONFIG_NIMBLE_PINNED_TO_CORE < portNUM_PROCESSORS ? CONFIG_NIMBLE_PINNED_TO_CORE : tskNO_AFFINITY) + #ifdef __cplusplus extern "C" { #endif diff --git a/porting/npl/freertos/src/nimble_port_freertos.c b/porting/npl/freertos/src/nimble_port_freertos.c index 583a0319d..a8b50ea13 100644 --- a/porting/npl/freertos/src/nimble_port_freertos.c +++ b/porting/npl/freertos/src/nimble_port_freertos.c @@ -46,6 +46,6 @@ nimble_port_freertos_init(TaskFunction_t host_task_fn) * have separate task for NimBLE host, but since something needs to handle * default queue it is just easier to make separate task which does this. */ - xTaskCreate(host_task_fn, "ble", 2048+400, - NULL, (configMAX_PRIORITIES - 3), &host_task_h); + xTaskCreatePinnedToCore(host_task_fn, "ble", 4096, + NULL, (configMAX_PRIORITIES - 4), &host_task_h, NIMBLE_CORE); }