Raspberry Pi Pico DISCUSSION

How should two Pico cores share a DMA sampling buffer without corrupting it?

Started by bosbos Pico multicoreDMA buffersbuffer ownershipsynchronizationdata acquisition
3 replies 248 views 4 participants
Latest activity · 27 Sep 2026

How should two Pico cores share a DMA sampling buffer without corrupting it?

bosbos Raspberry Pi Pico Forum
#1

Community replies 3

Re: How should two Pico cores share a DMA sampling buffer without corrupting it?

#2

Give each buffer a clear state such as available, filling, ready or processing. Publish a buffer as ready only after the transfer has completed. The processing core must release it before the acquisition side reuses it; a pointer handed to another core is not an ownership protocol by itself.

Re: How should two Pico cores share a DMA sampling buffer without corrupting it?

#3

Use the SDK's suitable synchronization mechanisms and the architecture's memory-ordering requirements. Volatile alone does not provide a complete multicore synchronization scheme. Keep critical sections short and avoid holding a shared lock while doing lengthy signal processing or formatted logging.

Re: How should two Pico cores share a DMA sampling buffer without corrupting it?

#4

Calculate the block deadline: 256 samples at 16 kHz represent 16 ms. Measure worst-case processing time and define what happens if no free block exists. Count overruns and identify dropped blocks with sequence numbers so extra buffering does not hide a sustained throughput deficit.

TEP COMMUNITY