Hello,
Question about the "hint" instruction - WFI.
The armv7m arch manual (i'm using DDI0403_B, latest?) says it will come out of the suspended / low-power state if:
• A reset.• An asynchronous exception at a priority that, if PRIMASK wasexceptions.Note The processor ignores the value of PRIMASK in determiningwakeup event.
• If debug is enabled, a debug event.• An IMPLEMENTATION DEFINED WFI wakeup event.
and I don't understand all of it.
Point 2 above: Say I start clean from reset with minimal setup, and (pseudo code) in my main is while (true) { __wfi; /* do stuf .. */ } , and I 've left all priorities as default after reset, non-configured un-altered. Are _any_ of Cortex non-NMI/non reset exceptions suppose to wake up my main? i.e, SysTick, Svc, PendSv ? How about external exceptions or interrupts that I've may have enabled through NVIC ? I'm using a CM4 based chip, and , I may have observed it wrong but it seemed to me that my main does not wake up on a peripheral interrupt, and out of the internal exceptions it wakes up on SysTick and SVC, but not on PendSV (it _seems_ ..)
Can an implementation change which exceptions will wake up the processor which is in sleep by wfi?
The part which says "implementation defined" WFI event: will those usually be expected to be specified by the tech ref manual or datasheet for the chip/ SoC? Because, I'm looking at the manual for this chip and I see no mentioning of the WFI & reference to this Implementation Defined part.
Also, Is it configurable at all, which interrupts / events would cause it to wake up from WFI ...? (I would want to ask about WFE as well, but I rather sort one out first).
Is actually using / relying on wfi any good at all for relying to wake up your main thread to check what just has happened ..
Hello 42Basitan Shick,
Thanks for responding
42Bastian Schick said: Is the information about which chip highly confidential? Anyway
Is the information about which chip highly confidential?
Anyway
No it is not indeed. But, this is ARM forum, and my question is not I presume specific to the chip implementer. Am I wrong ? I mean WFI is part of armv7 spec.I'm new to the ARM forum, and I do not know if people come & ask about a specific SoC.
So Anyway : my SoC is TI's CC3220.
42Bastian Schick said:any interrupt that "reaches"
"reaches" : I 'm not entirely sure what you meant.
But yes, interrupts are enabled - at least the ones I want, and the only one external or peripheral one that I'm using for the test ticks fine, and my ISR handler gets invoked, and the peripheral device works.
Sure this is an ARM forum, so questions like "How do I setup serial port in chip XYZ" are wrong here. But know which SoC helps to understand wheter there are other connections to the interrupt input of the core other then the NVIC.Anyway, to my understanding _all_ interrupts pass NVIC which then generates an exception to the core (which wakes it up from WFI).
Ok, thank you for your answer.