2022-08-16 12:55 AM
I was trying to flash stm32f722ret6 via DFU mode. DfuSe Demo typing successful status but firmware doesn't update.
But when I download .hex file via ST-LINK a firmware works. What could be the problem?
2022-08-16 03:57 AM
Welcome, @Community member, to the community!
The clock could be the cause of this. DFU runs via the internal bootloader, which requires certain crystal frequencies in order to synchronise. The AN2606 writes about this in section 4.1:
For STM32 devices embedding bootloader using the DFU/CAN interface in which the external clock source (HSE) is required for DFU/CAN operations, the detection of the HSE value is done dynamically by the bootloader firmware and is based on the internal oscillator clock (HSI, MSI). When (because of temperature variations or other conditions) the internal oscillator precision is altered above the tolerance band (1% around the theoretical value), the bootloader might calculate a wrong HSE frequency value. In this case, the bootloader DFU/CAN interfaces might malfunction or not work at all.
Please also check AN2606 which clock frequency is required for your STM32.
Does it answer your question?
Regards
/Peter
2022-08-16 10:14 AM
Thanks for reply
In my scheme used KXO-V97T 8MHz as HSE. I searched in 36.2 section in AN2606 which clock frequency is required for my MCU. It only says that SYSCLK set in 60MHz and USB clock to 48MHz. Without a specific value of HSE clock. Exist would other reasons my problem?
2022-08-16 12:05 PM
From despair I conducted an experiment. I flashed my chip via ST-LINK. Then ran the upload action from the chip to backup.dfu in DfuSe Demo. Then erased the chip by using ST-LINK. And flashed backup.dfu back into the chip via DFU mode. It works! It means that the convert function from .hex to .dfu in DfuFileMgr doesn't work. And HSE clock selected correctly. What could you recommend?
2022-08-16 12:16 PM
How does the binary pulled from an ST-LINK FLASH vs a DFU FLASH look comparatively.
ie FC /B IMAGE1.BIN IMAGE2.BIN
I've posted a tool HEX2DFU in the past, it dealt with some 8-byte alignment issues where the flash-lines are 64-bit wide.
2022-08-16 10:24 PM
2022-08-16 10:27 PM
2022-08-16 10:53 PM
Where I can download hex2dfu tool?
2022-08-17 01:05 AM
@Community member released the tool HEX2DFU in 2018 as a ZIP file here.
Good luck!
/Peter
2022-08-19 03:06 PM
Failed to create dfu file. The only option I see is flashing through ST-LINK and uploads DFU file by using DfuSe. Very strange.