2024-05-05 04:19 AM - edited 2024-05-05 09:58 PM
Hello,
Thank you in advance for your assistance.
I have designed a circuit with STM32F446. I am using an external 25MHz crystal. The main application program runs fine without any issues, and USB communication works. However, on some boards, I am unable to put the processor into USB DFU mode. I have several boards, and most of them enter DFU mode correctly. I am controlling the Reset and Boot pins externally with another microcontroller. I am monitoring the NRST and BOOT0 pins with an oscilloscope, and there seems to be no problem.
I have also tried using a 10MHz crystal with 20pF capacitors, but still couldn't get the processor into DFU mode. I even tried the UART bootloader method by disconnecting the USB cable, but I still fail to get a response from the processor to the 0x7F command.
As mentioned earlier, DFU mode works perfectly fine on many other boards. However, despite checking everything, I am unable to put the processor into DFU boot mode on some boards.
2024-05-05 04:51 AM
I see few if any pull resistors on the other pins related to bootloader entry. Maybe some floating pin is toggling and some other bootloader mode is entered.
2024-05-05 07:18 PM
Hi Dear Bonnes. I've double checked the bootloader relative pins. And I pulled high CAN2 Rx pins already to be ensure.
But I've noticed today that the MCU does enter DFU mode when the temperature is low. If I heat the MCU by using hot air, it doesn't enter DFU and UART bootloader.
I had doupts about external crystal. Bu I read the document and it says the MCU use internal OSC when it doesn't detect USB cable and enter into uart bootloader.
Even if I try to enter UART bootloader, the mcu doesn't reply to 0x7F when the ambient temperature is high. After a while and make the mcu cool, it can enters into DFU and UART bootloader...
2024-05-06 02:18 AM
Maybe the crystal has sloppy tolerances and only is inside the USB spec with low board temeratures? Does the crystal oscillate at all or does it start up very slow? Are the 10 pF load for the crystal what is calculated or is that some standard value you use(AN2867)? Cold solder joints? Some supply voltage at an exteme end?
2024-05-06 02:48 AM
Dear Bonnes,
I've tried with different crystals and different crystal load capacitors. It works on main program and I see the crystal is working fine.
Today, I added some initialize code for manuel jumping to Bootloader(0x1FFF000)...
In this way, the mcu jumps to dfu bootloader and everything works fine.
But I am not able to enter DFU with using reset and boot pin.
Thanks for your helps, btw...
a
2024-06-22 11:21 AM
I have faced 100% the same issue. Except DFU is not working from the button in the room temp, only when I heat up the PCB a bit with a heat gun. Have you found the problem?
I have 10 boards - 4 of them cannot enter DFU from the button but works fine if DFU is called from the code.
Maybe it is not the secret where you sourced the STMs?
2024-06-22 02:42 PM
Dear @bymrz @Ugnas @Uwe Bonnes ,
This behavior is mainly due to a wrong Bootloader detection of the external crystal frequency for exemple detection =24Mhz where it is 25MHz and so baudrate of UART and USB using asynchronous clocking will be faulty. This behavior is described here
to confirm this hypothesis, please try a crystal of 8MHz or 4MHz and let us know .
Hope it helps .
STOne-32
2024-06-22 11:55 PM
Sorry, I forgot to mention that I am using 8 Mhz crystal with internal load capacitors (P/N: CSTCE8M00G52-R0 ). I tried to re-solder crystal from working boards and switch them hoping that it will help, but the result is the same.
Is there any more ways to confirm that?
2024-06-23 04:30 AM - edited 2024-06-23 05:36 AM
@bymrz, you seem to be producing a commercial quantity of boards and can perhaps put some engineering towards resolving this issue for others as well.
1. Are you able to put together a small program that measures the HSI frequency of your "good" and "bad boards"?
AN4067 describes how to do it, See for example STSW-STM32132 for a code library which does this for the STM32F0x. (or STSW-STM32076 for L1, or STSW-STM32021 For F10x).
2. Can you confirm that your "good" and "bad" boards can be distinguished by the result of this test?
3. Can you resolve the issue by adjusting the calibration values (as described in AN5067, which STOne-32 suggested)?
2024-06-23 10:41 AM
Thank you for the time providing all the information.
I noticed that all the documentation is provided for different family STMs. Is procedure the same for F4 family? Can the same timer (TIM14) be used to connect directly to the HSI?