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

SDK • Re: DMA with PIO working oddly on RP2350B

$
0
0
Got it to work by explicitly specifying 16-bit alignment for msg this way:

Code:

uint16_t __attribute__((aligned(16))) msg[8] = { 
That's calling for 16 _byte_ alignment (which of course will also work).

Code:

uint16_t __attribute__((aligned(4))) msg[8] = { 
would be sufficient for word alignment - but you don't need even that for the transfers as you are doing 16-bit transfers anyhow.

What is actually wrong here (and is fixed by your 16-byte alignment) is that you have configured the DMA in ring mode. Ring mode requires the low order bits of the buffer base address to be zero - or to say the same thing another way, the buffer must be aligned on its own size. Here you have a 16-byte buffer so 16-byte alignment is what you need.

Statistics: Posted by arg001 — Tue Jul 22, 2025 12:29 pm



Viewing all articles
Browse latest Browse all 8093

Trending Articles