S32K118 Watchdog Issue

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

S32K118 Watchdog Issue

Jump to solution
2,155 Views
bjs
Contributor III

Hi,

I have a demo project developed on s32k118evb board with watchdog disabled and it works well but after I download the project to my prototype PCB board the program triggers a watchdog timeout. 

Is there anything I missed to disable the watchdog timer?

====== Below is the board initialization code ======   

/* Board Initialization */
void Board_Init()
{
#if 1
DISABLE_INTERRUPTS(); // disable global interrupt
WDOG->CNT=0xD928C520;     /* Unlock watchdog */
WDOG->TOVAL=0x0000FFFF;    /* Maximum timeout value */
WDOG->CS = 0x00002100;    /* Disable watchdog */
ENABLE_INTERRUPTS(); // enable global interrupt
#endif
/* Clock */
CLOCK_DRV_Init(&clockMan1_InitConfig0);
 
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
 
/*** SPI ***/
LPSPI_DRV_MasterInit(MLX,&mlxState,&mlx_MasterConfig0);
 
/*** LPIT ***/
LPIT_DRV_Init(INST_LPIT1, &lpit1_InitConfig);
LPIT_DRV_InitChannel(INST_LPIT1, CHAN_0, &lpit1_ChnConfig0);
INT_SYS_InstallHandler(LPIT0_IRQn, &LPIT_ISR, (isr_t *)0);
LPIT_DRV_StartTimerChannels(INST_LPIT1, CHAN_0_MASK);
 
/*** CAN ***/
/* Initialize can pal instance */
/* !!! PE clock source MUST be peripheral clock !!! */
CAN_Init(&hscan_instance, &hscan_Config0);
 
/* Set buffer configuration */
CAN_ConfigTxBuff(&hscan_instance, TX_MAILBOX, &TxbuffCfg);
 
msg.id = HSCAN_ID;
msg.cs = 0U;
msg.length = 8;
 
/*** SBC Control ***/
// Set SBC control pin to enter normal mode
PINS_DRV_SetPins(STBN_PORT, STBN_PIN);
}
 
0 Kudos
Reply
1 Solution
2,123 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

If you are using the S32K1 SDK examples, there is DISABLE_WDOG in system_S32K118.c and system_S32K118.h that can be used to disable the watchdog:
/SDK/platform/devices/S32K118/startup/system_S32K118.c

DISABLE_WDOG system_S32K118.png

But I don't understand why it runs normally on S32K118EVB but errors occur on your prototype PCB board. Have you compared the differences between crystal circuits?


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

View solution in original post

0 Kudos
Reply
1 Reply
2,124 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

If you are using the S32K1 SDK examples, there is DISABLE_WDOG in system_S32K118.c and system_S32K118.h that can be used to disable the watchdog:
/SDK/platform/devices/S32K118/startup/system_S32K118.c

DISABLE_WDOG system_S32K118.png

But I don't understand why it runs normally on S32K118EVB but errors occur on your prototype PCB board. Have you compared the differences between crystal circuits?


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1874771%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K118%20Watchdog%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1874771%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20have%20a%20demo%20project%20developed%20on%20s32k118evb%20board%20with%20watchdog%20disabled%20and%20it%20works%20well%20but%20after%26nbsp%3BI%20download%20the%20project%20to%20my%20prototype%20PCB%20board%20the%20program%20triggers%20a%20watchdog%20timeout.%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20anything%20I%20missed%20to%20disable%20the%20watchdog%20timer%3F%3C%2FP%3E%3CP%3E%3D%3D%3D%3D%3D%3D%20Below%20is%20the%20board%20initialization%20code%20%3D%3D%3D%3D%3D%3D%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CDIV%3E%2F*%20Board%20Initialization%20*%2F%3C%2FDIV%3E%3CDIV%3Evoid%20Board_Init()%3C%2FDIV%3E%3CDIV%3E%7B%3C%2FDIV%3E%3CDIV%3E%23if%201%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EDISABLE_INTERRUPTS()%3B%20%2F%2F%20disable%20global%20interrupt%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWDOG-%26gt%3BCNT%3D0xD928C520%3B%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2F*%20Unlock%20watchdog%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWDOG-%26gt%3BTOVAL%3D0x0000FFFF%3B%26nbsp%3B%20%26nbsp%3B%20%2F*%20Maximum%20timeout%20value%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EWDOG-%26gt%3BCS%20%3D%200x00002100%3B%26nbsp%3B%20%26nbsp%3B%20%2F*%20Disable%20watchdog%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EENABLE_INTERRUPTS()%3B%20%2F%2F%20enable%20global%20interrupt%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%23endif%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%20Clock%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ECLOCK_DRV_Init(%26amp%3BclockMan1_InitConfig0)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EPINS_DRV_Init(NUM_OF_CONFIGURED_PINS%2C%20g_pin_mux_InitConfigArr)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F***%20SPI%20***%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELPSPI_DRV_MasterInit(MLX%2C%26amp%3BmlxState%2C%26amp%3Bmlx_MasterConfig0)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F***%20LPIT%20***%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELPIT_DRV_Init(INST_LPIT1%2C%20%26amp%3Blpit1_InitConfig)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELPIT_DRV_InitChannel(INST_LPIT1%2C%20CHAN_0%2C%20%26amp%3Blpit1_ChnConfig0)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EINT_SYS_InstallHandler(LPIT0_IRQn%2C%20%26amp%3BLPIT_ISR%2C%20(isr_t%20*)0)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ELPIT_DRV_StartTimerChannels(INST_LPIT1%2C%20CHAN_0_MASK)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F***%20CAN%20***%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%20Initialize%20can%20pal%20instance%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%20!!!%20PE%20clock%20source%20MUST%20be%20peripheral%20clock%20!!!%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ECAN_Init(%26amp%3Bhscan_instance%2C%20%26amp%3Bhscan_Config0)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%20Set%20buffer%20configuration%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ECAN_ConfigTxBuff(%26amp%3Bhscan_instance%2C%20TX_MAILBOX%2C%20%26amp%3BTxbuffCfg)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Emsg.id%20%3D%20HSCAN_ID%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Emsg.cs%20%3D%200U%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Emsg.length%20%3D%208%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F***%20SBC%20Control%20***%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F%2F%20Set%20SBC%20control%20pin%20to%20enter%20normal%20mode%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EPINS_DRV_SetPins(STBN_PORT%2C%20STBN_PIN)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1875431%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K118%20Watchdog%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1875431%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20using%20the%20S32K1%20SDK%20examples%2C%20there%20is%20%3CSTRONG%3EDISABLE_WDOG%3C%2FSTRONG%3E%20in%20system_S32K118.c%20and%20system_S32K118.h%20that%20can%20be%20used%20to%20disable%20the%20watchdog%3A%3CBR%20%2F%3E%2FSDK%2Fplatform%2Fdevices%2FS32K118%2Fstartup%2Fsystem_S32K118.c%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DISABLE_WDOG%20system_S32K118.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22DISABLE_WDOG%20system_S32K118.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F280960i1EECA47F9095DFAB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22DISABLE_WDOG%20system_S32K118.png%22%20alt%3D%22DISABLE_WDOG%20system_S32K118.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EBut%20I%20don't%20understand%20why%20it%20runs%20normally%20on%20S32K118EVB%20but%20errors%20occur%20on%20your%20prototype%20PCB%20board.%20Have%20you%20compared%20the%20differences%20between%20crystal%20circuits%3F%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3ERobin%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3C%2FP%3E%0A%3CP%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E