AnsweredAssumed Answered

s32k144 stuck in nmi on s32ds 2018.r1

Question asked by harbert wang on Jul 15, 2019
Latest reply on Aug 16, 2019 by harbert wang

Hi,I've been working s32k144 on S32DS v2.0 for half a year,recently upgrade to 2018.R1 for ECC routine. The new problem is the nmi will be sticking in the  interrupt when input capture channel(ptc12,ch6) get signals,even the signal is removed,unless re-power up.I go back to v2.0 again,the ch6 of FTM2 goes well, and then I copy the same sources to 2018.R1, the problem occur again.  The sources is below:

 

void FTM2_init(void) {
   FTM2_NVIC_init_IRQs();
   PORTC->PCR[12] = 0x00000300;
   PCC->PCCn[PCC_FTM2_INDEX] &= ~PCC_PCCn_CGC_MASK; 
   PCC->PCCn[PCC_FTM2_INDEX] |= PCC_PCCn_PCS(0b001) 
   | PCC_PCCn_CGC_MASK; 
   FTM2->MODE |= FTM_MODE_WPDIS_MASK; 
   FTM2->SC = 0x00000004; 
   FTM2->CNT = 0;
   FTM2->COMBINE = 0x00000000;
   FTM2->POL = 0x00000000; 
   FTM2->MOD = 65536-1 ;
}

void FTM2_CH6_IC_init(void)
{

   FTM2->CONTROLS[6].CnSC = 0x000000046;
}

void start_FTM2_counter (void) {
  FTM2->SC |= FTM_SC_CLKS(3);
}

void FTM0_NVIC_init_IRQs(void)
{
   Enable_Interrupt(FTM0_Ch0_Ch1_IRQn,8);

}

void NMI_Handler(void)
{
__asm__("BKPT");

}

 

Could anyone give me a suggest to resolve the problem? thanks a lot.

 

Harbert Wang

Outcomes