Cyw43 PIO SPI always busy waits, even for large transfers #2343

Open
opened 2025-03-10 12:50:36 -05:00 by esky-software · 0 comments
esky-software commented 2025-03-10 12:50:36 -05:00 (Migrated from github.com)

The function cyw43_spi_transfer() busy waits on the transfer DMA channel(s), even for large transfers.
This is far from optimal in an RTOS or other asynchronous environment.

We might use DMA interrupts to handle the completion of the transfer, but this would require some restructuring of the driver code.

More simply, we can estimate the duration of the transfer, and if it's larger than a threshold call cyw43_delay_us() to sleep via the async context before starting the busy wait for the end of the transfer.

The function cyw43_spi_transfer() busy waits on the transfer DMA channel(s), even for large transfers. This is far from optimal in an RTOS or other asynchronous environment. We might use DMA interrupts to handle the completion of the transfer, but this would require some restructuring of the driver code. More simply, we can estimate the duration of the transfer, and if it's larger than a threshold call cyw43_delay_us() to sleep via the async context before starting the busy wait for the end of the transfer.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#2343
No description provided.