Replies: 4 comments
-
Hi @mwsealey! We appreciate you submitting your first issue for our open-source project. 🌟 Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙 |
Beta Was this translation helpful? Give feedback.
-
@ithinuel FYI |
Beta Was this translation helpful? Give feedback.
-
For the record, we have observed this |
Beta Was this translation helpful? Give feedback.
-
Hi, Thank you all for your patience. There indeed seem to be something a little bit off there. We are looking into this and possibly another issue in the neighbooring code where more word are pushed to the stack at the IRQ entry than poped at the exit. I will keep you posted on our progress. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
https://github.com/zephyrproject-rtos/zephyr/blame/6551492a3ffe72e57bbf6b826b84316d9ddeb9d3/arch/arm/core/cortex_a_r/macro_priv.inc#L36
In this snippet the code intent seems to be to put the LR_cur and SP_cur onto the SYStem mode stack, then changes to SYStem mode and attempts to store r0-r3, r12, LR(_usr) onto the SYStem mode stack afterwards. The
sub sp, #24
bumps the stack pointer because the caret form of the STM instruction doesn't support writeback forms.This is not only unnecessary work the caret instruction form is intended for use in modes other than SYStem (i.e. so that IRQ mode can stack the banked LR_usr and SP_usr registers above) which is CONSTRAINED UNPREDICTABLE in SYStem mode since the LR_usr and SP_usr registers are live at the time and not banked. Equivalent and working code would be
.. which has the same effect, no side effects and less instructions.
Beta Was this translation helpful? Give feedback.
All reactions