hi Rob,
I confirm that there is not such a command in the driver to get the writing position in the buffer.
One idea would be to extract it from the running task.
If we look at the serial peripheral configuration sd_rx/tx_dma, we shall find the following DMA setup: t
edmaChannelSetup(
sdp->rx_channel, /* channel. */
((vuint32_t)&sdp->linflexlp->BDRM) + 3U, /* src. */
rxbuf, /* dst. */
0, /* soff, do not advance. */
1, /* doff, advance by 1. */
0, /* ssize, 8 bits transfers. */
0, /* dsize, 8 bits transfers. */
1, /* nbytes, always one. */
n, /* iter. */
0, /* slast, no source adjust. */
0, /* dlast, no dest.adjust. */
EDMA_TCD_MODE_DREQ | EDMA_TCD_MODE_INT_END); /* mode. */
It should be sufficient to extract the information from "iter" from the DMA running node. This value should be decremented with every transmission.
Num_bytes_transferred = 1 * edmaGetTCD(***).n
I hope this could work.