DFU mode HSE is not oscillating

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

DFU mode HSE is not oscillating

Postby blackberryer » Fri May 09, 2025 5:31 pm

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: 14627
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1132 times
Been thanked: 944 times

Re: DFU mode HSE is not oscillating

Postby Giovanni » Fri May 09, 2025 6:32 pm

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

Postby blackberryer » Fri May 09, 2025 9:23 pm

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: 14627
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1132 times
Been thanked: 944 times

Re: DFU mode HSE is not oscillating

Postby Giovanni » Fri May 09, 2025 9:49 pm

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

Giovanni

User avatar
FXCoder
Posts: 396
Joined: Sun Jun 12, 2016 4:10 am
Location: Sydney, Australia
Has thanked: 185 times
Been thanked: 133 times

Re: DFU mode HSE is not oscillating

Postby FXCoder » Sat May 10, 2025 6:40 am

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

Postby blackberryer » Sat May 10, 2025 8:01 am

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

Postby blackberryer » Sat May 10, 2025 8:36 am

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.


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 2 guests