DFU mode HSE is not oscillating

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
blackberryer
Posts: 24
Joined: Sat Apr 05, 2025 6:52 pm
Been thanked: 4 times

DFU mode HSE is not oscillating

Post by blackberryer »

I am debugging the DFU function, and when I pull BOOT0 high and BOOT1 low, the PC prompts an unknown USB device (device descriptor request failed). Currently, I have identified that the HSE is not oscillating, but it works normally during regular startup. I am not sure if this is related to the program configuration. Do you have any suggestions regarding this?

Code: Select all

#define BOARD_OTG_NOVBUSSENS


I used #define BOARD_OTG_NOVBUSSENS in board.h to disable VBYSSENS.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: DFU mode HSE is not oscillating

Post by Giovanni »

Hi,

You need to provide context, which device are you using?

Giovanni
blackberryer
Posts: 24
Joined: Sat Apr 05, 2025 6:52 pm
Been thanked: 4 times

Re: DFU mode HSE is not oscillating

Post by blackberryer »

Giovanni wrote:Hi,

You need to provide context, which device are you using?

Giovanni


I am using the STM32F405. I google a lot of articles and suspect that the slow startup of the HSE causes me to enter DFU mode without detecting the external crystal, which leads to USB enumeration failure.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: DFU mode HSE is not oscillating

Post by Giovanni »

I doubt that this is ChibiOS-related, perhaps you could try a different crystal brand.

Giovanni
User avatar
FXCoder
Posts: 403
Joined: Sun Jun 12, 2016 4:10 am
Has thanked: 188 times
Been thanked: 134 times

Re: DFU mode HSE is not oscillating

Post by FXCoder »

FYI

Code: Select all

#define BOARD_OTG_NOVBUSSENS
has no effect on the internal STM32 boot loader (only on the ChibiOS driver).

AN2606 provides details on the internal STM32 boot loader.
See https://www.st.com/resource/en/applicat ... 167594.pdf
I expect from a quick look at AN2606 that you will need to have the VBUS pin connected for the STM32 boot loader to detect USB is connected.
blackberryer
Posts: 24
Joined: Sat Apr 05, 2025 6:52 pm
Been thanked: 4 times

Re: DFU mode HSE is not oscillating

Post by blackberryer »

FXCoder wrote:FYI

Code: Select all

#define BOARD_OTG_NOVBUSSENS
has no effect on the internal STM32 boot loader (only on the ChibiOS driver).

AN2606 provides details on the internal STM32 boot loader.
See https://www.st.com/resource/en/applicat ... 167594.pdf
I expect from a quick look at AN2606 that you will need to have the VBUS pin connected for the STM32 boot loader to detect USB is connected.


I indeed did not connect PA9 to VBUS because I was unsure whether it was necessary, so the schematic does not connect VBUS. Therefore, I enabled this macro to disable it, so that I could successfully use USB. Currently, there is a problem where I need to power off and then power on again to trigger USB detection. Now, are you telling me that PA9 must be connected to VBUS? My PA9 is connected to the USB and UART bridge CH340. Can PA9 be connected to VDD33 instead of VBUS, since the UART operates at a 3.3V level?
blackberryer
Posts: 24
Joined: Sat Apr 05, 2025 6:52 pm
Been thanked: 4 times

Re: DFU mode HSE is not oscillating

Post by blackberryer »

Giovanni wrote:I doubt that this is ChibiOS-related, perhaps you could try a different crystal brand.

Giovanni

This issue seems to be resolved; it should be a pure hardware problem. I tried reducing the matching capacitance of the crystal (from 22PF to 18PF) to speed up the oscillation, and surprisingly, it worked! Now I can normally download the program through DFU. The specification of my crystal states the CL is 10PF, 20PF, or specify, and this parameter has a bit of flexibility. Properly reducing the matching capacitance allows the crystal to function properly.
Post Reply