I have btstack running in a freertos task on a raspberry pi pico w, waiting for events on a queue. When I send to the queue from another task, the system freezes and the call never returns from xQueueSend:
QueueHandle_t btstack_event_queue;
int main(void) {
stdio_init_all();
btstack_event_queue = xQueueCreate(10, sizeof(unsigned long));
...
}
void ledTask(void *params) {
while (true) {
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1);
vTaskDelay(1000);
cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 0);
vTaskDelay(1000);
unsigned long ulVar = 10UL;
if (btstack_event_queue != 0) {
xQueueSend(btstack_event_queue, (void *)&ulVar, (TickType_t)10);
}
vTaskDelay(1000);
}
}
The bt task contains:
while(true) {
unsigned long event;
if (btstack_event_queue != 0) {
if (xQueueReceive(btstack_event_queue, &event, portMAX_DELAY)) {
// att_server_request_can_send_now_event(con_handle);
}
}
vTaskDelay(5000);
}
The system freezes on the first call to xQueueSend.