Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > cy7c68013 GPIF FIFO write error

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



cy7c68013 GPIF FIFO write error
Moderator:
RSKV

Post Reply
Follow this topic



cy7c68013 GPIF FIFO write error

readreply posted on 26 Feb 2011 7:44 AM PST
Member
3 Forum Posts

Hello, I am developing a cypress FX2 firmware. I am using GPIF master mode. I have generated the waveform(single_read, single_write, FIFO_read, FIFO_write)using the GPIF_designer, single_read and single_write is ok, FIFO_read is almost ok except the actural wave number is half the c code defined, FIFO_write transaction counter does not decrease, the GPIFTRIG GPIF done bit is not set. so write cycle will not stop, can any one help?

 

Here is the code.

 

void TD_Init(void)             // Called once at startup

{

  // set the CPU clock to 48MHz

  CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1);

  SYNCDELAY;

  EP2CFG = 0xA0;

  SYNCDELAY;

  EP4CFG = 0x00;

  SYNCDELAY;

  EP6CFG = 0xE0;

  SYNCDELAY;

  EP8CFG = 0x00;

  SYNCDELAY;

  FIFORESET = 0x80;

  SYNCDELAY;

  FIFORESET = 0x02;

  SYNCDELAY;

  FIFORESET = 0x06;

  SYNCDELAY;

  FIFORESET = 0x00;

  SYNCDELAY;

  EP2FIFOCFG = 0x01;

  SYNCDELAY;

  EP2FIFOCFG = 0x11;

  SYNCDELAY;

  EP6FIFOCFG = 0x09;

  SYNCDELAY;

  GpifInit (); // initialize GPIF registers

  SYNCDELAY;

  EP2GPIFFLGSEL = 0x01; // For EP2OUT, GPIF uses EF flag

  SYNCDELAY;

  EP6GPIFFLGSEL = 0x02; // For EP6IN, GPIF uses FF flag

  SYNCDELAY;

}

 

void TD_Poll(void)

{

  if( GPIFTRIG & 0x80 )               // if GPIF interface IDLE

  {

    if ( ! ( EP24FIFOFLGS & 0x02 ) )  // if there's a packet in the peripheral domain for EP2

    {

 if ( GPIFREADYSTAT&0x02  )           // if the external FIFO is not full EXTFIFONOTFULL

          {

 SYNCDELAY;

          GPIFTCB1 = 0x01;            // setup transaction count (512 bytes/2 for word wide -> 0x0100)

          SYNCDELAY;

          GPIFTCB0 = 0x00;

          SYNCDELAY;               

          GPIFTRIG = GPIF_EP2;          // launch GPIF FIFO WRITE Transaction from EP2 FIFO

          SYNCDELAY;

          //FIFO write waveform is triggered, but nerver done, why?

          while( !( GPIFTRIG & 0x80 ) ) // poll GPIFTRIG.7 GPIF Done bit  

          {

           ;                // the code will stop here

          }

          SYNCDELAY;

          }

    }

  }

}




Re: cy7c68013 GPIF FIFO write error

Shub posted on 28 Feb 2011 02:05 AM PST
Cypress Employee
27 Forum Posts

Hi,

As you said fifo write waveform is triggered but does not end, so try generating the waveform only once , you can do this by adding a flag in the if condition. If the problem does not occur then the issue is with the loop(ie if condition) in the TD_Poll which is making the waveform to trigger again and again.

Now if this does not solve the problem then the issue is with the gpif waveform.In this case I would request you to attach your uvision2 project as well as the gpif file so that I can check it at my end.

 

-shub



Re: cy7c68013 GPIF FIFO write error

readreply posted on 28 Feb 2011 06:27 AM PST
Member
3 Forum Posts

 Hi shub,

     Thanks for your quick reply, I have tried serval different if condition, it seems doesn't solve the problem. I attached two project, GPIF.zip and firmware.zip, GPIF.zip is the what I am testing, and firmware.zip is another demo code. Both of them have the problem during FIFO write test. Can you help me check the root cause? anything not clear, please don't hesitate to let me known, Thanks!

   Br,



