cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030 Data mismatch error

MuratHepeyiler
Associate II

Hi, I am facing up Error: Data mismatch found at address error. I have tried to decrease the frequency, also make a modification to the linker script. Also, I used OCD. But, no success. When I open a new project it uploads. Whenever I change something in code, it goes even if I change to back the code. Could you help me?

I am working on STM32F030C8Tx, and using stm32f4-disco st-link. As a programmer STM32CubeProgrammer v2.4.0 and as an ide STM32CubeIDE Version: 1.5.1 Build: 9029_20201210_1234 (UTC).

Error message;

23:55:57:618 : r ap 0 @0x1FFFF7CC 0x00000004 bytes
23:55:57:683 : UPLOADING OPTION BYTES DATA ...
23:55:57:683 : Bank : 0x00
23:55:57:683 : Address : 0x1ffff800
23:55:57:683 : Size : 16 Bytes
23:55:57:684 : Reading data...
23:55:57:721 : r ap 0 @0x1FFFF800 0x00000010 bytes
23:55:57:721 : UPLOADING OPTION BYTES DATA ...
23:55:57:721 : Bank : 0x00
23:55:57:722 : Address : 0x1ffff800
23:55:57:722 : Size : 16 Bytes
23:55:57:722 : Reading data...
23:55:57:722 : r ap 0 @0x1FFFF800 0x00000010 bytes
23:55:57:727 : UPLOADING ...
23:55:57:727 : Size : 1024 Bytes
23:55:57:727 : Address : 0x8000000
23:55:57:728 : Read progress:
23:55:57:728 : Reading data...
23:55:57:802 : r ap 0 @0x08000000 0x00000400 bytes
23:55:57:802 : Data read successfully
23:55:57:802 : Time elapsed during the read operation is: 00:00:00.101
23:55:59:255 : Memory Programming ...
23:55:59:255 : Opening and parsing file: f030test.elf
23:55:59:257 : File : f030test.elf
23:55:59:257 : Size : 3852 Bytes
23:55:59:257 : Address : 0x08000000
23:55:59:258 : Erasing Segment <0> Address <0x08000000> Size <3852>Bytes
23:55:59:258 : Erasing memory corresponding to segment 0:
23:55:59:319 : Memory erase...
23:55:59:392 : halt ap 0
23:55:59:392 : w ap 0 reg 15 PC (0x20000000)
23:55:59:398 : w ap 0 reg 17 MSP (0x20000500)
23:55:59:405 : w ap 0 reg 16 xPSR (0x01000000)
23:55:59:470 : w ap 0 @0x20000860 0x00000200 bytes
23:55:59:472 : w ap 0 @0x20000000 0x00000004 bytes
23:55:59:590 : w ap 0 @0x20000004 0x00000420 bytes
23:55:59:591 : Erasing internal memory sectors [0 3]
23:55:59:591 : Init flashloader...
23:55:59:602 : halt ap 0
23:55:59:604 : w ap 0 reg 0 R0 0x00000001
23:55:59:609 : w ap 0 reg 1 R1 0x00000000
23:55:59:619 : w ap 0 reg 2 R2 0x00000000
23:55:59:622 : w ap 0 reg 3 R3 0x00000000
23:55:59:637 : w ap 0 reg 4 R4 0x00000000
23:55:59:638 : w ap 0 reg 5 R5 0x00000000
23:55:59:654 : w ap 0 reg 6 R6 0x00000000
23:55:59:654 : w ap 0 reg 7 R7 0x00000000
23:55:59:657 : w ap 0 reg 8 R8 0x00000000
23:55:59:670 : w ap 0 reg 9 R9 0x00000000
23:55:59:670 : w ap 0 reg 10 R10 0x00000000
23:55:59:686 : w ap 0 reg 11 R11 0x00000000
23:55:59:686 : w ap 0 reg 12 R12 0x00000000
23:55:59:689 : w ap 0 reg 13 SP 0x00000000
23:55:59:702 : w ap 0 reg 14 LR 0x20000001
23:55:59:704 : w ap 0 reg 15 PC 0x20000005
23:55:59:718 : w ap 0 reg 16 xPSR 0x01000000
23:55:59:719 : w ap 0 reg 17 MSP 0x20000820
23:55:59:736 : w ap 0 reg 18 PSP 0x00000000
23:55:59:736 : run ap 0
23:55:59:736 : halt ap 0
23:55:59:736 : r ap 0 reg 0 R0 0x00000001
23:55:59:736 : Loader sector erase...
23:55:59:753 : w ap 0 reg 0 R0 0x08000000
23:55:59:753 : w ap 0 reg 1 R1 0x08000C00
23:55:59:770 : w ap 0 reg 2 R2 0x00000002
23:55:59:770 : w ap 0 reg 3 R3 0x00000000
23:55:59:770 : w ap 0 reg 4 R4 0x00000000
23:55:59:785 : w ap 0 reg 5 R5 0x00000000
23:55:59:785 : w ap 0 reg 6 R6 0x00000000
23:55:59:804 : w ap 0 reg 7 R7 0x00000000
23:55:59:805 : w ap 0 reg 8 R8 0x00000000
23:55:59:805 : w ap 0 reg 9 R9 0x00000000
23:55:59:811 : w ap 0 reg 10 R10 0x00000000
23:55:59:815 : w ap 0 reg 11 R11 0x00000000
23:55:59:822 : w ap 0 reg 12 R12 0x00000000
23:55:59:830 : w ap 0 reg 13 SP 0x00000000
23:55:59:836 : w ap 0 reg 14 LR 0x20000001
23:55:59:843 : w ap 0 reg 15 PC 0x2000012F
23:55:59:850 : w ap 0 reg 16 xPSR 0x01000000
23:55:59:856 : w ap 0 reg 17 MSP 0x20000820
23:55:59:863 : w ap 0 reg 18 PSP 0x00000000
23:55:59:863 : run ap 0
23:55:59:957 : halt ap 0
23:55:59:961 : r ap 0 reg 0 R0 0x00000001
23:55:59:961 : erase: 0705ms
23:55:59:962 : Download in Progress:
23:55:59:963 : Size : 3852 Bytes
23:55:59:963 : Address : 0x08000000
23:55:59:963 : Buffer program...
23:56:00:031 : halt ap 0
23:56:00:031 : w ap 0 reg 15 PC (0x20000000)
23:56:00:038 : w ap 0 reg 17 MSP (0x20000500)
23:56:00:045 : w ap 0 reg 16 xPSR (0x01000000)
23:56:00:110 : w ap 0 @0x20000860 0x00000200 bytes
23:56:00:113 : w ap 0 @0x20000000 0x00000004 bytes
23:56:00:232 : w ap 0 @0x20000004 0x00000420 bytes
23:56:00:232 : Loader write range...
23:56:00:449 : w ap 0 @0x20000860 0x00000788 bytes
23:56:00:449 : W B1 in RAM @0x20000860 size 0x00000788 : 0217ms
23:56:00:450 : Init flashloader...
23:56:00:461 : halt ap 0
23:56:00:465 : w ap 0 reg 0 R0 0x00000001
23:56:00:469 : w ap 0 reg 1 R1 0x00000000
23:56:00:486 : w ap 0 reg 2 R2 0x00000000
23:56:00:486 : w ap 0 reg 3 R3 0x00000000
23:56:00:491 : w ap 0 reg 4 R4 0x00000000
23:56:00:506 : w ap 0 reg 5 R5 0x00000000
23:56:00:506 : w ap 0 reg 6 R6 0x00000000
23:56:00:520 : w ap 0 reg 7 R7 0x00000000
23:56:00:520 : w ap 0 reg 8 R8 0x00000000
23:56:00:525 : w ap 0 reg 9 R9 0x00000000
23:56:00:540 : w ap 0 reg 10 R10 0x00000000
23:56:00:540 : w ap 0 reg 11 R11 0x00000000
23:56:00:560 : w ap 0 reg 12 R12 0x00000000
23:56:00:560 : w ap 0 reg 13 SP 0x00000000
23:56:00:569 : w ap 0 reg 14 LR 0x20000001
23:56:00:575 : w ap 0 reg 15 PC 0x20000005
23:56:00:575 : w ap 0 reg 16 xPSR 0x01000000
23:56:00:588 : w ap 0 reg 17 MSP 0x20000820
23:56:00:591 : w ap 0 reg 18 PSP 0x00000000
23:56:00:591 : run ap 0
23:56:00:605 : halt ap 0
23:56:00:611 : r ap 0 reg 0 R0 0x00000001
23:56:00:611 : w ap 0 reg 0 R0 0x08000000
23:56:00:619 : w ap 0 reg 1 R1 0x00000788
23:56:00:620 : w ap 0 reg 2 R2 0x20000860
23:56:00:622 : w ap 0 reg 3 R3 0x00000002
23:56:00:627 : w ap 0 reg 4 R4 0x00000000
23:56:00:635 : w ap 0 reg 5 R5 0x00000000
23:56:00:641 : w ap 0 reg 6 R6 0x00000000
23:56:00:648 : w ap 0 reg 7 R7 0x00000000
23:56:00:658 : w ap 0 reg 8 R8 0x00000000
23:56:00:662 : w ap 0 reg 9 R9 0x00000000
23:56:00:670 : w ap 0 reg 10 R10 0x00000000
23:56:00:676 : w ap 0 reg 11 R11 0x00000000
23:56:00:682 : w ap 0 reg 12 R12 0x00000000
23:56:00:689 : w ap 0 reg 13 SP 0x00000000
23:56:00:696 : w ap 0 reg 14 LR 0x20000001
23:56:00:703 : w ap 0 reg 15 PC 0x20000015
23:56:00:709 : w ap 0 reg 16 xPSR 0x01000000
23:56:00:720 : w ap 0 reg 17 MSP 0x20000820
23:56:00:722 : w ap 0 reg 18 PSP 0x00000000
23:56:00:723 : run ap 0
23:56:00:849 : w ap 0 @0x20000FE8 0x00000784 bytes
23:56:00:849 : W B2 in RAM @0x20001240 size 0x00000784: 0400ms
23:56:00:854 : r ap 0 reg 0 R0 0x00000001
23:56:00:855 : Wait W B1 in Flash @0x08000000 size 0x00000788: 0005ms
23:56:00:863 : w ap 0 reg 0 R0 0x08000788
23:56:00:870 : w ap 0 reg 1 R1 0x00000784
23:56:00:927 : w ap 0 reg 2 R2 0x20000FE8
23:56:00:927 : w ap 0 reg 3 R3 0x00000002
23:56:00:927 : w ap 0 reg 4 R4 0x00000000
23:56:00:927 : w ap 0 reg 5 R5 0x00000000
23:56:00:928 : w ap 0 reg 6 R6 0x00000000
23:56:00:928 : w ap 0 reg 7 R7 0x00000000
23:56:00:928 : w ap 0 reg 8 R8 0x00000000
23:56:00:928 : w ap 0 reg 9 R9 0x00000000
23:56:00:936 : w ap 0 reg 10 R10 0x00000000
23:56:00:936 : w ap 0 reg 11 R11 0x00000000
23:56:00:952 : w ap 0 reg 12 R12 0x00000000
23:56:00:952 : w ap 0 reg 13 SP 0x00000000
23:56:00:969 : w ap 0 reg 14 LR 0x20000001
23:56:00:969 : w ap 0 reg 15 PC 0x20000015
23:56:00:970 : w ap 0 reg 16 xPSR 0x01000000
23:56:00:986 : w ap 0 reg 17 MSP 0x20000820
23:56:00:986 : w ap 0 reg 18 PSP 0x00000000
23:56:00:986 : run ap 0
23:56:01:057 : r ap 0 reg 0 R0 0x00000001
23:56:01:058 : Write elapsed time: 0825ms
23:56:01:058 : Segment[0] downloaded successfully
23:56:01:059 : File download complete
23:56:01:104 : Time elapsed during download operation: 00:00:01.801
23:56:01:104 : Verifying ...
23:56:01:105 : Read progress:
23:56:01:105 : Reading data...
23:56:01:159 : r ap 0 @0x08000000 0x00000400 bytes
23:56:01:159 : Reading data...
23:56:01:261 : r ap 0 @0x08000400 0x00000400 bytes
23:56:01:263 : Reading data...
23:56:01:363 : r ap 0 @0x08000800 0x00000400 bytes
23:56:01:363 : Reading data...
23:56:01:440 : r ap 0 @0x08000C00 0x0000030C bytes
23:56:01:441 : Error: Data mismatch found at address 0x08000DA8 (byte = 0x5A instead of 0x13)
23:56:01:442 : Error: Download verification failed

