s32k144 stuck in nmi on s32ds 2018.r1

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

s32k144 stuck in nmi on s32ds 2018.r1

876 Views
computer386
Contributor I

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

Tags (3)
0 Kudos
2 Replies

699 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi computer386@sina.com.cn

Sorry for the late response. Have you solved the issue?

If not, could you please provide a test code so that we could reproduce it?

Thank you,

BR, Daniel

0 Kudos

699 Views
computer386
Contributor I

Hi Daniel,

Thanks for concerning the problem. I've locate the cause which related to the fault as below, I insert a section m_data_3 as Noinit may cause MemManage_Handler() interrupt.

/* Specify the memory areas */
MEMORY
{
/* Flash */
m_interrupts (RX) : ORIGIN = 0x00004000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00004400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00004410, LENGTH = 0x0007BBF0
m_flexram (RW) : ORIGIN = 0x14000000, LENGTH = 0x00001000
/* SRAM_L */
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000
/* m_data_3 (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00000200
m_data (RW) : ORIGIN = 0x1FFF8200, LENGTH = 0x00007E00*/

/* SRAM_U */
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00007000
}

/*
.noinit :
{
__MY_SECTION_START = .;
KEEP(*(.noinit))
. = ALIGN(4);
__MY_SECTION_END = .;
} > m_data_3
*/

0 Kudos