AnsweredAssumed Answered

Dual image boot ( linker )

Question asked by Mikael.Elharrar on Jun 20, 2012
Latest reply on Jun 20, 2012 by Clive One
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 image with 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.

Outcomes