2021-05-15 04:38 AM
We have built custom board using STM32H750VBT6.We have tried to make external loader for this MCU with w25q128Jq NOR flash of winbond.Also take one reference project from community which name is SW_H750_QSPI_Ext_LoaderKeil and modified command for NOR flash also.
We can read and erase nor using stm32cube programmer but when we tried to program external flash it gives error as below.
"Error: Data mismatch found at address 0x90000000 (byte = 0xFF instead of 0x00)"
Request to check linker file if we need to change it please suggest us.
Also find attached project.
@Tesla DeLorean
Solved! Go to Solution.
2021-05-15 07:26 AM
This loader was built with Keil, but attached is the GNU Linker Script I used in other H7 Loader projects
/*
*****************************************************************************
**
** File : ExternalLoader.ld
**
** Abstract : Linker script for STM32H7xx Device with
** 2048KByte FLASH, 128KByte RAM
**
** Copyright (c) 2020-2021 Clive One / sourcer32@gmail.com
**
*****************************************************************************
*/
/* Entry Point */
ENTRY(Init)
/* Specify the memory areas */
MEMORY
{
RAM_INFO (r) : ORIGIN = 0, LENGTH = 1K
RAM_PROG (xrw) : ORIGIN = 0x24000004, LENGTH = 128K-4 /* 0x20000004 for Non-H7 */
}
/* Define output sections */
SECTIONS
{
.info :
{
KEEP (*(.rodata.StorageInfo))
} >RAM_INFO
/* The program code and other data goes into IMAGE */
.prog :
{
. = 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)
/* Ensure entry points are pulled in here */
KEEP (*(.text.Init))
KEEP (*(.text.DeInit))
KEEP (*(.text.Write))
KEEP (*(.text.Read))
KEEP (*(.text.Verify))
KEEP (*(.text.Checksum))
KEEP (*(.text.SectorErase))
KEEP (*(.text.MassErase))
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
} >RAM_PROG
/* Constant data goes into IMAGE */
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >RAM_PROG
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} >RAM_PROG
.ARM :
{
*(.ARM.exidx*)
} >RAM_PROG
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} >RAM_PROG
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} >RAM_PROG
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
PROVIDE_HIDDEN (__fini_array_end = .);
} >RAM_PROG
/* Initialized data sections goes into RAM, load LMA copy after code */
.data :
{
. = ALIGN(4);
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
} >RAM_PROG
/* Uninitialized data section */
.bss :
{
. = ALIGN(4);
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
} >RAM_PROG
/* Remove information from the standard libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
.ARM.attributes 0 : { *(.ARM.attributes) }
}
2021-05-15 07:26 AM
This loader was built with Keil, but attached is the GNU Linker Script I used in other H7 Loader projects
/*
*****************************************************************************
**
** File : ExternalLoader.ld
**
** Abstract : Linker script for STM32H7xx Device with
** 2048KByte FLASH, 128KByte RAM
**
** Copyright (c) 2020-2021 Clive One / sourcer32@gmail.com
**
*****************************************************************************
*/
/* Entry Point */
ENTRY(Init)
/* Specify the memory areas */
MEMORY
{
RAM_INFO (r) : ORIGIN = 0, LENGTH = 1K
RAM_PROG (xrw) : ORIGIN = 0x24000004, LENGTH = 128K-4 /* 0x20000004 for Non-H7 */
}
/* Define output sections */
SECTIONS
{
.info :
{
KEEP (*(.rodata.StorageInfo))
} >RAM_INFO
/* The program code and other data goes into IMAGE */
.prog :
{
. = 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)
/* Ensure entry points are pulled in here */
KEEP (*(.text.Init))
KEEP (*(.text.DeInit))
KEEP (*(.text.Write))
KEEP (*(.text.Read))
KEEP (*(.text.Verify))
KEEP (*(.text.Checksum))
KEEP (*(.text.SectorErase))
KEEP (*(.text.MassErase))
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
} >RAM_PROG
/* Constant data goes into IMAGE */
.rodata :
{
. = ALIGN(4);
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
. = ALIGN(4);
} >RAM_PROG
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} >RAM_PROG
.ARM :
{
*(.ARM.exidx*)
} >RAM_PROG
.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array*))
PROVIDE_HIDDEN (__preinit_array_end = .);
} >RAM_PROG
.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array*))
PROVIDE_HIDDEN (__init_array_end = .);
} >RAM_PROG
.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array*))
PROVIDE_HIDDEN (__fini_array_end = .);
} >RAM_PROG
/* Initialized data sections goes into RAM, load LMA copy after code */
.data :
{
. = ALIGN(4);
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
} >RAM_PROG
/* Uninitialized data section */
.bss :
{
. = ALIGN(4);
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
} >RAM_PROG
/* Remove information from the standard libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
.ARM.attributes 0 : { *(.ARM.attributes) }
}
2021-05-31 08:19 AM
Dear @djtilava & @Community member ,
Just for information: here an article answering the question "Where can I find source code of external loader (.stldr) for STM32 devices?"
Several Customers here ask similar question; they can find answer there or contribute to enhance the content of the Github repoistory with other supported loaders.
-Amel
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.
2021-05-31 08:59 AM
I'm running my own tangential project with a focus on cheaper more prolific Winbond parts, and assorted pin configurations/combinations, with prebuilt loaders for Keil and ST platforms. I'm planning on sticking with the prebuilt format as I don't have the time/resources to individually explain how to build, modify and debug them across a dozen platforms. The goal is to automate the generation, establish a working list of common pin usage, complete testing, and port to other STM32 families. Contributions via PayPal are welcome to defray equipment and part costs, and to generally encourage further development, lest I find other things to do to pay the bills..
https://github.com/cturvey/stm32extldr