cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Data mismatch STM32L476JGY in DFU Mode USB with Cube Programmer

RVoel
Associate

I still have problems with the STM32 Programmer with USB connection to Controller in DFU Mode! The programming is running through with a verify error and the controller still has the old programm? See LOG from the programmer! Read and Connect is always possible but programming always comes with verify error? I am using 2.11 CubeProg Any suggestions?

 11:29:32 : USB speed  : Full Speed (12MBit/s)

 11:29:32 : Manuf. ID  : STMicroelectronics

 11:29:32 : Product ID : STM32 DownLoad Firmware Update

 11:29:32 : SN     : 206130A74734

 11:29:32 : DFU protocol: 1.1

 11:29:32 : Board    : --

 11:29:32 : IAP

 11:29:34 : UPLOADING ...

 11:29:34 :  Size     : 1048576 Bytes

 11:29:34 :  Address    : 0x8000000

 11:29:34 : Read progress:

 11:29:35 : Data read successfully

 11:29:35 : Time elapsed during the read operation is: 00:00:02.450

 11:29:47 : Memory Programming ...

 11:29:47 : Opening and parsing file: STM32L476_DFU.hex

 11:29:47 :  File     : STM32L476_DFU.hex

 11:29:47 :  Size     : 106.77 KB 

 11:29:47 :  Address    : 0x08000000 

 11:29:47 : Erasing memory corresponding to segment 0:

 11:29:47 : erasing sector 0000 @: 0x08000000 done

 11:29:47 : erasing sector 0001 @: 0x08004000 done

 11:29:47 : erasing sector 0002 @: 0x08008000 done

 11:29:47 : erasing sector 0003 @: 0x0800c000 done

 11:29:47 : erasing sector 0004 @: 0x08010000 done

 11:29:47 : Download in Progress:

 11:29:48 : File download complete

 11:29:48 : Time elapsed during download operation: 00:00:00.481

 11:29:48 : Verifying ...

 11:29:48 : Read progress:

 11:29:48 : Error: Data mismatch found at address 0x08000400 (byte = 0xB0 instead of 0xC0)

 11:29:48 : Error: Download verification failed

 11:29:48 : RUNNING Program ... 

 11:29:48 :  Address:   : 0x08000000

 11:29:48 : Start operation achieved successfully

 11:29:48 : Warning: Connection to USB device is lost

 11:29:48 : Disconnected from device.

1 ACCEPTED SOLUTION

Accepted Solutions
Aziz BRIGUI
ST Employee

Hello @RVoel​,

Thanks for posting 😀,

I think the issue is with your custom DFU bootloader and not with STM32CubeProgrammer. I am going to make a lot of assumptions in the next section. Please feel free to correct me by sharing further details

I think you are using STM32CubeMX to generate the DFU application without implementing the appropriate write/erase and read functions. If that's the case, I suggest you use the training under this link as reference.

Also, the MCU is using your DFU bootloader (located at 0x08000000) to load the main application in flash. So logically, the main application should be located elsewhere (there should be no overlap between the two applications). This protection is also dictated by the default value of USBD_DFU_MEDIA Interface in CubeMX (please refer to the description area). Let's say that the DFU application's size is under 16 KB, the main application should then be loaded after 0x08004000.

To change the target address of your main application. Some modifications in the linker file are necessary. If you have any issues with that don't hesitate to ask and share the IDE you're using.

I hope you find this helpful.

Aziz


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
Aziz BRIGUI
ST Employee

Hello @RVoel​,

Thanks for posting 😀,

I think the issue is with your custom DFU bootloader and not with STM32CubeProgrammer. I am going to make a lot of assumptions in the next section. Please feel free to correct me by sharing further details

I think you are using STM32CubeMX to generate the DFU application without implementing the appropriate write/erase and read functions. If that's the case, I suggest you use the training under this link as reference.

Also, the MCU is using your DFU bootloader (located at 0x08000000) to load the main application in flash. So logically, the main application should be located elsewhere (there should be no overlap between the two applications). This protection is also dictated by the default value of USBD_DFU_MEDIA Interface in CubeMX (please refer to the description area). Let's say that the DFU application's size is under 16 KB, the main application should then be loaded after 0x08004000.

To change the target address of your main application. Some modifications in the linker file are necessary. If you have any issues with that don't hesitate to ask and share the IDE you're using.

I hope you find this helpful.

Aziz


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.