Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8609

General • Re: RPI Pico 2W Ble & ws2812 on FreeRTOS

$
0
0
I got it working. There were two fundamental issues. Firstly when I copied the ws2812 code from the example, I just chucked it in a FreeRTOS thread without really giving it much attention. It was using a pico-sdk semaphore, which FreeRTOS knows nothing about, and so FreeRTOS wasn't able to give the bluetooth task any cpu time. When I ported over to using FreeRTOS semaphores (and timers, but I don't think this is necessary) the ws2812 task worked successfully.

The second issue isn't well documented as far as I can tell. The btstack examples can be run in one of three "modes": poll, background or rtos. There is a function `btstack_run_loop_execute` which should _only_ be run in poll mode. In background and freeRTOS mode, the bt runner thread/task is set up for you.

Statistics: Posted by richardvodden — Sun May 18, 2025 7:17 am



Viewing all articles
Browse latest Browse all 8609

Trending Articles