Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
psoc_student
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

psoc_student_0-1655724814250.png

I use two types of UART packets.

  1. Fixed-length 73 byte packet
  2. variable length packet

If I set up the DMA like below, an interrupt occurs when 73 UARTs are received.

However, in case of variable length (eg 30 bytes), DMA interrupt does not occur.

Therefore, 30 bytes of data cannot be imported into the user buffer.

Since I need to process the uart quickly, the remaining 30 bytes also need to be quickly fetched into the user buffer.

Please tell me how to deal with it.

regards,

-PsocStudent

0 Likes
1 Solution
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @psoc_student ,

The DMA can only trigger an interrupt in UART reception only if the number of data elements specified in the 'Number of data elements to transfer' has been received by it over UART. If you specified this number as 73, then it will only trigger an interrupt when 73 bytes of data are received as you have observed. It is not possible for a variable length of received data to trigger the DMA interrupt unless you change the number of elements to be received using the Cy_DMA_Descriptor_SetXloopDataCount beforehand to a known number , say 30.

Regards
Alen

View solution in original post

0 Likes
2 Replies
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @psoc_student ,

The DMA can only trigger an interrupt in UART reception only if the number of data elements specified in the 'Number of data elements to transfer' has been received by it over UART. If you specified this number as 73, then it will only trigger an interrupt when 73 bytes of data are received as you have observed. It is not possible for a variable length of received data to trigger the DMA interrupt unless you change the number of elements to be received using the Cy_DMA_Descriptor_SetXloopDataCount beforehand to a known number , say 30.

Regards
Alen

0 Likes
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @psoc_student ,

Thread was locked due to inactivity for long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.

Warm Regards
Alen

0 Likes