2021-10-27 07:28 AM
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.
Solved! Go to Solution.
2021-10-27 08:07 AM
Yes, unused vectors within the table can be activated in this way. We did it on STM32H743.
Works nicely.
2021-10-27 08:07 AM
Yes, unused vectors within the table can be activated in this way. We did it on STM32H743.
Works nicely.
2021-10-27 10:36 AM
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
2021-11-01 02:23 AM
Thank you both for help.