Cypress USB FX2 Bulkloop sample application closes itself!. Solution?

Setup: Cypress EZ-USB FX2 Dev Board - CY3681 Firmware - Sample Cypress "bulkloop" firmware supplied Application - Sample Cypress 'bulkloop" applicaiton supplied Drivers - Supplied CyUSB driver for the bulkloop utility

Sending data from PC to EP4OUT and looping it back in through EP8IN. Both EP4OUT and EP8IN are the default sizes. (As it is in the sample).

Problem: Everything works fine except for the fact that, after receiving the first 1024 bytes looped back, the program simply closes itself! Yes, I am arm-ing EP8 and re-arm-ing EP4 with 0x80. The transfer size is set at 1 byte and I'm looping a single byte in each transfer.

Has anyone had this problem before? The firmware seems to be running fine, so I believe the problem has to be in the sample application. I've made a case with Cypress, and it's been two weeks and they havent replied yet.

I need help!

-Jim

Reply to
jasimpson
Loading thread data ...

set the transfer size to 512 or a multiple thereof. Or 64 if you are in USB1.1

Reply to
Nappy

I did!

I tried a transfer size of 512, and the program closes itself after receiving the first two 512 packets!! I tried 1024 too and it closes after receiving that 1024 bytes! I'm using USB 2.0 too.

Has anyone tried building an application built up from the bulkloop application sample?

Thanks again,

-Jim

Reply to
jasimpson

Ok.. well the transfer size should never be 1. The bytesToSend can be one in your Endpt->Write(*) call. Does it crash in the Endpoint call or after?

I have an entire app which I wrote looking at their samples.

Reply to
Nappy

I had terrible trouble setting up the configuration registers especialy as we were externally clocked. My code has comments like "Make sure of an AUTOOUT 0->1 transition, if AUTOUT is used, even though REVCTL.1 is true now" and "

formatting link
says do this after".

Now it is all working, I would not dare touch it. House of cards.

Rgds, Bill

PS And of course there is the faster copy loop:

if ( Count ) { // // Use Tom Duff's (May 7, 1984) method for fast copying. // Count > 0 assumed // As the maximum bulk buffer size is 512 (even isochronous is only

1024), // we can count cycles in a byte. // BYTE n = (Count + 7) / 8;

switch (Count % 8) { case 0: do { EXTAUTODAT2 = EXTAUTODAT1; case 7: EXTAUTODAT2 = EXTAUTODAT1; case 6: EXTAUTODAT2 = EXTAUTODAT1; case 5: EXTAUTODAT2 = EXTAUTODAT1; case 4: EXTAUTODAT2 = EXTAUTODAT1; case 3: EXTAUTODAT2 = EXTAUTODAT1; case 2: EXTAUTODAT2 = EXTAUTODAT1; case 1: EXTAUTODAT2 = EXTAUTODAT1; } while (--n > 0); } }

Reply to
Bill Davy

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.