Announcements
IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

Jesh_4247096
New Contributor

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
Rashi_Vatsa
Moderator
Moderator

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
Rashi_Vatsa
Moderator
Moderator

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