Issue for drive data by modifying slavefifo example

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.
Anonymous
Not applicable
    

Hi All,

    

I am trying to modify the slavefifo-sync example to meet my application.  I just want a very simple application that FX3 receive data from USB by bulk mode and send received data to P-port. I check the firmware I suppose I don't do any modify at firmare.

    

Because the firmware already set up producer/consumer side and commit/transfer producer data by DMA call back function.  

    

I think my gpif2 will be very simple. Just one start state and one state to do "DR_DATA".  But I test my application it says fail.It seems consumer side doesn't consume any data until buffer full and let producer can't write any data. Do I miss anything?

    
     Thanks.    
    
          
    
     Attached is my GPIF design.    
    
          
    
     ps.Could cypress provide more combine GPIF2 and firmware sample code?    
   
0 Likes
3 Replies
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Have an IDLE state in between the START state and the one where you drive data. Then jump from this idle state to the drive state only if the DMA channel of Thread0 is ready and then jump back once it isn't. This way you're preventing contention between the GPIF and USB block trying to both access the same buffer.

   

See the attached figure.

   

--Manu

0 Likes
Anonymous
Not applicable

 Also, in such cases, APIs such as CyU3PDmaChannelGetStatus() will come in handy. Print the channel status in a loop and see what the XferCount values are once you transfer data. They will give some clue as to what the problem is.

   

-- Manu

0 Likes
Anonymous
Not applicable

Hi scutifer,

   

 

   

Thank you for your supporting.

   

But I still fail in send out data from usb to p-port.   I use debug print and I sure FX3 receive data from usb but I don't know why fx3

   

never send data out even producer call back function is called. I feel something in GPIF was wrong.  Could you teach me how to check the GPIF status like GPIF is actived or not, GPIF status, etc?

   

 

   

Thank you very much.

0 Likes