cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the program start address to the second section in an STM32F765VGT

Rub�n Acerete Halli
Associate III
Posted on July 03, 2017 at 13:51

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-address
1 ACCEPTED SOLUTION

Accepted Solutions
Rub�n Acerete Halli
Associate III
Posted on July 06, 2017 at 12:16

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6sn&d=%2Fa%2F0X0000000bxC%2F7ZiBKqWP8E7Og5BeJbx7gQfDM8bXt7hVe_1h8JZxkQ4&asPdf=false

View solution in original post

4 REPLIES 4
Posted on July 03, 2017 at 16:43

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.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on July 04, 2017 at 12:00

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:

0690X00000607QKQAY.png

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):

0690X00000607QUQAY.png

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:

0690X00000607Q5QAI.png

If I read the 0x08008000 seems that the program is stored in this area.

0690X00000607KIQAY.png

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.

Posted on July 04, 2017 at 13:33

I think

Turvey.Clive.002

‌ means AN4826 and AN26

Beside 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.

Rub�n Acerete Halli
Associate III
Posted on July 06, 2017 at 12:16

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6sn&d=%2Fa%2F0X0000000bxC%2F7ZiBKqWP8E7Og5BeJbx7gQfDM8bXt7hVe_1h8JZxkQ4&asPdf=false