2016-10-22 12:50 PM
Hello,
We are implementing a product based on STM32L476VG and need to use DFU
To test the procedure we used STM32L476VG Discovery board. The following issue has been found:- Compiled a simple LED switching application in IAR converted to DFU by the file manager (tried both bin and hex)
- Tested via ST-LINK - firmware works fine
- Started DFUSE utility
- Connected BOOT0 to 3V, reset - the board presented itself as DFU- Downloaded DFU- removed BOOT0 connection, pressed reset - application does not startTried both DFUSe 3.0.5 and DFUTester in the package - same result - downloads OK but does not start. Also tried to set flash address to 0x080000000 during ''to bin'' conversion - no effect.Same setup, same host tested with STM32F071 works without a problem.
What could be a problem? Any help would be appreciated.Solved! Go to Solution.
2017-01-25 06:24 AM
Hello,
your problem seems to be connected to restriction described in - STM32 microcontroller system memory boot mode. For STM32L476xx/486xx:'For memory write operations using DFU interface: If the buffer size is larger than 256 bytes and not multiple of 8 bytes, the write memory operation result is corrupted.Workaround: if the file size is larger than 256 bytes, add byte padding to align it on 8-bytes multiple size.'This problem is visible during verification. Do you verify the code after download?Please verify in STlink utility, that the .bin file, you're passing to the DFU file manager is byte aligned. If not, use some hex editor, add padding bytes (0xff) to end of file to align it on 8-bytes multiple size. Then use this bin to DFU generation.best regards,
Lubos2016-10-29 02:09 AM
Hello,
Which firmware version are you using ? Maybe you have to update firmware, or you should review the configuration pin following the datasheet and reference manual.Also, an idea to try a different USB cable.Why not attach the .DFU file you're actually programming the device with?You can refer to these documents for using DFU on STM32:
- : USB DFU protocol used in the STM32 bootloader- : Getting started with DfuSe USB device firmware upgrade-
: DfuSe File Format. Specification (you will find this manual, once you install DFuSe demos in you PC)Regards2017-01-25 06:24 AM
Hello,
your problem seems to be connected to restriction described in - STM32 microcontroller system memory boot mode. For STM32L476xx/486xx:'For memory write operations using DFU interface: If the buffer size is larger than 256 bytes and not multiple of 8 bytes, the write memory operation result is corrupted.Workaround: if the file size is larger than 256 bytes, add byte padding to align it on 8-bytes multiple size.'This problem is visible during verification. Do you verify the code after download?Please verify in STlink utility, that the .bin file, you're passing to the DFU file manager is byte aligned. If not, use some hex editor, add padding bytes (0xff) to end of file to align it on 8-bytes multiple size. Then use this bin to DFU generation.best regards,
Lubos2017-02-03 02:52 PM
We had the same issue and Lubos' fixed worked. We added FF's to the end of the file to make it 8-byte aligned.
Thanks Lubos.
We also found that we can fix the hex file by padding the end of the file to make it 8-byte aligned.
Padding the hex file requires one to generate a new checksum for the last line.