Using double buffer for OUT EP.

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

cross mob
Anonymous
Not applicable

 My EP2 configuration is

   

    - EP2 : Valid, Out, 1024Bytes, Double Buffered

   

I write a program using DevceIOControl without using CyAPI.

   

 

   

When I send out data equal to or less than 1024 bytes, it's simple.

   

Because EP2 is 1024Byte, it can receive 1024bytes without any special program.

   

Sending out 1024 bytes can be done by single DeviceIOControl command.

   

 

   

Regarding to 'Double Buffer for EP2', 

   

Q : Can I send 2048 bytes with single DeviceIOControl command ?

   

Q:  If one-packet transfer for EP2 has 1024bytes limitation, I need to send two DeviceIOControl command for 2048bytes.

   

     In that case, how FX2LP firmware can access 2048 bytes ? The address for 2048 bytes are continuous ? 

   

Q: Is there proper documents or example for double buffering OUT/IN ?

0 Likes
2 Replies
Anonymous
Not applicable

 Hi

   

A)is it a BULK or ISOC endpoint?

   

 

   

What is maximum packet size that you have mentioned in endpoint descriptor?

   

 

   

You should not send the packet more than that is mentioned in the descriptor of the endpoint.

   

 

   

If the endpoint maximum size is 1024(for ISOC) then you can send two packets of 1024.No need for you to specifiy the buffer address. Inside the buffer the data will be stored continuously.You can access the data by using EP2FIFOBUF.at a time you can access only 1024 data.Once the first packet is cleared from the buffer then only you can access the second packet.

0 Likes
Anonymous
Not applicable

It is BULK endpoint. 

   

In descriptor, its size is 1024.

   

 

   

To send 2048 bytes, I need to send 1024bytes twice like following. 

   

        OUT : CDB

   

        OUT : first 1024bytes data

   

        IN     : CSW

   

 

   

        OUT : CDB

   

        OUT : second 1024bytes data

   

        IN     : CSW

   
        
   
        
   
        
   
    Is there any way to send 2048 bytes like    
   
    

        OUT : CDB

    

        OUT : first 1024bytes data

    

        OUT : second 1024bytes data

    

        IN     : CSW

   
   
        
   
        
   
    Always thanks for your answers.   
0 Likes