Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 216317

Forum Post: RE: USB stack re initialization issue

$
0
0

Hi Rajasekhar,

[quote]To avoid this situation we are planning to stop the USB functionality before Relay switching and completely fresh USB start with enumeration after this.[/quote]
You may drop the bus into Suspend, instead of stopping the USB host.
While the bus stays in Suspend, USB hardwares pause on both side, host and device. No signaling occurs on the bus, until host puts Resume signal. Bus-powered device, such as a USB stick, drops in low-power sleep mode.

I believe Suspend state has pretty high endurance against noise.
Try it.

On StellarisWare 10630,
To drop the LM3S9D96 host into Suspend,

USBHCDSuspend(0);         // drop the bus into Suspend
SysCtlUSBPLLDisable();    // stop USB PLL

It takes 10 ms at most, until the target device goes into Suspend, after the firmware calls this routine.

To recover from Suspend,

SysCtlUSBPLLEnable();     // start USB PLL
while ( !(SysCtlIntStatus(0) & SYSCTL_RIS_USBPLLLRIS) );  // wait for PLL lock
USBHCDResume(0);          // put Resume to the bus

Tsuneo

PS.

In your above post, USBHCDMain() is called from two tasks.

As the routines in USB stack are not re-entrant, it should cause odd error.

Anyway, you don't need to call USBHCDMain() while the bus is in Suspend, because nothing occurs on the bus.


Viewing all articles
Browse latest Browse all 216317

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>