FX2LP How to manually empty the buffers of an IN endpoint by the firmware?

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

cross mob
FrZa_2625781
Level 4
Level 4
First solution authored 25 replies posted 10 replies posted

Hi,

I have an Bulk IN endpoint with Auto-IN enabled that is constantly filled with data from the external master.

After a pause in data transfer I might want to discard the presumably old content of the endpoint buffers before I continue with the new transfer.

What do I have to write in which registers to declare the input buffers empty so that they can accept new data from the external master?

I assume this is an easy and silly question, but I have worked overnight on my previous problem and my brains feel like two soaked loafs of old bread.

Many thanks for any help!

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello Frank,

To discard the data that has already been committed to the host, the FX2LP has to be switched to MANUAL mode. Implement the below piece of code to discard the data and re-enable the endpoint buffer to be filled by external master.

FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions

SYNCDELAY;

EP6FIFOCFG = 0x00; //switching to manual mode

SYNCDELAY;

FIFORESET = 0x06; // Reset FIFO 6

SYNCDELAY;

EP6FIFOCFG = 0x0C; //switching to auto mode

SYNCDELAY;

FIFORESET = 0x00; //Release NAKALL

SYNCDELAY;

Best regards,

Srinath S

View solution in original post

0 Likes
1 Reply