Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Problem to make a bulktransfer, FX2LP/CyConsole

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



Problem to make a bulktransfer, FX2LP/CyConsole
Moderator:
RSKV

Post Reply
Follow this topic



Problem to make a bulktransfer, FX2LP/CyConsole

ThierryF posted on 13 Jun 2012 7:26 AM PST
Member
10 Forum Posts

Hello,

I work with a FX2LP board (CY7C68016A). I try to communicate with the device in SLAVE FIFO mode and AUTO mode.

This is my initialization:

/***************************************************************************************************************/

void TD_Init(void)                 // Called once at startup
{


    CPUCS = 0x0A;        // CLKSPD[1:0]=10, for 24 MHz operation, output CLKOUT
    IFCONFIG = 0x6F;    // external clock source,24 MHZ drive IFCLK, asynchronous slave FIFO mode

    PINFLAGSAB = 0xAE; // FLAGA Empty flag EP6 - FlagB  FULL flag EP6
    SYNCDELAY;
    PINFLAGSCD = 0xE0; // FLAGD - EP2 Emtpy flag
    SYNCDELAY;

    PORTACFG |= 0x80;
 
    EP4CFG = 0x02; //clear the valid bits on ep4 and ep8
    SYNCDELAY;
    EP8CFG = 0x02;
    SYNCDELAY;
    EP2CFG = 0xA0; // OUT, 512-bytes, 4x, bulk
    SYNCDELAY;
    EP6CFG = 0xE0; // IN, 512-bytes, 4x, bulk

    SYNCDELAY;
    FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions
    SYNCDELAY; // see TRM section 15.14
    FIFORESET = 0x02; // reset, FIFO 2
    SYNCDELAY; //
    FIFORESET = 0x04; // reset, FIFO 4
    SYNCDELAY; //
    FIFORESET = 0x06; // reset, FIFO 6
    SYNCDELAY; //
    FIFORESET = 0x08; // reset, FIFO 8
    SYNCDELAY; //
    FIFORESET = 0x00; // deactivate NAK-ALL


    // handle the case where we were already in AUTO mode...
    // ...for example: back to back firmware downloads...

    SYNCDELAY; //
    EP2FIFOCFG = 0x00; // AUTOOUT=0, WORDWIDE=0


    // core needs to see AUTOOUT=0 to AUTOOUT=1 switch to arm endp's
    SYNCDELAY; //
    EP2FIFOCFG = 0x10; // AUTOOUT=1, WORDWIDE=0

    SYNCDELAY; //
    EP6FIFOCFG = 0x4C; // AUTOIN=1, ZEROLENIN=1, WORDWIDE=0, INFM = 1;


    SYNCDELAY;

    Rwuen = TRUE;                // Enable remote-wakeup
    EE_Page_Size = 0;           // Set the page size to 0, so we know to calculate it on an EEPROM write
   
    // Determine I2C boot eeprom device address; addr = 0x0 for 8 bit addr eeproms (24LC00)

    I2C_Addr = SERIAL_ADDR | ((I2CS & 0x10) >> 4); // addr=0x01 for 16 bit addr eeprom (LC65)
    // Indicate if it is a dual byte address part
    DB_Addr = (BOOL)(I2C_Addr & 0x01); // ID1 is 16 bit addr bit - set by rocker sw or jumper
}


/***************************************************************************************************************/

 

When I tried to send 1 byte with CyConsole the "bulk OUT" failed.

I'm new and I need help to know why I can't transfer just 1 byte on the device.

In addition I tested the device with "bulkloop.hex" and the device work, so I assume I have a problem in my device configuration.

 

Best regards

Thierry

 




Re: Problem to make a bulktransfer, FX2LP/CyConsole

Gayathri posted on 14 Jun 2012 12:13 AM PST
Cypress Employee
327 Forum Posts

 Hi Thierry,

 

In order to send any data to BULK OUT endpoint, you must Arm the endpoints. Since it sis quad buffered, it must be armed four times. Arming can be done as follows:

EP2BCL = 0x80;

SYNCDELAY;

EP2BCL = 0x80;

SYNCDELAY;

EP2BCL = 0x80;

SYNCDELAY;

EP2BCL = 0x80;

SYNCDELAY;

Please paste this code at the end of TD_Init() function, and this must solve the issue.

 

Regards,

Gayathri

 



Re: Problem to make a bulktransfer, FX2LP/CyConsole

RSKV posted on 14 Jun 2012 12:24 AM PST
Cypress Employee
655 Forum Posts

 Few things that I noticed:

Are you testing with the FX2LP DVK board?

You have configured IFCONFIG to take external clock. Check whether the clock is available. Otherwise just for testing make it internal as it is in bulkloop examples.

Otherthing is that you are not arming the OUT endpoints. You need to do that.

Please refer to 9th chapter of the "EZ-USB® Technical Reference Manual" to get more details. Go through section 9.3 to find more details regarding your configuration.

Thanks,

sai krishna.



Re: Problem to make a bulktransfer, FX2LP/CyConsole

ThierryF posted on 14 Jun 2012 02:56 AM PST
Member
10 Forum Posts

Thank you for your answers.

I will test it as soon as possible

Thierry



Re: Problem to make a bulktransfer, FX2LP/CyConsole

ThierryF posted on 18 Jun 2012 03:14 AM PST
Member
10 Forum Posts

Hi,

I tested  Gayathri's code but it didn't work. So I check if the external clock was available and it wasn't. I modified my FPGA design and now I can see the clock on the FX2LP board with an oscilloscope. 

But now when I put the device on windows the device is not reconized with the clock. Before the PC could reconize it without problem.

Do you know why the device have this behavior?

Best regards

Thierry

 



Re: Problem to make a bulktransfer, FX2LP/CyConsole

PRJI posted on 19 Jun 2012 11:58 PM PST
Cypress Employee
245 Forum Posts

 Hi,

    Please see http://www.cypress.com/?rID=43046.

Thanks

Prajith



Re: Problem to make a bulktransfer, FX2LP/CyConsole

ThierryF posted on 20 Jun 2012 06:33 AM PST
Member
10 Forum Posts

Hi,

Thank you Prajith for this link, but this application use an internal clock.

I try to use a 24 MHz clock from FPGA chip (CycloneIII Altera).

Without this clock, Windows can reconize the device. When I put the clock windows see a "Unknown Device". I found this link:   http://www.cypress.com/?id=4&rID=37601

I checked  and followed I found but it didn't resolve my problem.

My question is, How can I use an external clock properly?

Best regards

Thierry



Re: Problem to make a bulktransfer, FX2LP/CyConsole

RSKV posted on 21 Jun 2012 02:59 AM PST
Cypress Employee
655 Forum Posts

 Thierry,

Are you seeing issue with enumeration or re-enumeration?.

In other way, Are you able to download the code into FX2LP board?.

If yes, then please make sure that the external IFCLK is present before FX2LP starts executing the firmware.

 






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.