-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xtensa High priority INT interrupt window exception causes STACK ERROR #41039
Comments
Looking at this for the first time. I'm sorry, I don't understand what you want Zephyr to do here? We took an exception, it got preempted by an interrupt that Zephyr doesn't manage and landed in a handler with code written by the application. How does Zephyr prevent the application code from breaking Zephyr state? You need to write your custom interrupt handlers to be safe when they preempt important things like window exceptions. I understand that's extremely difficult. During a window exception you don't have (and probably can't recover reliably) a stack pointer. But it's not impossible. Grab a SR that isn't in use (we have a brand new feature to help you with this) and do a musical chairs entry to carefully save off the GPR state. And needless to say the resulting exception code needs to be built to the CALL0 ABI, or be written entirely in assembly. But it's not Zephyr's problem to solve. The interrupts we emit code for work reliably. |
@andyross
I think currently zephyrrtos should at least deny xtensa high priority interrupt registration or alert the user, or improve xtensa arch to meet high priority interrupt registration |
Agreed, let's mark this as an enhancement instead of a bug. Zephyr does not currently support applications registering interrupts that interrupt exception handlers. Applications that do so need to be coded very carefully. It would be good if Zephyr had an answer here, but it doesn't. We should add that as a feature. |
agree completely |
Describe the bug


The zephyr xtensa architecture does not seem to take this situation into consideration:
For example, the excption interrupt level is less than the highest priority interrupt. When the high priority interrupt preempts the window exception interrupt (such as WindowOverflow8), the entire stack will be destroyed
L4 and L5 interrupts will be able to interrupt WindowOverflow8 interrupts, at this time Zephyr's interrupt handler does not do any special processing
Related instructions in freertos:
In fact, it seems that Zephyr does not support high-priority interrupts, but is there any reminder or explanation
The text was updated successfully, but these errors were encountered: