Replies: 2 comments 2 replies
-
Hey @biosbob!
Your steps sound right. Basically, this is identical to the operations of the XIRQ RTE (runtime environment) handler: neorv32/sw/lib/source/neorv32_xirq.c Lines 229 to 246 in 543e45b
Did you configure the
Have you also checked the signal of your button? Maybe it requires some additional debouncing logic?
Could you specify this a little bit more in detail? The XIRQ's The XIRQ's |
Beta Was this translation helpful? Give feedback.
-
problem resolved |
Beta Was this translation helpful? Give feedback.
-
after implementing the suggestion in #588, i want to claify the steps required to acknowledge an XIRQ interrupt....
according to the XIRQ docs, we must:
mip
EIP
; andESC
to complete the acknowledgementin my use-case, one of my iCEBreaker buttons is associated with XIRQ(0); triggering an interrupt occurs on the rising edge of the button press.... my interrupt handler (which performs steps 1-3) begins execution as soon as i press (and even hold) the button....
when i look a little closer with my logic analyzer, however, i find that the interrupt is executing TWICE.... said another way, even though i've performed steps 1-3, i am immediately hit with the same interrupt before idling through the WFI instruction....
my workaround -- as a fourth step, i explictly DISABLE the corresponding XIRQ channel in
EIE
in my interrupt handler.... with this change, i now execute my handler exactly once per button-press.... needless to say, i re-enable the XIRQ channel before executing the next WFI instruction....not a big issue -- though this is NOT how
mie
andmip
work in general.... specifically, i only need to touchmip
in step 1 above; the XIRQ FIRQ can remain enabled inmie
....my experience with other MCUs is that they do behave in accordance with model presented in the docs; and that's exactly how my first implementation proceeded.... in reality, however, i required the extra step of disabling the XIRQ channel itself....
as they say: when the map and the terrain disagree, trust the terrain 😉
Beta Was this translation helpful? Give feedback.
All reactions