Serasidis / STM32_HID_Bootloader

Driverless USB HID bootloader and flashing tool for STM32F10X devices
399 stars 149 forks source link

STM32F407G-DISC1 compatibility with HID Bootloader #47

Closed HappySamuel closed 2 years ago

HappySamuel commented 3 years ago

Hi

As i saw there is stm32f407 bootloader support, so I bought a STM32F407G-DISC1 board. However, when i successfully uploaded the HID bootloader, the direct USB (known as STM32 Virtual COM Port) doesn't appear in Device Manager (Windows 10). Neither can I find it on Arduino IDE.

Then 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.

I guess i must have missed some steps. Please guide me the steps on getting it up to work. Or is there any video link that show the steps like the one for bluepill board using HID bootloader?

Best, Samuel

geraldjust commented 2 years ago

you need to upload the bootloader via SWD. try using stm32cube Programmer (programming USB port). To enter bootloader mode make sure you press the button you designated for it as your plugging in power/USB cable. Windows should appear as HID device. ( using native USB port)

under arduino select the right board. make sure usb CDC is on. Serial set to generic serial. Upload method as HID 2.2 . Upload any sketch to it. From here on out, as long as you got usb CDC on the sketch will auto upload via HID without the need of the "plugin while pressing button" way.

HappySamuel commented 2 years ago

Hi

I have successfully upload the HID bootloader diymroe_stm32f407vgt_pe0.bin into STM32F407G-DISC1 board using the following steps:

  1. Prepare hardware for UART bootloader. Get board in hands and do stuff: (1) Find BOOT0 pin and set it to HIGH by connecting VDD pin to BOOT0 pin (2) Find BOOT1 (PB2) pin and set it LOW by connecting GND pin to BOOT1 (PB2) pin (3) Reset device
  2. Connect the USB to UART converter with STM32F407G-DISC1 board. STM32F4 supports many UART combination: TX: PA9; RX: PA10 TX: PB10; RX: PB11 TX: PC10; RX: PC11 However, on the STM32F407G-DISC1 board, pins PA9 and PA10 wouldn't work, because they have capacitor for USB connected to this pin. So proceed with any other 2 combinations, PB10 & PB11 or PC10 & PC11.
  3. Open STM32CubeProgrammer and connect the board via UART, and then go to Erasing & Programming page. Once enter the page, go to the Download section, browse diymroe_stm32f407vgt_pe0.bin on the file path. Finally by clicking Start Programming, the HID Bootloader will be downloaded into the board.
  4. Once the HID bootloader has completely downloaded into the board, find BOOT0 pin and set it to LOW by disconnecting it fromVDD pin and connect to GND pin. And then, carry out with a reset for the board. By doing so, the HID bootloader will boot from flash and not waiting for UART.

Lastly, for anyone who use the Arduino IDE to upload code into STM32F407G-DISC1 via HID Bootloader, do make sure you use below configuration: Board: "Generic STM32F4 series" Board part number: "DIYMORE STM32F407VGT" U(S)ART support: "Enabled (generic 'Serial')" USB support (if available): "CDC (generic 'Serial' supersede U(S)ART)" Upload method: "HID Bootloader 2.2"

Hope above step-by-step guide can help those who wants to use HID Bootloader on STM32F407G-DISC1 too.

Best, Samuel

Pey-mma commented 6 months ago

Hello everyone, I just wanted to thank you all for the helps you did to me in this discussion. And if I could ask, I have a problem that after flashing the bootloader onto the STM32F407G-disc1, I couldn't program using the HID bootloader also the serial monitor doesn't work neither. Any idea of what could be wrong? Appreciate that