MKE02Z64VLD2 - FOPT Register Description

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MKE02Z64VLD2 - FOPT Register Description

Jump to solution
4,212 Views
satbir7
Contributor III

Hello All,

The BIT description for the FOPT Register is not found in the KE02 Sub-Family Reference Manual .

How can one disable the NMI option at power up?

I have already disabled it in the  SIM->SOPT register, but the  NMI still fires  at Power UP intermittently.

There is a 4.7K Pull UP on the  Pin along with a 47nF capacitor. 

Thanks,
Satbir

1 Solution
4,126 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi satbir7

   To KE0x chip, the NMI can't be disabled during POR. It just can be disabled in SIM->SOPT register, and this register control just can be done in the code. 

    So, in the POR phase, your NMI pin is still the NMI function, that means, you need to make sure the external NMI pin input signal is high, otherwise, it will influence your MCU boot.

 

Best Regards,

Kerry

    

View solution in original post

7 Replies
2,231 Views
rafaeltoledo
Contributor III

Hi,

I used a way, maybe can help you if you dont disabled NMI interrupt.

But the correct is disable NMI pin in CPU configuration (remember to switch to advanced mode)

and use a external pull-up in this pin, thats is recommended in User Guide.

rafaeltoledo_0-1608141903762.png

 

in Events.c file:

/*
** ===================================================================
** Event : Cpu_OnNMIINT (module Events)
**
** Component : Cpu [MKE02Z64QH2]
*/
/*!
** @brief
** This event is called when the Non maskable interrupt had
** occurred. This event is automatically enabled when the [NMI
** interrupt] property is set to 'Enabled'.
*/
/* ===================================================================*/
void Cpu_OnNMIINT(void) {
/* Write your code here ... */
SIM_SOPT = (uint32_t)((SIM_SOPT & (uint32_t)~(uint32_t)(
SIM_SOPT_CLKOE_MASK |
SIM_SOPT_NMIE_MASK
)) | (uint32_t)(
SIM_SOPT_RSTPE_MASK
));
}

Tags (1)
0 Kudos
Reply
4,127 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi satbir7

   To KE0x chip, the NMI can't be disabled during POR. It just can be disabled in SIM->SOPT register, and this register control just can be done in the code. 

    So, in the POR phase, your NMI pin is still the NMI function, that means, you need to make sure the external NMI pin input signal is high, otherwise, it will influence your MCU boot.

 

Best Regards,

Kerry

    

4,056 Views
satbir7
Contributor III

Hi Kerry Zhou,

Thank you @kerryzhou  for confirming my doubt!!

Satbir

0 Kudos
Reply
3,989 Views
kerryzhou
NXP TechSupport
NXP TechSupport

You are welcome!

Any new questions in the future, welcome to create the new question post.

 

Best Regards,

Kerry

0 Kudos
Reply
4,182 Views
satbir7
Contributor III

Hello @ErichStyger !

Thank you so much for replying to this post.

Before posting here I was doing some research  and found your page that you linked.  

Very helpful information, but  I am afraid it  does not apply to my situation. 

I almost Secured the MCU, but luckily it only enabled the  Flash Protection.

The MCU you have mentioned in that example has the  FOPT register  at different address than the one I am using. 

May be the NXP's documentation department can shed some light  on it.

Thanks,

Satbir

4,194 Views
ErichStyger
Specialist I

Hi @satbir7 ,

what I usually do in such situations is checking the code in Processor Expert.

See https://mcuoneclipse.com/2014/04/18/pin-muxing-using-the-nmi-pin-as-gpio-pin/ 

KE02 is supported (e.g. in Kinetis Design Studio): there is a setting to disable the NMI:

ErichS_1-1605677633531.png

It seems that indeed this does not change the NV_FOPT and the bits remain all 1:

ErichS_3-1605677898370.png

But what it does it changes the SIM_SOPT:

ErichS_2-1605677767421.png

Because I don't have a KE device I'm not able to test it. I have attached the project I have generated with Processor Expert for you.

I hope this helps,

Erich

4,198 Views
ErichStyger
Specialist I

Hi @satbir7 ,

indeed, the FOPT description is very minimal:

ErichS_0-1605677045280.png

 

taken from the RM here:

https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mc...

ErichS_0-1605676621474.png

If it follows other Kinetis devices (not sure), then it is a mirror of the SIM_SOPT:

ErichS_1-1605676648036.png

ErichS_2-1605676679064.png

 

I don't have a KE, but for all the Kinetis devices I use I have to configure and store the FOPT in the boot/flash configuration configuration area, see https://mcuoneclipse.com/2020/06/09/disabling-nmi-non-maskable-interrupt-pin/ 

I hope this helps,

Erich