Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > FX2 re-enumeration (USB-plug/unplug)

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



FX2 re-enumeration (USB-plug/unplug)
Moderator:
RSKV

Post Reply
Follow this topic



FX2 re-enumeration (USB-plug/unplug)

Hyped posted on 20 Feb 2013 11:00 AM PST
Member
5 Forum Posts

 Hi,

I'm trying to understand exactly what happens when the FX2 has power but the USB is unplugged and then re-plugged back in.   Our firmware uses the vend_ax example as skeleton code.   I had thought originally that if the user unplugs the USB cable and plugs it back in (power is supplied separately; not through USB) that TD_Init() would be called again.  However, that appears to not be the case.  I understand that when the USB is unplugged the FX2 will go into sleep mode and that it "wakes up" when the USB cable to the host is plugged back in.  

My issue is, given how our FX2 and FPGA are integrated, I need to send a signal from the microcontroller to reset the FPGA when this re-enumeration event happens and I'm not sure what routine will be called once when the USB cable is inserted. I found somewhere that TD_Init() is called when "re-enumerating a new device" but apparently unplugging and plugging in USB cable connecting to the host is not that event?

Any wisdom welcome!

-Hyped




Re: FX2 re-enumeration (USB-plug/unplug)

Gayathri posted on 20 Feb 2013 09:47 PM PST
Cypress Employee
428 Forum Posts

 Hi,

 

When FX2 is operating in self powered mode (i.e. external power supply; not VBUS), if you want to interrupt FPGA whenever renumeration happens, you can make use of SET_CONF request. Upon completion of enumeration SET_CONFIGURATION request will be issued by the host. You can set some flag or notify the FPGA when SET_CONF request is received.

Or you can even use a GPIO to monitor VBUS in TD_POLL.

 

Regards,

Gayathri



Re: FX2 re-enumeration (USB-plug/unplug)

Hyped posted on 21 Feb 2013 07:36 AM PST
Member
5 Forum Posts

 Hi Gayathri,

Thanks for your response! So in vend_ax.c there is a DR_SetConfiguration stub:

 

BOOL DR_SetConfiguration(void)   // Called when a Set Configuration command is received
{
   Configuration = SETUPDAT[2];
   return(TRUE);            // Handled by user code
}  I should be able to just add the FPGA reset command in here, correct?  Out of curiosity, I was wondering whether one could include the FPGA reset in the fw.c wake-up interrupt handler stub:  // Wake-up interrupt handler void resume_isr(void) interrupt WKUP_VECT {    EZUSB_CLEAR_RSMIRQ(); }

Thanks!
Best,
Scott

 



Re: FX2 re-enumeration (USB-plug/unplug)

Gayathri posted on 26 Feb 2013 09:20 AM PST
Cypress Employee
428 Forum Posts

 Hi,

 

I have not tried the wakeup interrupt handler so far. I will have to check on that. Did the other oprion of Set config request work?

 

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