Skip to content

Commit 42e7c93

Browse files
committed
Merge branch 'bugfix/fix_esp32_bt_sw_intr_v5.5' into 'release/v5.5'
fix(bt): fixed sw_intr issue with BT register or trigger error core on ESP32 (v5.5) See merge request espressif/esp-idf!41633
2 parents d41e9bc + 08b798a commit 42e7c93

File tree

1 file changed

+14
-5
lines changed
  • components/bt/controller/esp32

1 file changed

+14
-5
lines changed

components/bt/controller/esp32/bt.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -882,9 +882,22 @@ static int IRAM_ATTR cause_sw_intr_to_core_wrapper(int core_id, int intr_no)
882882
#if CONFIG_FREERTOS_UNICORE
883883
cause_sw_intr((void *)intr_no);
884884
#else /* CONFIG_FREERTOS_UNICORE */
885+
#if CONFIG_FREERTOS_SMP
886+
uint32_t state = portDISABLE_INTERRUPTS();
887+
#else
888+
uint32_t state = portSET_INTERRUPT_MASK_FROM_ISR();
889+
#endif
885890
if (xPortGetCoreID() == core_id) {
886891
cause_sw_intr((void *)intr_no);
892+
#if CONFIG_FREERTOS_SMP
893+
portRESTORE_INTERRUPTS(state);
894+
} else {
895+
portRESTORE_INTERRUPTS(state);
896+
#else
897+
portCLEAR_INTERRUPT_MASK_FROM_ISR(state);
887898
} else {
899+
portCLEAR_INTERRUPT_MASK_FROM_ISR(state);
900+
#endif
888901
err = esp_ipc_call(core_id, cause_sw_intr, (void *)intr_no);
889902
}
890903
#endif /* !CONFIG_FREERTOS_UNICORE */
@@ -1505,11 +1518,7 @@ static void hli_queue_setup_pinned_to_core(int core_id)
15051518
#if CONFIG_FREERTOS_UNICORE
15061519
hli_queue_setup_cb(NULL);
15071520
#else /* CONFIG_FREERTOS_UNICORE */
1508-
if (xPortGetCoreID() == core_id) {
1509-
hli_queue_setup_cb(NULL);
1510-
} else {
1511-
esp_ipc_call(core_id, hli_queue_setup_cb, NULL);
1512-
}
1521+
esp_ipc_call_blocking(core_id, hli_queue_setup_cb, NULL);
15131522
#endif /* !CONFIG_FREERTOS_UNICORE */
15141523
}
15151524
#endif /* CONFIG_BTDM_CTRL_HLI */

0 commit comments

Comments
 (0)