AnsweredAssumed Answered

Having trouble with DFU

Question asked by ritchey.jack on Jun 17, 2016
Latest reply on Jun 17, 2016 by ritchey.jack
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.