FX2LP - Configure EndPoint2 for less than 512Byte FIFO size

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

cross mob
r_shivakumar
Level 1
Level 1
5 replies posted 5 questions asked 10 sign-ins

Hi,

Need your help here.

Right now my application is using End Point 2 with 512bytes as the buffer size for bulk transfer. 
Once Cypress chip receives 512Bytes,  bit 1 (EP2EF) of EP24FIFOFLGS is set to zero.  

How to configure EndPoint2 to receive less than 512bytes and which register to poll for when EP2 is configured to receive less than 512Bytes.

0 Likes
1 Solution
MallikaK_22
Moderator
Moderator
Moderator
50 likes received 750 replies posted 250 solutions authored

Hi,

Apologies for the delay in my response.

I'm sorry for missing that you are using an OUT endpoint. Please check section 9.3.7, Pg 115 in the EZ-USB  TRM. In AUTO-OUT mode, data is always auto-committed in 512 or 1024-byte packets. 

Foe checking the status, you can use flags. Please check section 15.5.3

View solution in original post

0 Likes
7 Replies
MallikaK_22
Moderator
Moderator
Moderator
50 likes received 750 replies posted 250 solutions authored

Hi,

Please let me know which mode are you using for the transfers- Auto or Manual?

Regards,

Mallika

0 Likes

Hi Mallika,

I am using Auto mode.

0 Likes
MallikaK_22
Moderator
Moderator
Moderator
50 likes received 750 replies posted 250 solutions authored

Please check the EPxFIFOCFG register, bit 3- AUTOIN on Page 238 in the EZ USB TRM.

Regards,

Mallika

0 Likes

Hi Mallika,

I looked at bit3-AUTOIN. It is mentioned as "This bit applies only to IN endpoints".
EP2 is used as bulk output endpoint in my application.

r_shivakumar_1-1650270736403.png

r_shivakumar_0-1650270620999.png

Setting AUTOIN bit and Configuring EP2AUTOINLEN to less than 512bytes (in my example value of 200 is used) is not working as expected. Below is the initialization code.

EP2FIFOCFG = 0x01; // allow core to see zero to one transition of auto out bit
SYNCDELAY;
EP2FIFOCFG = 0x11; // auto out mode, disable PKTEND zero length send, word ops
SYNCDELAY;
EP2_FifoSize = 200;
EP2FIFOCFG |= bmBIT3;
EP2AUTOINLENL = (BYTE)EP2_FifoSize;
EP2AUTOINLENH = (BYTE)(EP2_FifoSize >> 8);
SYNCDELAY;

To find out if packet is received, i am polling for bit1-EP2EF of EP24FIFOFLGS register.
if (!( EP24FIFOFLGS & 0x02 )) 
{
    // Buffer is full.
}

Using the USB control center for bulk transfer, i have to transfer data of 200 bytes 3 times for the above if condition to become true.

r_shivakumar_2-1650271967349.png

Can you please help me with all the register configurations for setting EP2 to receive less than 512 bytes data and which register to poll for to know if the bulk data is received.

 

0 Likes

Hi Mallika,

Can you please suggest on this.

0 Likes
MallikaK_22
Moderator
Moderator
Moderator
50 likes received 750 replies posted 250 solutions authored

Hi,

Apologies for the delay in my response.

I'm sorry for missing that you are using an OUT endpoint. Please check section 9.3.7, Pg 115 in the EZ-USB  TRM. In AUTO-OUT mode, data is always auto-committed in 512 or 1024-byte packets. 

Foe checking the status, you can use flags. Please check section 15.5.3

0 Likes

Hi Mallika,

Thanks for the clarification.

0 Likes