cancel
Showing results for 
Search instead for 
Did you mean: 

stm32 GNU ARM linker

Cesar cfg
Associate II
Posted on June 30, 2015 at 11:27

Hi

I am working with stm32 using GNU ARM Eclipse plugin.

I want to modify the linker scripts to change the program start address

Can anyone help me?  

Thanks
10 REPLIES 10
nesrine
Senior
Posted on June 30, 2015 at 13:05

Hello

in the first section named MEMORY, you just have to modify the following address:

FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K ORIGIN

I hope this answered your questions.

Syrine

Cesar cfg
Associate II
Posted on June 30, 2015 at 13:19

thank you for your response 

Problem not solved. I can't stop the MCU

Posted on June 30, 2015 at 13:47

Problem not solved. I can't stop the MCU

Ok, but what have you actually done? Is you're debugger capable of this?

The processor is going to look for a vector table at 0x08000000, so you'd need a boot loader there to call your application code wherever you've placed that. You'd want that on a 512-byte boundary, and on a Flash sector/page boundary.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Cesar cfg
Associate II
Posted on June 30, 2015 at 15:07

Is there any other solution without using a bootloader?

Posted on June 30, 2015 at 15:24

Is there any other solution without using a bootloader?

You could place the initial two vector entries at 0x08000000, which from the processors perspective is mapped at address zero by the state of the BOOTx pins.

The processor has some well defined startup characteristics, these aren't going to be changed by altering the linker script.

May be you can better define what it is you're trying to achieve?
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Cesar cfg
Associate II
Posted on June 30, 2015 at 15:34

May be you can better define what it is you're trying to achieve?

I want just to don't write my code from the address 0x8000000 ,because the region :0x8000000 to 0x8003000 i need it for other use.

So i have to put my code outside this region

Posted on June 30, 2015 at 16:36

Ok, well you're going to have to adjust your expectations against how the processor actually functions. Might I suggest a review of the TRM, and the books of Joseph Yiu, for some foundation.

At a minimal level you need to place the Initial SP/PC values at the base of memory, in this case 0x08000000, as this is where the processor is going to for those values. One booted you can assign a different address for the Vector Table. In the case of the M3/M4 parts by changing the value written in SCB->VTOR

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Cesar cfg
Associate II
Posted on July 01, 2015 at 12:49

At a minimal level you need to place the Initial SP/PC values at the base of memory, in this case 0x08000000

 

Can you explain more how and where i can do this ?

nesrine
Senior
Posted on July 01, 2015 at 15:42

Hello Cesar,

Can you please try this modification?

MEMORY

{

FLASH (rx) : ORIGIN = 0x08003000, LENGTH = 1012K

}Syrine.