Can't turn off NMI using Processor Expert and KE06

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Can't turn off NMI using Processor Expert and KE06

跳至解决方案
1,060 次查看
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.

标签 (1)
0 项奖励
回复
1 解答
778 次查看
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 项奖励
回复
2 回复数
778 次查看
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 项奖励
回复
779 次查看
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 项奖励
回复