Can't turn off NMI using Processor Expert and KE06

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

Can't turn off NMI using Processor Expert and KE06

Jump to solution
1,098 Views
davidsherman
Senior Contributor I

Having a bit of a problem, for which I've logged a service request.  Thought I'd share so if anybody else is trying to use SPI0 module with the default PORTB pins, they'll know whats wrong.  Stumbled onto the fact that trying to use the SPI0 module creates a problem if the NMI is still enabled in SIM SOPT0.  It defaults to on, and it does not automatically turn off if the SPI module is enabled.  NMI shares the PORTB4 pin with SPI0_MISO.  Since I'm using MQX, Processor Expert has the NMI enabled by default.  Trouble is, it's a write once bit.  It turns out if I uncheck the NMI checkbox in the CPU configuration, it is still defined, so I've had to modify cpu_init.c to make sure it disables NMI.

Labels (1)
0 Kudos
Reply
1 Solution
816 Views
davidsherman
Senior Contributor I

Hi Erich, I was able to fix it. I didn't know there were two different checkboxes for disabling the NMI.  One under Common Settings, and one under CPU interrupts/resets.  Now it seems to be working without my modification.  I had just added #undef CPU_NMI_PIN before the statement that checks for it.

View solution in original post

0 Kudos
Reply
2 Replies
816 Views
BlackNight
NXP Employee
NXP Employee

Hi David,

can you share your modification in CPU_Init.c?

For me, it disables the NMI pin in PE_low_level_init() with the CPU_NMI_PIN set to 0x00U in CPU_config.h:

  #if CPU_NMI_PIN

  SIM_SOPT0 |= (uint32_t)SIM_SOPT0_NMIE_MASK; /* Enable NMI pin */

  #else

  SIM_SOPT0 &= (uint32_t)~(uint32_t)SIM_SOPT0_NMIE_MASK; /* Disable NMI pin */

  #endif /* CPU_NMI_PIN */

Regards,

Erich

0 Kudos
Reply
817 Views
davidsherman
Senior Contributor I

Hi Erich, I was able to fix it. I didn't know there were two different checkboxes for disabling the NMI.  One under Common Settings, and one under CPU interrupts/resets.  Now it seems to be working without my modification.  I had just added #undef CPU_NMI_PIN before the statement that checks for it.

0 Kudos
Reply