cancel
Showing results for 
Search instead for 
Did you mean: 

Using unused interrupt vectors

Stepan Martinek
Associate III

Is it ok to use interrupt vectors which are 'reserved' inside or even beyond the vector table?

We need to put an RTOS semaphore from an interrupt with higher priority than kernel scheduler interrupt (which is forbidden). Currently we use an interrupt vector of an unused peripheral which we set to the same IPL as the kernel and trigger it by software from the high priority interrupt. Service routine of the low priority interrupt then puts the semaphore. Setting both to the same IPL is not a solution because in high priority interrupt we need to do some tasks as soon as possible and then eventually put the semaphore.

But can we use ANY interrupt vector, even if it's 'reserved'? Will NVIC service such interrupt?

Can we extend the interrupt vector table by one item and use that vector?

Or is there any cleaner way of doing that? Both PendSV and SVC (which would be otherwise pefect for that application) are taken by RTOS.

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

Yes, unused vectors within the table can be activated in this way. We did it on STM32H743.

Works nicely.

View solution in original post

3 REPLIES 3
Pavel A.
Evangelist III

Yes, unused vectors within the table can be activated in this way. We did it on STM32H743.

Works nicely.

I don't think you can go beyond the end of the table, the design compiler should have stripped the unused gates/transistors..

Things like HardFault and BusFault can return if you remediate the underlying cause or advance the stacked PC.

UsageFault should catch things like divide by zero, as I recall.

For hard fault, if you use a specific address and code sequence, like ldr r0,[r0, #0] you could change r0 from a faulting value to a usable one in the handler.

BKPT should hard fault too

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Stepan Martinek
Associate III

Thank you both for help.