Also, I will post the linker script.

1 ACCEPTED SOLUTION

Accepted Solutions
Imen.D
ST Employee

Hello @MuratHepeyiler​ ,

Thanks for pointing out to me this post.

STLink Firmware upgrade may resolve this issue.

Can you please try to update the firmware and then tell me if this resolve the issue ?

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

View solution in original post

5 REPLIES 5
MuratHepeyiler
Associate II

Linker script;

/**
 ******************************************************************************
 * @file      LinkerScript.ld
 * @author    Auto-generated by STM32CubeIDE
 * @brief     Linker script for STM32F030C8Tx Device from STM32F0 series
 *                      64Kbytes FLASH
 *                      8Kbytes RAM
 *
 *            Set heap size, stack size and stack location according
 *            to application requirements.
 *
 *            Set memory bank area and size if external memory is used
 ******************************************************************************
 * @attention
 *
 * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
 * All rights reserved.</center></h2>
 *
 * This software component is licensed by ST under BSD 3-Clause license,
 * the "License"; You may not use this file except in compliance with the
 * License. You may obtain a copy of the License at:
 *                        opensource.org/licenses/BSD-3-Clause
 *
 ******************************************************************************
 */
 
/* Entry Point */
ENTRY(Reset_Handler)
 
/* Highest address of the user mode stack */
_estack = ORIGIN(RAM) + LENGTH(RAM);	/* end of "RAM" Ram type memory */
 
