2018-06-24 04:03 AM
Hi,
I am using the Nucleo-H743ZI development board and trying to make an Interrupt driver for it. The driver has to support changing the vector table contents at runtime. So I made a copy of the vector table in the AXI SRAM at its first address (0x24000000)typedef void(*voidPFn_t)(void);
static volatile voidPFn_t newVectorTable[_VECTOR_TABLE_SIZE] __attribute__ ((section('.sram_d1')));
void interruptInit() {
volatile voidPFn_t* origVectorTable = (voidPFn_t*) SCB->VTOR;
// copy the content of the original vector table into the new vector table
for(uint32_t i = 0; i < _VECTOR_TABLE_SIZE; i++)
newVectorTable[i] = origVectorTable[i];
// install the new interrupt vector table
SCB->VTOR = ((uint32_t) &newVectorTable);
}
I succeeded to copy the content of the original vector table and I could see that through the memory window of my IDE. Also I set the VTOR register to 0x24000000 and modified my new vector table correctly.
But the problem is when I fire an interrupt in my test example the cpu goes to execute the interrupt handler of the original vector table not my new vector table. I don't know why that happens.
#interrupt #stm32h743 #nucleo-h743zi #stm32h7 #vector-table #axi-sramSolved! Go to Solution.
2018-06-28 08:18 PM
Ok, so having cycled the power on the STM32H743I-EVAL, changing the RAM at 0x24000000, resulted in the failure of SCB_InvalidateDCache_by_Addr() to achieve the goal, and the SysTick vectors off to some to some random junk.
SCB_InvalidateDCache_by_Addr((uint32_t*)newVectorTable, VECSIZE);
2018-06-28 08:41 PM
2018-06-29 12:18 PM
Hi
Turvey.Clive.002
Sorry, I was too fast, I c/c the incorrect fonction, we need to use the cache clean by address. Invalidating the cache will result in losing uncommited data.
SCB_InvalidateDCache_by_Addr --> SCB_CleanDCache_by_Addr
Br,
Abdel