2017-07-03 04:51 AM
Hello,
I need using the first 32Kb flash section in order to store data in an STM32F765VGT (1M of flash). How can I change the program start address to the second section. I�ve achieved to reallocate the program code in the second section by means of the linker script. But when I explore the first section with the stlink utility, in the first section, there is a piece of code instead of being empty. Furthermore if I erase this section the program stops working.
Thank you very much.
#linker #program #stm32f7 #stm32f765 #store-data #change-section #flash-section #start #program-start-addressSolved! Go to Solution.
2017-07-06 03:16 AM
2017-07-03 07:43 AM
Then you probably need to review the manual for the part and the core, and confirm if there is a boot method that supports what you want to do. Check options bytes, and BOOTx type configurations.
Why must arbitrary data be placed in the first sector? Can you not carve out holes in the image to place the data without interfering with the boot process.
2017-07-04 05:00 AM
The first lines of my linker script are:
/* Entry Point */
ENTRY(Reset_Handler)
/* Highest address of the user mode stack */
_estack = 0x20080000;
/* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200;
/* required amount of heap */
_Min_Stack_Size = 0x400;
/* required amount of stack */
/* Specify the memory areas */
MEMORY
{
RAM
(xrw)
:
ORIGIN
=
0x20000000,
LENGTH
=
512K
DATA_CAL
(xrw)
:
ORIGIN
=
0x8000000,
LENGTH
=
32K
FLASH
(rx)
:
ORIGIN
=
0x8008000,
LENGTH
=
992K
}
I have add the DATA_CAL section at the beginning. With this linker script the program doesn?t work.
The default values of the option bytes are:
With the default values in the option byte the program dosen?t work.
I tried change it for pointing to the 0x08008000 (flash second sector star address):
But with these values still not working.
Although my program should be in the 0x08008000 address if I read the 0x08000000 there are some code:
If I read the 0x08008000 seems that the program is stored in this area.
I don?t understand why the first section (0x08000000) isn?t emty.
I have reviewed the STM32f7xx Reference Manual but I don?t find an explanation about the starting process apart from the boots modes. Which manual do you refer?
Which I need is store 12 values of 32 bits in flash and protect it. For a good memory utilization I would like using a 32KB section. In order to carve out the flash I don?t know, how can I split the flash section (named as FLASH) for ensuring the program integrity.
Thank you very much for you quick response.
2017-07-04 06:33 AM
I think
Turvey.Clive.002
means AN4826 and AN26Beside that it looks like you have flashed the elf file right to the default start address (see the ELF pattern at address 0x08000000). You should create a hex or binary file out of the elf and flash this instead of the elf file.
2017-07-06 03:16 AM