cancel
Showing results for 
Search instead for 
Did you mean: 

DFU DFUSE problem with STM32L4 (STM32L476VG)

imalamoud
Associate
Posted on October 22, 2016 at 21:50

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 start

Tried 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.

1 ACCEPTED SOLUTION

Accepted Solutions
Lubos KOUDELKA
ST Employee
Posted on January 25, 2017 at 15:24

Hello,

your problem seems to be connected to restriction described in

http://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf

- 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,

Lubos

View solution in original post

3 REPLIES 3
slimen
Senior
Posted on October 29, 2016 at 11:09

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:

-

http://www.st.com/content/ccc/resource/technical/document/application_note/6a/17/92/02/58/98/45/0c/CD00264379.pdf/files/CD00264379.pdf/jcr:content/translations/en.CD00264379.pdf

: USB DFU protocol used in the STM32 bootloader

-

http://www.st.com/content/ccc/resource/technical/document/user_manual/3f/61/72/ff/c5/5a/4a/7b/CD00155676.pdf/files/CD00155676.pdf/jcr:content/translations/en.CD00155676.pdf

: Getting started with DfuSe USB device firmware upgrade 

-

http://rc.fdr.hu/UM0391.pdf

 : DfuSe File Format. Specification (you will find this manual, once you install DFuSe demos in you PC)

Regards

Lubos KOUDELKA
ST Employee
Posted on January 25, 2017 at 15:24

Hello,

your problem seems to be connected to restriction described in

http://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf

- 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,

Lubos
Posted on February 03, 2017 at 22:52

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.