Hey there NXP community, I could use some help!
I've been attempting to get _NMI to be disabled during boot, to no avail.
I've looked at:
Disable NMI_b pin/interrupt KL04Z?
How to configure Flash Configuration setting from program to protect/un-protect the FRDM-K82F Board?
and of course the manual: http://cache.freescale.com/files/32bit/doc/ref_manual/KL17P64M48SF6RM.pdf
Here's my scenario, I'm using _NMI for another IC to wake the MCU and begin interaction. With debugger attached (using openOCD debugger if it matters) I have no problems, I assume because _NMI is stable in the high state. However, when I remove the debugger and plug it in, the app never starts. I'm assuming this is due to _NMI triggering. I've attempted editing the Flash_Config = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF3FFE}; field in startup, but no matter what I do, FOPT is coming back with 0xFF (as inspected through the debugger).
So what I need, I need _NMI to be disabled during initial bootup, and (to my understanding) for it to be enabled after initial boot so it can wake the mcu from sleep. What am I missing here?
See:
With debugger attached, you can see the app come alive (pin goes high). Then the external IC signals _NMI periodically. No problems.

No debugger attached, there is a short assert of _NMI, and the app never starts. (Note the quick assertion of _NMI at VCC on does happen with debugger attached too, but it doesn't matter because it is stable when debug is launched).
