XDMAC UART read unknown size

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I am using ATSAMV71J21 and I Want to configure UART0 with XDMAC.

 

I used SPI XDMAC example to configure UART XDMAC settings.

Transmission part is perfectly working fine.

On reception part, i get into XDMAC handler XDMAC_CIS_BIS only after receiving Microblock length of buffer size is reached.

 

1. But how to get notified when unknown data size is received?

2. How to get UART RX idle line interrupt?

3. How to copy data into user buffer, what is this clean and invalidate D cache and how to use?

4. If i set buffer size as 10 and if I received 4 bytes, how to get notified about this.

 

Is there any proper UART XDMA example that i can get to proceed further?

 

Eagerly waiting for your response!

 

Thank you

nvn

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

(never mind)

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Dec 9, 2021 - 09:45 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi naveen,

 

here are my suggestions:

1.) how do you determine that the last character has been received. Is this related to its content? If yes I would recommend to use the sleepwalking mechanism instead of XDMAC. If it is related to time you can use a timer and its interrupt to disable the XDMAC channel after the timeout period.

2.) to my knowledge there is nothing like a RX idle interrupt. There is only a receive interrupt. I think I remember that the receive interrupt is not fired if you are using XDMAC - but I might be wrong. 

3.) There are ready to use functions available that comes with the CMSIS package (https://www.keil.com/pack/doc/CM...).

4.) If you size hasn't reached yet there will be no mechanism to get notified inbetween (other µC has a watermark concept that is not existing in the SAME/V/S7). However you can determine at any point in time the number of data received from the block length entry in the XDMAC channel.

 

Best Regards

Markus