_Min_Heap_Size = 0x200 ;	/* required amount of heap  */
_Min_Stack_Size = 0x400 ;	/* required amount of stack */
 
/* Memories definition */
MEMORY
{
  RAM    (xrw)    : ORIGIN = 0x20000000,   LENGTH = 8K
  FLASH    (rx)    : ORIGIN = 0x8000000,   LENGTH = 64K
}
 
/* Sections */
SECTIONS
{
  /* The startup code into "FLASH" Rom type memory */
  .isr_vector :
  {
    . = ALIGN(4);
    KEEP(*(.isr_vector)) /* Startup code */
    . = ALIGN(4);
  } >FLASH
 
  /* The program code and other data into "FLASH" Rom type memory */
  .text :
  {
    . = ALIGN(4);
    *(.text)           /* .text sections (code) */
    *(.text*)          /* .text* sections (code) */
    *(.glue_7)         /* glue arm to thumb code */
    *(.glue_7t)        /* glue thumb to arm code */
    *(.eh_frame)
 
    KEEP (*(.init))
    KEEP (*(.fini))
 
    . = ALIGN(4);
    _etext = .;        /* define a global symbols at end of code */
  } >FLASH
 
  /* Constant data into "FLASH" Rom type memory */
  .rodata :
  {
    . = ALIGN(4);
    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
    . = ALIGN(4);
  } >FLASH
 
  .ARM.extab   : {
    . = ALIGN(4);
    *(.ARM.extab* .gnu.linkonce.armextab.*)
    . = ALIGN(4);
  } >FLASH
 
  .ARM : {
    . = ALIGN(4);
    __exidx_start = .;
    *(.ARM.exidx*)
    __exidx_end = .;
    . = ALIGN(4);
  } >FLASH
 
  .preinit_array     :
  {
    . = ALIGN(4);
    PROVIDE_HIDDEN (__preinit_array_start = .);
    KEEP (*(.preinit_array*))
    PROVIDE_HIDDEN (__preinit_array_end = .);
    . = ALIGN(4);
  } >FLASH
 
  .init_array :
  {
    . = ALIGN(4);
    PROVIDE_HIDDEN (__init_array_start = .);
    KEEP (*(SORT(.init_array.*)))
    KEEP (*(.init_array*))
    PROVIDE_HIDDEN (__init_array_end = .);
    . = ALIGN(4);
  } >FLASH
 
  .fini_array :
  {
    . = ALIGN(4);
    PROVIDE_HIDDEN (__fini_array_start = .);
    KEEP (*(SORT(.fini_array.*)))
    KEEP (*(.fini_array*))
    PROVIDE_HIDDEN (__fini_array_end = .);
    . = ALIGN(4);
  } >FLASH
 
  /* Used by the startup to initialize data */
  _sidata = LOADADDR(.data);
 
  /* Initialized data sections into "RAM" Ram type memory */
  .data :
  {
    . = ALIGN(4);
    _sdata = .;        /* create a global symbol at data start */
    *(.data)           /* .data sections */
    *(.data*)          /* .data* sections */
    *(.RamFunc)        /* .RamFunc sections */
    *(.RamFunc*)       /* .RamFunc* sections */
 
    . = ALIGN(4);
    _edata = .;        /* define a global symbol at data end */
 
  } >RAM AT> FLASH
 
  /* Uninitialized data section into "RAM" Ram type memory */
  . = ALIGN(4);
  .bss :
  {
    /* This is used by the startup in order to initialize the .bss section */
    _sbss = .;         /* define a global symbol at bss start */
    __bss_start__ = _sbss;
    *(.bss)
    *(.bss*)
    *(COMMON)
 
    . = ALIGN(4);
    _ebss = .;         /* define a global symbol at bss end */
    __bss_end__ = _ebss;
  } >RAM
 
  /* User_heap_stack section, used to check that there is enough "RAM" Ram  type memory left */
  ._user_heap_stack :
  {
    . = ALIGN(8);
    PROVIDE ( end = . );
    PROVIDE ( _end = . );
    . = . + _Min_Heap_Size;
    . = . + _Min_Stack_Size;
    . = ALIGN(8);
  } >RAM
 
  /* Remove information from the compiler libraries */
  /DISCARD/ :
  {
    libc.a ( * )
    libm.a ( * )
    libgcc.a ( * )
  }
 
  .ARM.attributes 0 : { *(.ARM.attributes) }
}

