FX3 setting the DMA burst length and buffer size

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.
Jesh_4247096
Level 1
Level 1

I want to change the DMA burst length and buffer size. The firmware I'm using is the SlaveFifoSync, which I downloaded from the AN65974. I notice that the the default setting is following(sorry, I can't find how to insert code):

#ifdef STREAM_IN_OUT

#define BURST_LEN 16

#define DMA_BUF_SIZE (16)

/* Slave FIFO P_2_U channel buffer count */

#define CY_FX_SLFIFO_DMA_BUF_COUNT_P_2_U      (4)

/* Slave FIFO U_2_P channel buffer count */

#define CY_FX_SLFIFO_DMA_BUF_COUNT_U_2_P   (8)

#endif

So I change the setting like this:

#ifdef STREAM_IN_OUT

#define BURST_LEN 16

#define DMA_BUF_SIZE (16)

/* Slave FIFO P_2_U channel buffer count */

#define CY_FX_SLFIFO_DMA_BUF_COUNT_P_2_U      (1)

/* Slave FIFO U_2_P channel buffer count */

#define CY_FX_SLFIFO_DMA_BUF_COUNT_U_2_P   (1)

#endif

It works fine for my application. But the DMA buffer is still large. It spends about 6 seconds for data to fill the 16KB buffer. So I want to continue  to reduce the DMA buffer size. The setting is following:

#ifdef STREAM_IN_OUT

#define BURST_LEN 2

#define DMA_BUF_SIZE       (2)

/* Slave FIFO P_2_U channel buffer count */

#define CY_FX_SLFIFO_DMA_BUF_COUNT_P_2_U      (1)

/* Slave FIFO U_2_P channel buffer count */

#define CY_FX_SLFIFO_DMA_BUF_COUNT_U_2_P    (1)

#endif

The buffer size is 2KB. But the data transfer failed. I don't know where is the problem. Maybe I made the wrong amendment, or I need to continue to modify something else. Thanks for any advice.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Jerry,

The endpoint configuration are different in the main code (cyfxslfifosync.c file) and the usb descriptors const uint8_t CyFxUSBSSConfigDscr[] (cyfxslfifousbdscr.c)

Please make the changes as mentioned in the attachment.

If this doesn't help,please let me know what is the error that occurs.

Regards,

Rashi

Regards,
Rashi

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Jerry,

The endpoint configuration are different in the main code (cyfxslfifosync.c file) and the usb descriptors const uint8_t CyFxUSBSSConfigDscr[] (cyfxslfifousbdscr.c)

Please make the changes as mentioned in the attachment.

If this doesn't help,please let me know what is the error that occurs.

Regards,

Rashi

Regards,
Rashi
0 Likes