AnsweredAssumed Answered

STM32L1xx DFU bootloader in FLASH memory problems

Question asked by pajik on Apr 2, 2014
Latest reply on Dec 26, 2014 by pajik
Hello, I have following objective and problems:

I want to have USB bootloader on STM32L1xx devices. My starting point is DfuSe demonstration example on PC side and Device_Firmware_Upgrade from STM32_USB-FS-Device_Lib example on microcontroller side. I want to add some custom features (like encryption etc) to bootloader...

Now the problem is:

I can get ST board (my custom HW) in DFU mode without problem, I can successfully DOWNLOAD *.dfu file to uC, or UPLOAD from uC to PC through DfuSe Demo, but when I run Verify, I get "Verify successful, but data not matching..." error which is accompanied by new info window, that is saying "Matching not good. First difference at address 0x08003110 etc..."

The strange is, that when I UPLOAD firmware from uC to computer and WinMerge it with original dfu file, only few bytes after 0x08003110 address are different from original firmware and rest of the firmware is identical. The firmware is actually working if I upgrade it through DFU, so I really don't understand, where the problem with those few different bytes arise from. (When I do full chip erase, than I write DFU bootloader on uC with ST-Link and than I upgrade firmware through DfuSe Demo, the firmware is working as well, and same bytes are different when I examine uC's content...)

I have tried with DfuSe Demo version 3.0.2 and with 3.0.3 as well. In 3.0.3 version, there the Verify button causes program crash. On uC side I have tried to build bootloader from STM32_USB-FS-Device_Lib V3.3.0 and V4.0.0 as well.

When I try to do the same thing on STM32F4 discovery board with DFU embedded in system memory (from production), the verification works all right.

Only problem, I suspect could arise from fact, that in my custom HW board, I use 26MHz external TCXO, so I run DFU from HSI oscillator, which shouldn't be so. But as I'm getting always same result and identical data differences I thing, this will not be the problem. Actually, it isn't the problem, because I ported project for STM32L discovery board, and the result is same - FW working after DFU upgrade, but few bytes are different, so verification goes wrong. And on STM32L board, there is a correct HSE oscillator.

Could anybody advise me where could be problem? I also noticed, that ST should release new, more stable version of DfuSe Demo, so hopefully, they release corresponding source code for uC as well.

Thanks for reading my long problem description!