Problem using NVIC_SetVectorTable on StmF3Discovery
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-21 3:44 PM
Posted on November 22, 2013 at 00:44
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? Cheers
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-21 4:13 PM
Posted on November 22, 2013 at 01:13
>>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);
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-11-22 7:22 AM
Posted on November 22, 2013 at 16:22
Perfect, thanks a lot!
In the end, I'll probably just use SCB->VTOR = (uint32_t)MyIsrTable; // SetVectorTable Thanks!