2013-11-21 03:44 PM
Hi there,
I've got a problem here using NVIC_SetVectorTable(). I have attached my test programm, which is held very simple and does: - Init Leds&UserButton - make sure the ''new'' Vectortable is 0x200-aligned - Copy the VectorTable from 0 to MyVectTable (0x20000200) - // at the moment deactivated: change Systick-vector so I can see the new one is used - Activate Systick to have an interrupt occuring - When the UserButton is pressed, call NVIC_SetVectorTable(NVIC_VectTab_RAM,(int) &MyIsrTable); And then the program counter ends up at 0x0 (but I had other weired effects when I slightly changed the code, e.g. PC at 0x20000200 or running wildly somewhere) I guess I am missing a small but important detail. Can anyone see it? Cheers2013-11-21 04:13 PM
>>NVIC_SetVectorTable(NVIC_VectTab_RAM,(int) &MyIsrTable);
&MyIsrTable doesn't point a what you think it does. printf(''%p %p %p\n'',&MyIsrTable, MyIsrTable, &MyIsrTable[0]); I'd perhaps prefer NVIC_SetVectorTable((uint32_t)MyIsrTable, 0);2013-11-22 07:22 AM
Perfect, thanks a lot!
In the end, I'll probably just use SCB->VTOR = (uint32_t)MyIsrTable; // SetVectorTable Thanks!