2012-06-20 05:52 AM
I explain you my use case in few words.
I'm working on STM32F4xxx, 1MB flash.
My dev. environement is EWARM 6.30.
I have a small bootloader application starting at adress 0x08000000. Then I have my application ''image A'' starting at 0x08020000, and my application ''image B'' starting at 0x08080000.
The both images are generated by the same code.
My problem is that I don't know how to generate a
single generic image
, that will work for these two locations.In the init procedure I relocate my vector interrupt as follow:
static void _setIntVector( void )
{
/* Set the Vector Table base location at 0x0800xxxxx */
if(_getCurrentImage() == 2)
{
SCB->VTOR = FLASH_BASE | VECT_TAB_IMG2_OFFSET;
}
else
{
SCB->VTOR = FLASH_BASE | VECT_TAB_IMG1_OFFSET;
}
}
I have checked that any other offset ''disturb my macros''.
If I compile my image with the linker values for image 2 ( .icf file in EWARM in option/linker/ ), the bootloader jump to
0x08080000 and all is OK. But if I
compile my imagewith the default values ( VECTOR_OFFSET == 0, so jump to 0x80000000 ), anything is working, the bootloader jump, but doesn't match the RESET vector of the ''image B'' ...
Can you help me ? Or maybe you have a tutorial that explain this operation under EWARM.
#dual-image-boot-(-linker-)2012-06-20 06:39 AM
My problem is that I don't know how to generate a
single generic image
, that will work for these two locations.The vector table contains absolute addresses which makes it very difficult to resolve. If the rest of your code is address agnostic you could copy and relocate the vector table in RAM.