I have a "default" resetVectors.c file for my SAMD21 ARM M0+. It has something that looks like:
__attribute__ ((section(".vectors")))
const DeviceVectors exception_table = {
...
};
in it that defines where different handler stubs. For testing purposes, I want to use one of the unused peripheral IRQs.
By default, the unused ones are set to NULL addresses. I have demonstrated to myself that I can modify that file and at compile time change my unused IRQ (21) to fire a handler. BUT, is it possible to do this outside of compile time?
I observed that the table appears to be based at offset 0. So I tried this:
DeviceVectors *table = 0x0000000;
table->pvReserved21 = PV21Handler;
But that just hangs the board. Is there a dynamic way to assign the handler at runtime?