1 Reply Latest reply on Mar 10, 2015 2:31 AM by Madhu Lakshmipathy

    FX3 - Cannot Transfer Data Out using Control Center


      I have created a simple GPIF using the GPIF II Designer utility (Slave interface, external clock, synchronous transfer, 16-bit databus).  The configuration has 3 states, as shown in the attached image.  After building and creating the .img file with the Eclipse EZ-USB Suite and and loaded it to RAM via Control Center, I was able to perform successful data transfer IN from a 4-bit counter w/ external clock of 10 MHz. 


      However, I am not able to successfully transfer data OUT.  I changed the bulk IN endpoint to a bulk OUT endpoint by changing CY_FX_EP_CONSUMER in the firmware header file from '0x81' to '0x01'.  I've also changed the action in the DMAREADY state from 'IN_DATA' to 'DR_DATA'.  When I attempt the data transfer OUT, the Control Center's console gives the message "BULK OUT transfer failed with Error CodeL 997".  After inspecting the source code, it seems that bulkEpt.XferData(ref buffer, ref bytes, IsPkt) times out and changes ref bytes to 0.  Would anyone be able to tell why this function is failing?  I am thinking I may have missed changing something in the firmware from an IN endpoint to OUT enpoint, but cannot find what this may be.  Thanks for the help.

        • 1. Re: FX3 - Cannot Transfer Data Out using Control Center
          Madhu Lakshmipathy



          In your firmware you would have createtwo DMA Channels


          (i) DMA Channel between PIB (GPIF) Producer socket to a USB consumer socket (for GPIF to USB IN)


          (ii) DMA Channel between USB Producer socket to a PIB ( GPIF) consumer socket (for USB OUT to GPIF DRA_DATA)


          In the DMA Channel, you would have used two different GPIF Sockets for two channels.


          Assume that you have sued CY_U3P_PIB_SOCKET_0 as a producer socket for channel (i) and you have used CY_U3P_PIB_SOCKET_1 as consumer socket as channel (ii)


          The Threads in the GPIF take care of reading / writing on GPIF Sockets (Threads are hardware entities that tranfers data between GPIF Data Bus and DMA Sockets and vice versa). Only Thread 0 can write / Read from Socket 0 and Thread 1 can Read / write form Socket 1. 


          In your state machine if you double click the DR_DATA, you can see a dialogue window which shows that it is mapped to "Thread 0" (by defalut). You need to change that to Thread 1 (because DR_DATA : UDB to GPIF Channel is associated with SOKCET_1)


          So., change that to Thread 1 from Thread 0 and try. (Not I assume that you are using SOCKET 0 as producer and SOCKET 1 as consumer and gave the above suggestion. Please have a look at your firmware, especially the CyU3PDmaChannelCreate function to see which socker are you using on which channel.)


          (Note : If you are not yet having a channel from USB to GPIF, you need to creare one)




          - Madhu Sudhan