Re: cy7c68013 GPIF FIFO write error

Shub posted on 01 Mar 2011 05:34 AM PST
Cypress Employee
27 Forum Posts

Hi,

I opened the gpif file in GPIF folder using gpif designer and found that the gpif fifo write waveform is not defined.This could be the problem. I have attached a screenshot.Please check and rectify this issue.

 

-Shubham



Re: cy7c68013 GPIF FIFO write error

readreply posted on 12 Mar 2011 12:01 AM PST
Member
3 Forum Posts

 Hi Shub,

      you are right, it is the waveform problem. another question, does Cy7c68013 support usb boot? why  boot from udisk(using Cy7c68013) is ok on Dell computer  while not on compatible computer? The bios version or the usb speed mode or some others? I have tyied usb-hdd fdd and zip mode. Do you have any idea?

      Thanks!

Br,

 



Re: cy7c68013 GPIF FIFO write error

Stewart posted on 15 Feb 2012 12:57 PM PST
Member
4 Forum Posts

 

This attached assembly code should execute a GPIO FIFO Write.

It does not.

However, after fiddling with it a couple of hours (part warms up??) it works fine!

If I then unplug the USB, wait some moments, then plug it in and execute, the FIFO Write doesn't work!(same code, see attached.)

Any ideas ?

 

Thanks,



Re: cy7c68013 GPIF FIFO write error

Gayathri posted on 16 Feb 2012 09:43 AM PST
Cypress Employee
428 Forum Posts

Hi Stewart,

 

Attachment is missing.

 

Regards,

Gayathri



Re: cy7c68013 GPIF FIFO write error

Stewart posted on 17 Feb 2012 12:36 PM PST
Member
4 Forum Posts


Re: cy7c68013 GPIF FIFO write error

Stewart posted on 17 Feb 2012 12:40 PM PST
Member
4 Forum Posts


Re: cy7c68013 GPIF FIFO write error

Gayathri posted on 22 Feb 2012 11:15 PM PST
Cypress Employee
428 Forum Posts

 Hi Stewart,

 

I could see that you are assigning count only once to GPIFTCB0 (which is equal to 1 Byte), but you are triggering the transfer twice, using GPIFTRIG and using EP6GPIFTRIG. Please check the same. Also, I wanted to confirm one thing: are you isng GPIF designer for forming the GPIF.c file which you are importing to your project? If so, please attach the screenshots for the FIFOWR waveform.

Can you also please attach the part of code where you are doing the initializatn stuffs, i.e, configuring the buffering, direction of Endpoints etc.

 

Regards,

Gayathri



Re: cy7c68013 GPIF FIFO write error

Stewart posted on 22 Feb 2012 09:13 AM PST
Member
4 Forum Posts

"you are assigning count only once to GPIFTCB0 (which is equal to 1 Byte)"

> GPIFTCB0 is reassigned EVERY LOOP.

"you are triggering the transfer twice, using GPIFTRIG and using EP6GPIFTRIG."

>Ep6gpiftrg is COMMENTED OUT.

"are you isng GPIF designer for forming the GPIF.c file "

>NO

"please attach the part of code where you are doing the initializatn stuffs, i.e, configuring the buffering, direction of Endpoints etc."

>GPIF initialization in in the file. (Endpoint buffering & direction are default values - ep2,4 OUT, ep6,8 IN.)



Re: cy7c68013 GPIF FIFO write error

Gayathri posted on 22 Feb 2012 08:26 PM PST
Cypress Employee
428 Forum Posts

 Hi Stewart,

 

I din't notice the ";" before EP6GPIFTRIG statement. Why is that you are triggering GPIF transactions 1 byte at a time? Please create a case at http://www.cypress.com/ -> Support -> Technical Support so that one of our engineers can take a look at this. It would be easier to debug.

 

Regards,

Gayathri






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: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20