AnsweredAssumed Answered

stm32f3 moving ISR vector

Question asked by oziom.dominik on Sep 3, 2015
Latest reply on Sep 10, 2015 by oziom.dominik
I'm using flash memory in my project so in order the interrupts to work properly I have to move the ISR vector to SRAM or else the flash will stall the interrupts during its work.
My working environment is CubeMX and System Workbench for stm32. 
The question is: how to do this?
After I have generated my project configuration I found a file system_stm32f3xx.c.

In this file there are lines:

/*!< Uncomment the following line if you need to relocate your vector Table in
     Internal SRAM. */
/* #define VECT_TAB_SRAM */
#define VECT_TAB_OFFSET  0x0 /*!< Vector Table base offset field.
                                  This value must be a multiple of 0x200. */
  SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
  SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */

So I just have to uncomment this line and I will get what I want?

Second question is about using extern "C" phrase.
I did it on my timer interrupt definition lets say it looked like that:

extern "C" void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
   if (htim->Instance==TIM3)

but the compiler says it's a syntax error. Am I using it in a wrong way or maybe I need a library to use this phrase.

Last question is about moving my code do SRAM. I browsed through a few topics, tried looking into manual but still don't know how to do it. Can anyone advise me in this matter?