How to detect USB unconfigured state

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaBo_288066
Level 2
Level 2

Hello all,

   

I'm working with a fx2lp and i've to detect the "USB unconfigured" state in order to reduce to <100mA the power requirement (as for USB-IF compliance).

   

I believed that the solution was to look at configuration index = 0 after SetConfiguration but it doesn't work...

   

Any idea?

   

 

   

Thanks a lot!

   

DaX

0 Likes
3 Replies
Anonymous
Not applicable

In my FX2 firmware I activate the high power hardware on SetConfiguration event and in TD_Resume() function. And switch off the hardware on firmware start and on USB Sleep command. It works fine.

0 Likes
DaBo_288066
Level 2
Level 2
Chris R. posted on 13 Dec 2011 06:20 AM PST
Top Contributor
57 Forum Posts
 
 
   

In my FX2 firmware I activate the high power hardware on SetConfiguration event and in TD_Resume() function. And switch off the hardware on firmware start and on USB Sleep command. It works fine.

   

 

   

Hi Chris, thanks for your reply.

   

But you, in SetConfiguration event, explicitly check for condition index != (not equal) 0 to enable power?

   

Because, as far as understand, if host set configuration 0 means "unconfigure device" so power must be <100mA.

   

 

   

Regards,

   

DaX

0 Likes
Anonymous
Not applicable

No, I don´t check this explicitely. Connecting the device on a bus-powered hub the set configuration event don´t appear and so I don´t switch on the high power part. Also on Windows boot the set configuration and sleep states are altered some times, and while installing the driver also the set configuration will appear only after complet install and enough power from hub/host. i think this is OK, but I did not perform compliance tests. Maybe the spec is not completely covered by our firmware.

0 Likes