Continuation...
Hi again, Robin.
So I changed flash config's 13th byte at 0x40d to be 39h whereby bit 2 NMI_DIS is changed from 1 (enable NMI) to 0 (disable NMI).
First, that's all I did.
Please note that PTA4 is driving the base of an NPN transistor which will amplify the LED to reach its maximum lit intensity when turned on. Basically, the application FW sets PTA4 (default alt 7= NMI_b) to alt1 = plain PTA4 output.
After flashing and going to in-service normal operation, the LED is turned on (1) by the app.
PROBLEM STILL THERE:
However, if reset or powered-off, the board goes to this on state & still hangs & LED stays on - which to me means it is stuck inside the NMI interrupt handler(?)
So I tried 3 ways to do something inside the NMI interrupt handler - still none worked - stays hang & LED stays on - never going / proceeding to my application.
Within startup_mkl28z7.c :
1) removed the while(1) forever loop, & do nothing else - my thought is it will proceed to the rest of initialization to go to the application FW.
2) directly add the pin-muxing and setup of PTA4 inside the NMI function.
3) de-reference the default NMI handler such that on the upper level application FW, the low level NMI handler will be redirected to my own NMI handler where PTA is configured as alt1 GPIO, initialized and such.
All the while I have kept NMI_DIS bit = 0 (0x40d = 39h).
Is that wrong? If I'm putting up the NMI interrupt handler, whether method 1,2 or 3, should I have put back 0x40d = 3dh? (NMI_DIS = 1)?
Are those directives 1 and 2 I stated originally supposed to be BOTH to do? or EITHER-OR do?
That's the case since this morning & I have set this issue aside because I need to move on to other things to do.
Meanwhile, since we have a "spare" pin to use, our HW engineer left PTA4 floating (high) by disconnecting it from the NPN transistor base and we transferred the LED to another pin. This is our quickfix for now.
Unless someone can direct me how to code the NMI function or if it is do both ways or either-or way clearly, I will not come back to this matter until after the prototype we're developing is complete.
So please let me know if you have idea where I did wrong.
Thanks,
MI