MuratHepeyiler
Associate II

Quick update, I have upgraded CubeIDX(v1.6.0) and CubeProgrammer(v2.7.0) to the newest versions The problem is still. Then I used Keil uVision and everything worked perfectly.

Also, good to mention that, below case happened. Same code, same chip, same programmer. Just the difference 84sec.

00:46:17 : Error: Data mismatch found at address  0x08000E5C (byte = 0x9A instead of 0x9B)
00:46:17 : Error: Download verification failed
 
00:46:41 : Download verified successfully

Also, I have tried the same code upload keil uVision and STM32CubeProgrammer.

STM32CubeProgrammer output:

12:15:37 : Memory Programming ...
  12:15:37 : Opening and parsing file: KeilTest.axf
  12:15:37 :   File          : KeilTest.axf
  12:15:37 :   Size          : 12708 Bytes
  12:15:37 :   Address       : 0x08000000 
  12:15:37 : Erasing memory corresponding to segment 0:
  12:15:37 : Erasing internal memory sectors [0 12]
  12:15:37 : Download in Progress:
  12:15:38 : File download complete
  12:15:38 : Time elapsed during download operation: 00:00:00.904
  12:15:38 : Verifying ...
  12:15:38 : Read progress:
  12:15:38 : Error: Data mismatch found at address  0x08000BDC (byte = 0xD9 instead of 0x6C)
  12:15:38 : Error: Download verification failed

keil uVision output:

Load "KeilTest\\KeilTest.axf" 
Erase Done.
Programming Done.
Verify OK.
Flash Load finished at 12:15:46

I really like to use the STM32Cube environment. However, this bug pushes me out of it.

@Imen DAHMEN​ if it is possible, could you check it out? I think there is a bug.

By the way, I have taken a sample using Logic Analyzer and WireShark during upload code. If you like, you can find the zip file below the link. I am using KingstVS device, thus I have added .vis, .csv, and Wireshark capture file.

https://drive.google.com/file/d/1MN_z6h-RLjXQrGkoKLK9QcMaP5wWg1ab/view?usp=sharing

Imen.D
ST Employee

Hello @MuratHepeyiler​ ,

Thanks for pointing out to me this post.

STLink Firmware upgrade may resolve this issue.

Can you please try to update the firmware and then tell me if this resolve the issue ?

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
MuratHepeyiler
Associate II

Hi @Imen DAHMEN​ ,

Thanks for your attention. Updating STLink Firmware solved my issue.

Imen.D
ST Employee

Hi @MuratHepeyiler​ ,

Glad to know the issue has been solved :) .

Please mark my answer as best by clicking on the "Select as Best" button. This will help other users find this solution more quickly.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen