Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > AN61345 loopback problem

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



AN61345 loopback problem
Moderator:
RSKV

Post Reply
Follow this topic



AN61345 loopback problem

fate posted on 24 Sep 2012 3:37 AM PST
Member
5 Forum Posts

The problem is that when transfer 512bytes data(05)  using the AN61345 loopback verilog procedure,it will return the 512 bytes data(05) with some 00 in the begining .It shows as the following:

Bulk OUT Transfer
Bulk OUT success.
Buffer Contents
0000  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0010  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0020  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0030  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0040  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0050  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0060  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0070  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0080  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0090  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00A0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00B0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00C0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00D0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00E0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00F0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0100  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0110  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0120  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0130  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0140  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0150  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0160  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0170  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0180  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0190  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01A0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01B0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01C0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01D0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01E0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01F0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
Bulk IN Transfer
Bulk IN success.
Buffer Contents
0000  00 00 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0010  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0020  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0030  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0040  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0050  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0060  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0070  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0080  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0090  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00A0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00B0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00C0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00D0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00E0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
00F0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0100  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0110  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0120  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0130  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0140  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0150  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0160  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0170  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0180  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
0190  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01A0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01B0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01C0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01D0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01E0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05
01F0  05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05

When I want transfer 2bytes data using my own verilog procedure ,the same problem come ,the fist two bytes are also including some 00,but the next 2bytes are correct .I don't know why?


Bulk OUT Transfer
Bulk OUT success.
Buffer Contents
0000  12 10
Bulk IN Transfer
Bulk IN success.
Buffer Contents
0000  00 00 00 00 00 00 00 00 12 10
Bulk OUT Transfer
Bulk OUT success.
Buffer Contents
0000  15 14
Bulk IN Transfer
Bulk IN success.
Buffer Contents
0000  15 14
Bulk OUT Transfer
Bulk OUT success.
Buffer Contents
0000  16 17
Bulk IN Transfer
Bulk IN success.
Buffer Contents
0000  16 17




Re: AN61345 loopback problem

PRJI posted on 24 Sep 2012 08:17 AM PST
Cypress Employee
333 Forum Posts

 Hi,

 I would like to know the details of your interface. Are you using FX2LP DVK or custom board?

Please let me know the details of your interface.

Thanks

Prajith

 



Re: AN61345 loopback problem

fate posted on 24 Sep 2012 09:30 AM PST
Member
5 Forum Posts

Hi,I'm using the CyConsloe to test the loopback between FPGA and the cy68013a。I just send data to the EP2 endpoint and loopback to the EP6 endpoint The following is my firmware ,is there something  wrong  with my firmware 

void TD_Init(void)             // Called once at startup
{
   // set the CPU clock to 24MHz
     CPUCS =0x08;
  SYNCDELAY;
   // set the slave FIFO interface to 48MHz,SYNC,IFCLK output
     IFCONFIG = 0xE3;
  SYNCDELAY;
     REVCTL = 0x03;
  SYNCDELAY;  // Registers which require a synchronization delay, see section 15.14
  // FIFORESET        FIFOPINPOLAR
  // INPKTEND         OUTPKTEND
  // EPxBCH:L         REVCTL
  // GPIFTCB3         GPIFTCB2
  // GPIFTCB1         GPIFTCB0
  // EPxFIFOPFH:L     EPxAUTOINLENH:L
  // EPxFIFOCFG       EPxGPIFFLGSEL
  // PINFLAGSxx       EPxFIFOIRQ
  // EPxFIFOIE        GPIFIRQ
  // GPIFIE           GPIFADRH:L
  // UDMACRCH:L       EPxGPIFTRIG
  // GPIFTRIG
 
  // Note: The pre-REVE EPxGPIFTCH/L register are affected, as well...
  //      ...these have been replaced by GPIFTC[B3:B0] registers

  // default: all endpoints have their VALID bit set
  // default: TYPE1 = 1 and TYPE0 = 0 --> BULK 
  // default: EP2 and EP4 DIR bits are 0 (OUT direction)
  // default: EP6 and EP8 DIR bits are 1 (IN direction)
  // default: EP2, EP4, EP6, and EP8 are double buffered

  // we are just using the default values, yes this is not necessary...
 
   EP1OUTCFG &= 0x7F;   //set invalid
   EP1INCFG &= 0x7F;
   SYNCDELAY;                   // see TRM section 15.14
   EP2CFG = 0xA2;    //set EP2 valid, out, bulk, 512, double buffer.
   SYNCDELAY;  
   EP4CFG &= 0x7F;    //set invalid.
   SYNCDELAY;                   
   EP6CFG = 0xE2;    //set EP6 valid, in, bulk, 512, double buffer.
   SYNCDELAY;  
   EP8CFG &= 0x7F;          //set invalid.
   SYNCDELAY;
 
   FIFORESET = 0x80;             // reset all FIFOs
   SYNCDELAY;
    FIFORESET = 0x02;
    SYNCDELAY;
 FIFORESET = 0x04;
    SYNCDELAY;
 FIFORESET = 0x06;
    SYNCDELAY; 
    FIFORESET = 0x08;
    SYNCDELAY; 
    FIFORESET = 0x00;
    SYNCDELAY;
 OUTPKTEND=0x82;   //arm EP2 two times
 SYNCDELAY;
 OUTPKTEND=0x82;
 SYNCDELAY;
  EP2FIFOCFG = 0x11; //EP2 autoout=1 wordwide=1;
 SYNCDELAY;
 EP6FIFOCFG = 0x0D; //EP6 autoin=1 zerolength=1 wordwide=1;
 SYNCDELAY;  
    PINFLAGSAB = 0xE0;   // FLAGB as EP6 full flag,
    SYNCDELAY;        
    PINFLAGSCD = 0x08; // FLAGC as EP2 empty flag
    SYNCDELAY;        
    PORTACFG = 0x00;  // won't generally need FLAGD
    SYNCDELAY;
 FIFOPINPOLAR = 0x00; // set all slave FIFO interface pins as active low
    SYNCDELAY;
    EP6AUTOINLENH = 0x02;
    SYNCDELAY;
    EP6AUTOINLENL = 0x00;
    SYNCDELAY;
}



Re: AN61345 loopback problem

PRJI posted on 26 Sep 2012 02:15 AM PST
Cypress Employee
333 Forum Posts

 Hi,

 Are you getting the same error with slave project which comes with AN61345?

Regards

Prajith






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20