Page 1 of 1

STM32 Virtual COM Port not detected after HID Bootloader uploaded on STM32F407G-DISC1

Posted: Fri Jul 16, 2021 7:53 am
by HappySamuel
Hi

I saw that HID bootloader has support STM32F407 board, therefore i bought a STM32F407G-DISC1 board. I am able to upload the HID bootloader onto the board via STM32CubeProgrammer successfully. However, the direct USB (known as STM32 Virtual COM Port) can neither be detected by Device Manager (Windows 10) nor Arduino IDE. Although, i can upload the code using HID bootloader in Arduino IDE successfully, but the STM32 Virtual COM Port still cannot be detected, so i can't use the Serial Monitor at all.

I tried to upload the code by using STM32CubeProgrammer(SWD) as upload method on Arduino IDE, STM32 Virtual COM Port can be detected by both Device Manager and Arduino IDE. But this makes me unable to have the Direct USB as programming USB and native USB at the same time, which is a nice feature of HID bootloader since STM32F103 on bluepill.

Is there any solution / guidance on this?

Best,
Samuel

Re: STM32 Virtual COM Port not detected after HID Bootloader uploaded on STM32F407G-DISC1

Posted: Fri Jul 16, 2021 10:45 pm
by mrburnette
Which of :https://github.com/search?q=STM32+HID+bootloader ???

You may also want to look deeper into the USB stack with:
https://docs.microsoft.com/en-us/window ... er/usbview
But this makes me unable to have the Direct USB as programming USB and native USB at the same time, which is a nice feature of HID bootloader since STM32F103 on bluepill.
I'm of the opinion that 3rd party tools (inc. many libs) cause more issues than they solve: P.I.T.A.
I tried to upload the code by using STM32CubeProgrammer(SWD) as upload method on Arduino IDE, STM32 Virtual COM Port can be detected by both Device Manager and Arduino IDE.
... appears the Windows driver is loading correctly.

Re: STM32 Virtual COM Port not detected after HID Bootloader uploaded on STM32F407G-DISC1

Posted: Fri Jul 16, 2021 11:36 pm
by ag123
you need to do a usb reset - also called a 'single ended zero', to ask the host to enumerate the buses again.
https://www.usbmadesimple.co.uk/ums_3.htm

oh and i think stm32f407g has its own usb dfu boot loader, all it takes is to set boot0 and reset.
i think there may even be a way to trigger it by rebooting from your sketch

Re: STM32 Virtual COM Port not detected after HID Bootloader uploaded on STM32F407G-DISC1

Posted: Sat Jul 24, 2021 11:45 am
by Rekog
It's totally normal, STM32 USB device doesn't support both of those protocols, either one or other.

Untitled.png
Untitled.png (38.89 KiB) Viewed 9146 times

Re: STM32 Virtual COM Port not detected after HID Bootloader uploaded on STM32F407G-DISC1

Posted: Sat Jul 24, 2021 12:29 pm
by hobbya
Your board comes with STLink v2 which can provide a virtual com port. So you may have the following set up:
native USB of STM32F407 -- for flashing via embedded STM bootloader
USB of STLink -- for virtual com

However instead of using 2 USB ports you can actually use just the STLink since it supports both flashing via SWD and virtual com on a single USB.