Set DMA watermark of FX3

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

cross mob
lock attach
Attachments are accessible only for community members.
jach_1279971
Level 3
Level 3
25 replies posted 10 replies posted 5 replies posted

16 bit data bus is used, I set the watermark value to 3, number of 16-bit data words that may be written after the clock edge at which the partial flag is

sampled asserted = 3 x (32/16) – 4 = 2

CyU3PGpifSocketConfigure(0, CY_U3P_PIB_SOCKET_0, 3, CyFalse, 1);

I also set only 1 DMA buffer with 8 bytes depth.

#define CY_FX_DMA_BUF_COUNT      (1)                       /* slave Bulk channel buffer count */

#define CY_FX_DMA_TX_SIZE        (8)                       /* DMA transfer size is set to infinite */

Then I use Control center to write 12 bytes data from master FX3 to slave FX3, it's correct that only 8 bytes can be received by slave. I expect Thread_0_DMA_Watermark (GPIO21) should be deasserted after 6 bytes data is transmitted by master but this pin's value isn't changed. Please kindly advise.

0 Likes
1 Solution
Hemanth
Moderator
Moderator
Moderator
First like given First question asked 750 replies posted

Hi,

By changing CY_FX_DMA_TX_SIZE, you are not changing the buffer size of the Slave device. Instead what happens when you set CY_FX_DMA_TX_SIZE to 8 is that DMA channel goes to idle state after 8 bytes are transmitted.

If you want to change the buffer size, you need to change the dmaCfg.size parameter.

And please note that the buffer size of the DMA channel should be a multiple of 16 bytes.

Regards,

Hemanth

Hemanth

View solution in original post

0 Likes
7 Replies