Skip to main content
ANaga.2
Associate III
November 24, 2020
Question

DMA in circular mode CNDTR issue

  • November 24, 2020
  • 2 replies
  • 3074 views

Hi,

I am trying to recieve unknown number of bytes using DMA in circular mode. My buffer size is 2048.

After reaching this size, CNDTR becomes 0 and never reinitialized again. It stays 0 always.

The bytes coming after are getting lost.

Has anyone faced similar issue?

Thanks,

Ankush

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
November 24, 2020

Well, then it's not set in circular mode. Read out and check/post CCR of this DMA channel.

JW

ANaga.2
ANaga.2Author
Associate III
November 24, 2020

My mistake. For some reason Rx was initialized 2 times. once with circular and 2nd time with normal mode. I removed the normal mode initialization and it worked :) Thank you

Tilen MAJERLE
ST Employee
November 24, 2020

Hi @ANaga.2​ ,

see example repository for unknown RX data len: https://github.com/MaJerle/stm32-usart-uart-dma-rx-tx

BrTM