cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble with DFU

jacksonritchey
Associate
Posted on June 17, 2016 at 18:03

Hello,

I am having a problem with dfu on the STM32L476 Discovery board. For testing purposes, I generated a binary file that is 24428 bytes long such that every byte in the file is the value '0xAA'. 

When I download the file to the uC, using both st's dfu utility and the dfu-util tool on linux, both tools complete the process without reporting any kind of errors. When I verify the program with st's utility it says the data written does not match the contents of the file. 

When I upload the data from the device and compare it to my generated binary file, I can clearly see that not all of the content in the generated file was written to the uC's flash during the dfu process. The last 1788 bytes that should be '0xAA' are '0xFF' instead, which indicates to me that not all of the data was written. 

Am I wrong for assuming that all the content should be there? The reason this is of concern is that the generated binary file is the exact same size as the program I am trying to download using dfu. My program does not work when I use dfu, however it does work if I load it on with the debugger. When I compare my program's bin file to the contents written to flash, it is also cut short by 1788 bytes when I use dfu. When I use the debugger to load the program, all of the content written to flash matches my program's binary file. 

Has anyone else encountered this same kind of problem and know why this is happening?

I uploaded the file I generated(test.bin) and the file that was read from flash(test_upload.bin) if anyone wants to try and reproduce my problem. 

#stm32l4 #dfu
2 REPLIES 2
Posted on June 17, 2016 at 19:21

So are you using the ST-LINK Utilities, or the DFU Manager/Demo?

What version of the DFU Manager are you using? And why not attach the .DFU file you're actually programming the device with?

Does it work better if you create the .DFU from a .HEX?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jacksonritchey
Associate
Posted on June 17, 2016 at 20:11

I am using DFU manager v3.0.5.

I also tried it with dfu-util v0.8 (latest in ubuntu repo)

both had the same problem.

I attached the .dfu file that was generated. I havent tried with a .hex file, however I did take a look at the contents of the .dfu file and it has the correct data inside of it.

________________

Attachments :

aa.dfu : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I17C&d=%2Fa%2F0X0000000bjN%2FCfwUBXdIu9lwzThbIA5HCyJAfJl7kaUT_9lfG7mMeOM&asPdf=false