cancel
Showing results for 
Search instead for 
Did you mean: 

USB disconnect without pullup circuitry

stforum.tormod9
Associate II
Posted on August 26, 2012 at 13:35

The device has a fixed pullup on D+ (1.8k resistor to 3V). In software I am switching back and forth between a USB DFU bootloader and a non-USB application. My problem is that after returning to the bootloader, it is stuck waiting for the USB connection to come up and I have to replug the USB cable or power cycle the device in order to continue. It is this manual intervention that I would like to get rid off.

The host still ''sees'' the DFU device after the jump to the application, and it does not reenumerate the device at any point. So how can I force this reenumeration without pullup circuitry?

I have tried USB reset from the device (CNTR_FRES) and shutting down the USB (CNTR_PDWN) like in the PowerOff() functions in ST's USB libraries but the host does not react to it.

In the ''

/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/DispForm.aspx?ID=1910

'' thread Niksa suggests controlling the pin using GPIO and force it down against the pull-up but following up, lanchon warns against hacks that might damage the STM32. Is the USB analog tranceiver more robust than the GPIO, so that by disabling the USB peripheral and having GPIO_A active, there is a larger risk of hardware damage? I am studying Figure 13 and Table 29 in the RM0008 reference manual but I am not sure I get the full picture. Is the USB peripheral connected like an alternate function input/output?

Does anyone have a suggestion how I can do this in a safe way? ''Safe'' as in not destroying hardware, reliability of operation is less important.

Thanks,

Tormod

null
2 REPLIES 2
ColdWeather
Senior
Posted on August 26, 2012 at 14:43

Can you redesign the hardware regarding 1K8 pull-up? If so, just connect 1K5..1K8 resistor between a GPIO pin and D+:

  1. controlling the GPIO you can connect/disconnect USB;
  2. the resistor along with the internal protection diodes would keep GPIO safe against any transients; wanna be absolutely sure - add a TVS at the pin;
  3. Due to the fact that after reset the GPIO is in the high impedance state, no connection on USB would occur until you program the GPIO properly.

stforum.tormod9
Associate II
Posted on August 27, 2012 at 22:21

Thanks for the suggestion, ColdWeather. But hardware modifications are not desirable in this case. The long story is that I am developing development tools for the

http://www.seeedstudio.com/wiki/index.php?title=DSO_Nano

pocket oscilloscope to make it easier for people to reprogram it, and although the device is very hacker-friendly, a hardware modification adds another barrier for many.

BTW, the schematics are here:

http://code.google.com/p/dsonano/downloads/detail?name=DS0201 V2.3 Scheme.pdf

. There is a ''CESD5V0AP'' TVS on D+ and D-.

I guess that in order to pull the D+ down against the pull-up I have to configure the GPIO pin push-pull, and the N-MOS in the GPIO output driver will have to source the pull-up plus whatever is on the bus. I can see in figure 17 of RM0008 that the alternate functions share the same driver, but I wonder if the USB transceiver also shares it or if it hooks into the pin in a different way.