I am uncertain if your separate email was before or after the comment above.
I suggest that you first get ping-pong DMA transfer working so that it actually works with two buffers.
It is not necessary to abort DMA transfer. You can just read XFERCNT in the XFERCFG and process
all data in buffer up to that point even if DMA continues to run in that buffer. I have not checked the exact order when XFERCNT is updated and when data is stored in memory, but even if data is stored after, there will be number of clock cycles from reading XFERCFG to reading data in DMA buffer.
In user manual, there is a statement in Table 173 that as usual is not completely clear:
XFERCOUNT
Total number of transfers to be performed, minus 1 encoded. The number of bytes
transferred is: (XFERCOUNT + 1) x data width (as defined by the WIDTH field).
Remark: The DMA controller uses this bit field during transfer to count down.
Hence, it cannot be used by software to read back the size of the transfer, for
instance, in an interrupt handler.
This bitfield is counting down during transfer. It would have been clearer if the statement was that it can be read to determine how much is transferred and also if transfer is complete when this bitfield has decremented.