There's a note in the migration guide which says .. very ominously ...
Applications must not modify the SEVONPEND flag in the SCR register when running in priority level 1 for s130 and priority levels 2 or 3 for s132.
Two questions
- Why? Some rough idea of what that affects would be helpful as it's such a specific prohibition and all it really affects is the behaviour of WFE so it's hard to figure out what it could break.
- I have some code which runs in thread mode and modifies SEVONPEND, when it's done, it puts it back to what it was. However it could easily be interrupted by an interrupt in one of those high priorities whilst it's been modified (in this case it's being set). I assume, even though the interrupt doesn't modify it itself, just executing with SEVONPEND modified from thread mode breaks that prohibition.