Customer use external crystal as F28035 system clock source, and internal osc1 still enable as watchdog source, however found device will hang up after some electromagnetic interference nearby the external crystal. After device hang up, the firmware never run again and watchdog also never reset device.
We do some validation as below:
1, Directly running TI example project from C2000ware, it still recur the hang up issue => so it should not customer firmware issue
2, Change system clock source to internal osc1, the issue do not happen => so the issue should caused by interference to external crystal
3, Stop clearing the watchdog will cause period reset => so the watchdog should be enable correctly, however it also will hang up after issue happen
4, Toggle the GPIO in firmware beginning and can check its toggle waveform for some times after electromagnetic interference => so the device should happen reset some times before totally hang up
5, Connect emulator debugging, will stop at "__asm(" ESTOP0");" in InitPll function after electromagnetic interference => so it should happen miss clock detection
void InitPll(Uint16 val, Uint16 divsel)
{
volatile Uint16 iVol;
//
// Make sure the PLL is not running in limp mode
//
if (SysCtrlRegs.PLLSTS.bit.MCLKSTS != 0)
{
EALLOW;
//
// OSCCLKSRC1 failure detected. PLL running in limp mode.
// Re-enable missing clock logic.
//
SysCtrlRegs.PLLSTS.bit.MCLKCLR = 1;
EDIS;
//
// Replace this line with a call to an appropriate
// SystemShutdown(); function.
__asm(" ESTOP0"); // Uncomment for debugging purposes
}
I suspect the firmware back to beginning and init system clock to external crystal again after device reset by electromagnetic interference affection, then device hang up because external crystal do not recover and still under electromagnetic interference.
My understand that F28035 should auto change system clock source from external crystal to internal osc1 after miss clock detection, my question is why device will not continue running by internal osc1? Why it happen reset and even hang up?
Do you have any suggestion how to set the clock and pll in firmware init rountinue maybe better to avoid the hang up issue?