Skip to main content
RD'Ig
Associate II
October 15, 2021
Solved

Serial DMA position

  • October 15, 2021
  • 1 reply
  • 1280 views

Hi,

I am developing an application on SPC58EC that uses the serial with DMA for reading.

I'd like to know if there is a way to know and get the position where it's writing in the buffer. I mean something like the corresponding "__HAL_DMA_GET_COUNTER(...)" or to the "...->CNDTR" register of the STM32.

I already use the receive callback that trigger at the end, but it's not enough for my purpose.

Thanks,

Rob

    This topic has been closed for replies.
    Best answer by snafu

    Hi

    Try to look at word4 (TCDn_DADDR) field in used TCD of eDMA. It's updated after minor iteration is completed. It's incremented by the size of the minor tranfer. If minor loop size is 1 byte, it's inceremented on each byte transfer.

    Pavel

    1 reply

    snafu
    snafuBest answer
    Associate II
    October 19, 2021

    Hi

    Try to look at word4 (TCDn_DADDR) field in used TCD of eDMA. It's updated after minor iteration is completed. It's incremented by the size of the minor tranfer. If minor loop size is 1 byte, it's inceremented on each byte transfer.

    Pavel

    RD'Ig
    RD'IgAuthor
    Associate II
    October 27, 2021

    Thanks for the answer, I'll check it out.