Page 1 of 1
DFU mode HSE is not oscillating
Posted: Fri May 09, 2025 5:31 pm
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?
I used #define BOARD_OTG_NOVBUSSENS in board.h to disable VBYSSENS.
Re: DFU mode HSE is not oscillating
Posted: Fri May 09, 2025 6:32 pm
by Giovanni
Hi,
You need to provide context, which device are you using?
Giovanni
Re: DFU mode HSE is not oscillating
Posted: Fri May 09, 2025 9:23 pm
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.
Re: DFU mode HSE is not oscillating
Posted: Fri May 09, 2025 9:49 pm
by Giovanni
I doubt that this is ChibiOS-related, perhaps you could try a different crystal brand.
Giovanni
Re: DFU mode HSE is not oscillating
Posted: Sat May 10, 2025 6:40 am
by FXCoder
FYI
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.pdfI 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.
Re: DFU mode HSE is not oscillating
Posted: Sat May 10, 2025 8:01 am
by blackberryer
FXCoder wrote:FYI
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.pdfI 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?
Re: DFU mode HSE is not oscillating
Posted: Sat May 10, 2025 8:36 am
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.