cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F105 DFU Bootloader Grief

Tad_E
Associate II

Hi all.

I'm new to STM, but have been designing and making embedded MCU products for over ten years.

I was drawn to the STM32F105 series because of the USB DFU, to allow for field updates for prospective customers to update a product we're developing. Outside of USB DFU functionality, we just need 3x UART's, one GPI, one GPO. That's it. We steer clear of USART1 because of it's overlap with OTG_FS pins. We have got our product working using a ST-Link programmer, but not as yet using the USB DFU.

Our USB connection just isn't enumerating. The wiring is correct when compared to off-the-shelf STM32 enabled boards with OTG USB interfaces.

I am across the date code bootloader issue as described in AN2606, our chips definitely come with bootloader 2.2. I have VBUS from the USB-C tied to PA9 (OTG_FS_VBUS). Yes, USB-C but with the 5.1K resistors between CC1, CC2 and GND. NRST is pulled to 3V3 with a 10K pull-up. Boot0 and Boot1 is pulled to GND via a 10K pull-down, Boot0 also runs to a tactile NO pushbutton that throws to 3V3. Holding the button down while applying power does successfully put the micro into bootloader mode (tested with J-Link), so the pattern is correct.

I have an external 8MHz crystal. I read somewhere that folks specifically had no luck with this and had to use 25MHz to get USB DFU. Is that correct? I assume the IOC in STM32CubeIDE is only relevant for my program and not for the stock bootloader? (Re Clock Configuration, Connectivity>USB_OTG_FS in particular)? When I put our code into a program I configured in STM32CubeIDE for the STM32F405 (Adafruit Feather STM32F405 Express) and uploaded it, the clock configuration and USB_OTG_FS settings didn't make any difference to how the board behaved in bootloader mode, its USB DFU worked fine.

Do I need any other pins connected? OTG_FS_ID? OTG_FS_SOF?

Many thanks in advance!

5 REPLIES 5
jiangfan
ST Employee

about STM32F105 USB/DFU, you may refer to official ST board schematics, STM3210C-EVAL/MB784. Unfortunately this board is OBSOLETE. Anyway, it may be found, so, you can refer to following schematics

MB784-USB-OTG.png

jiangfan
ST Employee

about "I have an external 8MHz crystal. I read somewhere that folks specifically had no luck with this and had to use 25MHz to get USB DFU. Is that correct? "

I don't think so. 25MHz is mainly for ethernet. 8MHz crystal should be OK if you don't use ethernet - you use USB/OTG only.

FBL
ST Employee

Hi @Tad_E 

I would add that STM32F105 is embedding internally pull up on DP. So, no need to add an external one.

Additional pins (OTG_FS_ID, OTG_FS_SOF) are not required to be connected for USB DFU to work. 

  1. OTG_FS_ID pin is meant for changing data roles dynamically (host to device and reversly).
  2. _SOF pin is essentially used in host mode to synchronize with devices especially for isochronous transfers.

About clock configuration settings, it could be an issue in dividers combination proposed by CubeMX clock tree. First, ensure that bootloader mode is correctly entered by checking with a tool like STM32CubeProgrammer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


MM..1
Chief III

Are you sure 2.2 read 19.3 carefully... I recomm change to more modern less errata stm.

Tad_E
Associate II

Hi folks,

I iterated my design and have got this working now, but only with STM32 Cube Programmer on Windows, I still can't get it to work on my M2 Macbook Pro.

Also, on Windows, when I plug it in with my BOOT0 button held, it enumerates and disconnects twice before it stabilises. It's fine after that, and I probably wouldn't notice if Windows didn't play that sound each time it does that, but it's a curiosity.

So thank you for your help.. but do point me in the right direction if there's a way to get it to play nice with MacOS on Apple silicon. Other chips, like the STM32F405, do play nice on my Macbook Pro.

Cheers!