AnsweredAssumed Answered

Problems when modifying interrupt vector table in RAM

Question asked by arnold_w on Feb 16, 2017

I am working with the STM32F045-microcontroller and I write my source code in Eclipse and I build with GNU ARM C/C++ Cross Compiler and I debug using GDB OpenOCD Debugging with ST-LINK/V2. I have placed the interrupt vector table in RAM and it works fine:

__attribute__ ((section(".isr_vector_ram"),used))
uint32_t __isr_vectors_ram[sizeof(__isr_vectors)/sizeof(__isr_vectors[0])];


void moveISRtableToRAM(void) {
    memcpy(__isr_vectors_ram, __isr_vectors, sizeof(__isr_vectors));
    SCB->VTOR = (uint32_t)__isr_vectors_ram;


However, I run into problems when I modify it:


void mySoftwareIntHandler(void) {



#define SKIP_Cortex_M_Core_Handlers_OFFSET   17

__isr_vectors_ram[SKIP_Cortex_M_Core_Handlers_OFFSET + CAN2_RX1_IRQn] = (uint32_t)mySoftwareIntHandler;


My code crashes when I try the above. Does anybody know what's wrong?