the whole system hang on when imx8qm m40 watchdog triggered

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

the whole system hang on when imx8qm m40 watchdog triggered

637 Views
974782852
Contributor II

I use below cmmand to run my m40 appliction

1. insmod ./m4ctrl_dev.ko

2. ./m4ctrl --deploy=./m4_0.bin --core=0

 

My m40 application code:

#ifdef __cplusplus
extern "C"{
#endif
/*!
 * @brief WDOG0 IRQ handler.
 *
 */
void WDOG_IRQHandler(void)
{
    WDOG32_ClearStatusFlags(wdog32_base, kWDOG32_InterruptFlag);

/* Add for ARM errata 838869, affects Cortex-M4, Cortex-M4F Store immediate overlapping
  exception return operation might vector to incorrect interrupt */
#if defined __CORTEX_M && (__CORTEX_M == 4U)
    __DSB();
#endif
}
#ifdef __cplusplus
}
#endif

int main(void)
{
    /* Init board hardware. */
    sc_ipc_t ipc = BOARD_InitRpc();
    BOARD_InitPins(ipc);
    BOARD_BootClockRUN();
    BOARD_InitMemory();
    BOARD_InitDebugConsole();


    for (int temp = 0; temp < 128U; temp++)
    {
        __NOP();
    }
    /*
     * config.enableWdog32 = true;
     * config.clockSource = kWDOG32_ClockSource1;
     * config.prescaler = kWDOG32_ClockPrescalerDivide1;
     * config.testMode = kWDOG32_TestModeDisabled;
     * config.enableUpdate = true;
     * config.enableInterrupt = false;
     * config.enableWindowMode = false;
     * config.windowValue = 0U;
     * config.timeoutValue = 0xFFFFU;
     */
    WDOG32_GetDefaultConfig(&config);

    config.testMode = kWDOG32_UserModeEnabled;

    config.clockSource = kWDOG32_ClockSource0;
    config.prescaler = kWDOG32_ClockPrescalerDivide256;
    config.windowValue = 6000U;
    config.timeoutValue = 60000U;

    config.enableWindowMode = false;
    config.enableWdog32 = true;

    WDOG32_Init(wdog32_base, &config);

      while (1){

      }

}

when the whole system hangs on , i saw the output is "root@apalis-imx8:~# [ 1589.002363] m4ctrl_dev: loading out-of-tree module taints kernel."

It seems like the m40 application runs out of the ram

Please help me how to deal with it ?

0 Kudos
2 Replies

582 Views
igorpadykov
NXP Employee
NXP Employee

Hi

seems is no clean way to reset only the M4. The way the HW is designed, resetting just the M4
would leave the M4 bus fabrics, cache controller, etc. unreset and result in M4 hangs.
The best way to do this is create a partition for the M4 and make sure all the IP in the M4 is
in the M4 partition. If you do this, then the partition reset will make sure all these things are reset.
This is covered in the Reset section of the SCFW Porting Guide, sub-sections on

Partition Creation, Partition Boot :  SCFW Porting Kit

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

582 Views
974782852
Contributor II

Thank you for your reply, igorpadykov.

According to your answer, i have roughly skimed through the file "sc_fw_port.pdf", then i got a lot of doubt.

1. how to build the partition for m4 (the pdf not state a specified way)

2. how can i find the resoure used for not one core, is there a command to list the occupied resoure

0 Kudos