talking to myself, hoping somebody could join..
attached is code (not very clean, sorry) that uses bit DMA=1, only in TXCTRL, not in RXCTRL;
used are 4 DMA channels, {0} and [1] for TX side, [2] and [3] for RX side.
The channels [2][3] have to run, despite I didn't want to implement reading from Codec;
but it seems to have to run, probably because trigger <0x4C=> I2S Rx 0 Trigger is needed.
Currently the DMA transfers are running and content of one buffer is transmitted to odd slot, and content of second buffer is transmitted to even slot.
Unfortunately it doesn't run correctly.
- data from DMA channel [1] are correct (data in buffer are 32b, some flags in 16 MSBs + counter in 16 LSBs, samples are incremented +1, correct)
- data from DMA channel {0} are NOT correct (samples are incremented +2 !)
- I don't check channels [2][3], am not interested on RX side yet
DMA channels {0} and [1] are configured the same way, no idea why {0} skips every second sample while [1] runs correctly:
...
descriptor[0].BTCTRL.bit.BLOCKACT = 0x1; // No action at last block, channel disable + block interrupt
descriptor[0].BTCTRL.bit.BEATSIZE = 0x2; // 2 = 32-bit bus transfer, needed for I2S !
descriptor[0].BTCTRL.bit.SRCINC = 0x1; // Source increment is enabled
descriptor[0].BTCTRL.bit.DSTINC = 0x0; // Destination increment disabled
descriptor[0].BTCTRL.bit.STEPSEL = 0x1; // Step applies to Source
descriptor[0].BTCTRL.bit.STEPSIZE = 0x0; // Step size is X1
Any tips ?