Hi,
I want to have a generic fault handler that will cause a reset. The handler may be called from a high-priority ISR or exception trap (e.g. hard fault handler), and will likely be called when the SoftDevice is enabled.
Calling sd_nvic_SystemReset appears to be recommended versus NVIC_SystemReset: devzone.nordicsemi.com/.../
However, it's unclear why. In general the "sd_" functions are used so that you don't interfere with SoftDevice state or real-time guarantees. But if we're resetting anyway, why does it matter?
Calling sd_nvic_SystemReset won't work properly from a high-priority ISR. In fact, it will result in a reset, but due to a lockup rather than a proper soft reset. It's also less than ideal because it requires the SoftDevice to be enabled.
A throwaway comment in the following suggests that one difference between the two functions is that "sd_nvic_SystemReset" may block until flash writes are finished: devzone.nordicsemi.com/.../
However, this isn't documented in the API description of the function. Would it be safe to assume that calling "NVIC_SystemReset" wouldn't cause any issues except the possible loss of a pending flash write?
Thanks, Carl