Skip to main content
Stepan Martinek
Associate II
October 27, 2021
Solved

Using unused interrupt vectors

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.

This topic has been closed for replies.
Pavel A.
Pavel A.Best answer
October 27, 2021

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

Works nicely.

3 replies

Pavel A.
Pavel A.Best answer
October 27, 2021

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

Works nicely.

Tesla DeLorean
Guru
October 27, 2021

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
Stepan Martinek
Associate II
November 1, 2021

Thank you both for help.