cancel
Showing results for 
Search instead for 
Did you mean: 

USB cable detection in bootloader, VBUS or DP/DM?

Mike Ciholas
Associate III

App note AN2606 on bootloader operation, figure 57, shows the flow chart for the STM32H74/75 series. One block is labeled "USB cable Detected". Exactly what is the criteria for this? Is it based on DP/DM states? Is it based on VBUS measurement? Something else?

I have a design that is IO heavy and would like to use the VBUS pin for other purposes than sensing USB voltage. If I don't hook up VBUS to the USB connector, does the bootloader still detect the USB cable and enter the bootloader? Or does it depend on the VBUS for cable sensing?

If it does depend on VBUS for cable sensing, the cable might be just a power supply (phone charger, say) and the bootloader would get stuck listening to nothing instead of continuing to search among the various other options (UART, SPI, I2C, CAN, etc). So I'm hopeful VBUS sensing is not the criteria.

I don't need OTG functions, just simple USB FS device, so I am trying to use just DP/DM on the USB port.

Thanks.

15 REPLIES 15

I don't know. That sounds to me like the conditions for the hub to detect a device.

... and the hub (or host) in turn generates the Reset signal on the bus ("extended SE0", i.e. both DP and DM pulled low for a prescribed time), which is then detected by device, to start the enumeration process.

VBUS detection is a different issue, reasons preceding the detection/reset/enumeration process. This is required by USB2.0 7.1.5.1.:

The voltage source on the pull-up resistor must be derived from or controlled by the power supplied on the USB

cable such that when V BUS is removed, the pull-up resistor does not supply current on the data line to which it is

attached.

In bus-powered devices, this requirement is met "naturally".

JW

Thanks Jan. Will the chip go into the USB boot loader if it detects a certain pin state (or single toggle) on DM (PA11) and DP (PA12) or does it require a more complicated transaction?

> Will the chip go into the USB boot loader if it detects a certain pin state (or single toggle) on DM (PA11) and DP (PA12) or does it require a more complicated transaction?

I don't know. I would expect that bootloader first tests HSE presence, and if present, it enables the DP pullup and if Reset is detected (i.e. both DP and DM goes down), the DFU bootloader is started. Whether it implements some sort of timeout and goes out of DFU bootloader if there is no enumeration from the host (PC) side, I don't know.

JW

rammit
Senior

Ahh ok. That helps. So if it just a matter of DP going low a short while after reset, assuming DM is already low, than I can see how our design might be going into the USB bootloader. I'll try to get more info from ST. Thanks!

rammit
Senior

ST was no help.

By pulling PA11 (USB_DM) high the blank chip did NOT go into the USB bootloader and we were able to access the UART bootloader. So, it looks like it is just looking for a static state of pins PA11 and PA12. Not ideal, but should be documented somewhere.