cancel
Showing results for 
Search instead for 
Did you mean: 

DFU -- USB shows up as Unknown USB device when ST-Link v2 is not connected.

MicroDanger
Associate

Hello All,

I have an STM32F407VET6 on a custom board. I am using a "magic word" stored at 0x2001C400 to persist through a system reset and drop into the bootloader.

When I do this process while my ST-Link v2 is connected I can unplug the USB cable and plug it back in, open ST Cube Programmer, click on USB, and connect. The USB cable shows up in the device manager as STM32 BOOTLOADER. Everything's good.

When I do this same process without the ST-Link being connected the USB shows up in the device manager as Unknown USB device and is not recognized in Cube Programmer.

My ST-Link is connected using only PIN1 VAPP, PIN5 TDI tied to PIN6 GND, PIN7 TMS_SWDIO, and PIN9 TCK_SWCLK.

What behavior is the ST-Link causing that I can reproduce in code as I switch to DFU through USB, and avoid needing the ST-Link connection?

Thank you!

 

2 REPLIES 2
Dazai
Associate III

Is your ST Link connected to the board also, or is it just plugged in to a different USB port than the other cable that connects to the USB on your board?

I had an issue with the USB DFU bootloader not identifying in Windows when connected to my laptop through a USB dock. I was able to fix it by buying a USB C to USB micro cable (this one ) so the board is directly connected to my laptop.  I'm not totally sure why it worked, but my guess is the host was trying to use USB 3/C speeds through the dock.

Another possibility is the "BOOT" pins are not set the way they need to be on your custom board at powerup to get into USB DFU mode, but if that were the case I wouldn't think it would work with the ST Link connected, unless the ST Link is somehow able to get the STM32 to enter USB DFU mode without the BOOT pins.  In any case the datasheet for the STM32 on your board has information about the pin settings to get into USB DFU mode.

Hey Dazai,

the ST Link is connected to the Win 10 PC and to the PCB.

My ST-Link is connected using only PIN1 VAPP, PIN5 TDI tied to PIN6 GND, PIN7 TMS_SWDIO, and PIN9 TCK_SWCLK.

I found that connecting only the ground pin on the PCB to the ST Link ground or earth ground is what was making the difference.

It seems that the PCB isolation is causing this issue since the DFU programming USB cable does not allow ST cube programmer access, but connecting ground through the ST Link does allow ST cube programmer access.

Just grounding the PCB ST Link ground to earth fixed this issue, so the PCB grounding will be modified to test this fix.

Thank you,

MicroDanger