Forum : ARM
Post Information | Post |
---|---|
December 21, 2011 - 11:23pm
|
I want to move interrupt vector table (and all program) by 0x1000 bytes offset. But how tell teh linker that this vector table should be places at another (but known) address but reset vector must be still at 0x800:0004 adres ? Any suggestions ? Changing linker script from ..RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x10000 to RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x10000 will be enough to tell linker not to plece code and data inside first 0x1000 flash? How to do it in linker script ? |
Hi,
You can find some answers to your question from http://forum.raisonance.com/viewtopic.php?id=3675
Basically moving the whole application will not work (as the startup requests the 0x08000000 location for the vectors), so you need to create a second section to place your relocated vectors.
Best Regards,
Thanks
I have changed linker script and my application now is moved to address 800:1000.
One of the first commands in my program should be
NVIC_SetVectorTable( NVIC_VectTab_FLASH, 0x1000 ); // 0x1000 is offset of my program
What happened to vector table? is it moved with the same offset ?
And now all I need now is the simplest way to tell processor where my program starts and initialize oryginal reset vector localized at address 800:0004 to point to ... "moved" new reset vector .
How to do this in the simple way ?
I use startup file: startup_stm32f10x_cl.s. Is it also moved ?
with best regards
Hi,
Yes your table moves along with your application.
You should not have to modify your startup file. It contains the interrupt vector table, and the second entry of this table points to the startup entry point. The Linker will move/locate the startup according to the requested settings, and the entry will properly point to the (relocated) startup entry point.
I hope this helps,
Best Regards,
But one question: how easly prepare oryginal vector table located at 0x800:0000 and startup procedure ?
After reset, execution must be somehow directed to adres pointed by 'moved' vector table. What about stack ?
Could you give me some king of example of doing that ?
Hi Xadamus,
You can download the CircleOS sources from http://www.stm32circle.com/.
This will show an example of interrupt vector table relocation.
Best Regards,
Bruno wrote:
Hi Xadamus,
You can download the CircleOS sources from http://www.stm32circle.com/.
This will show an example of interrupt vector table relocation.
Best Regards,
Thanks,
I loaded sources of CircleOs...
But it is not more clear for me at all, how to do what I want to..
And I would like to use the simples way to execute program that is compied with offset.
So if you could give me some suggestions, maybe example....
thanks in advice
Can any help with this problem? How to simply do that using Ride-7 ?
with best regards