I have an application built on the 52840 which is using a software interrupt triggered by the event generator unit. Occasionally my SWI function is being passed a zero for the flags value, despite the EGU being triggered by one of the task addresses.
More specifically, I have 4 timers each triggering GPIOTE tasks on 4 compare events via 16 PPI channels. For each timer, on one of the compare events, I have the PPI fork task set to an EGU trigger corresponding to the timer (all on EGU0, since they all call the same function). The SWI has a dedicated IRQ priority.
Everything works great except for the occasional hard fault if I don't explicitly check for the flags value being non-zero. My timers are running at 16MHz, but the SWI is only triggered every few milliseconds on each channel. I'm wondering if maybe IRQ collisions from the different EGU triggers are causing the flags value to somehow get 'lost'.
This is the setup code:
And this is the SWI function:
When I check no_flags_count in a debugger it's always non-zero.