Setting S32K312 PLL then system will reset

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

Setting S32K312 PLL then system will reset

Jump to solution
2,767 Views
Felix_ar
Contributor III

Hi All,

The customer setting S32K312 PLL then system will reset, attached file is the customer sample code.

could you give me some comments?

thanks.

FUNC(void, SYSDAL_APPL_CODE) SysDal_DriverInitZero(void)

{

    OsIf_Init(NULL_PTR);

    /* Initialise MCU Driver */

#if (MCU_PRECOMPILE_SUPPORT == STD_ON)

    Mcu_Init(NULL_PTR);

#else

    Mcu_Init( &Mcu_Config );

#endif

 

    /* Set the CPU Clock to the PLL */

#if (MCU_INIT_CLOCK == STD_ON)

    Mcu_InitClock(McuClockSettingConfig_HighPerf);  // only do this setting, system will reset every one second. 

#endif

#if(MCU_NO_PLL == STD_OFF)

    /* Wait until the PLL is locked */

    while (MCU_PLL_LOCKED != Mcu_GetPllStatus()); //include this setting, system will reset one time only.

    /* Activate the PLL Clock */

    Mcu_DistributePllClock(); //include this setting, system will reset one time only.

#endif/*MCU_NO_PLL == STD_OFF*/

 

    /* Initialize PORT */

    Port_Init( &Port_Config );

 

    /* Set the MCU to RUN mode */

    Mcu_SetMode(McuModeSettingConf_Run);

 

}

 

Main Loop

    for (;;) {

                (void)Dio_FlipChannel((Dio_ChannelType)DioConf_DioChannel_View1);

    }

0 Kudos
Reply
1 Solution
2,743 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Please check if it is related to the reasons mentioned in the following discussion:
If I don't give s32k312 delay, the CAN stop during operation

I checked your Clock_Ip_PBcfg.c, and it seems to be caused by it:

{
AIPS_SLOW_CLK,
4U,
{
0U,
}
},

{
HSE_CLK,
1U,
{
0U,
}
},


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
3 Replies
2,730 Views
Felix_ar
Contributor III

Hi Robin

Thank for your reply, the system reset problem is fixed.

One more question, S32K3xx_DCF_clients.xlxs mentions HSE_CLK_MODE_AND_GSKT_CTRL register can set to 1x then HSE clock can set up to 120MHz, but how to change register setting?

Because I can't find HSE_CLK_MODE_AND_GSKT_CTRL register in reference manual, I have found related register is HSE_CLK_MODE_OPTION, but that is read only register.

Thanks.

HSE_CLK.png

0 Kudos
Reply
2,700 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Please refer to the discussion in HSE PLL configuration.

0 Kudos
Reply
2,744 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Please check if it is related to the reasons mentioned in the following discussion:
If I don't give s32k312 delay, the CAN stop during operation

I checked your Clock_Ip_PBcfg.c, and it seems to be caused by it:

{
AIPS_SLOW_CLK,
4U,
{
0U,
}
},

{
HSE_CLK,
1U,
{
0U,
}
},


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-1893783%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ESetting%20S32K312%20PLL%20then%20system%20will%20reset%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1893783%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3EThe%20customer%20setting%20S32K312%20PLL%20then%20system%20will%20reset%2C%20attached%20file%20is%20the%20customer%20sample%20code.%3C%2FP%3E%3CP%3Ecould%20you%20give%20me%20some%20comments%3F%3C%2FP%3E%3CP%3Ethanks.%3C%2FP%3E%3CP%3EFUNC(void%2C%20SYSDAL_APPL_CODE)%20SysDal_DriverInitZero(void)%3C%2FP%3E%3CP%3E%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20OsIf_Init(NULL_PTR)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20Initialise%20MCU%20Driver%20*%2F%3C%2FP%3E%3CP%3E%23if%20(MCU_PRECOMPILE_SUPPORT%20%3D%3D%20STD_ON)%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Mcu_Init(NULL_PTR)%3B%3C%2FP%3E%3CP%3E%23else%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Mcu_Init(%20%26amp%3BMcu_Config%20)%3B%3C%2FP%3E%3CP%3E%23endif%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20Set%20the%20CPU%20Clock%20to%20the%20PLL%20*%2F%3C%2FP%3E%3CP%3E%23if%20(MCU_INIT_CLOCK%20%3D%3D%20STD_ON)%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Mcu_InitClock(McuClockSettingConfig_HighPerf)%3B%26nbsp%3B%20%2F%2F%20only%20do%20this%20setting%2C%20system%20will%20reset%20every%20one%20second.%26nbsp%3B%3C%2FP%3E%3CP%3E%23endif%3C%2FP%3E%3CP%3E%23if(MCU_NO_PLL%20%3D%3D%20STD_OFF)%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20Wait%20until%20the%20PLL%20is%20locked%20*%2F%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20while%20(MCU_PLL_LOCKED%20!%3D%20Mcu_GetPllStatus())%3B%20%2F%2Finclude%20this%20setting%2C%26nbsp%3Bsystem%20will%20reset%20one%20time%20only.%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20Activate%20the%20PLL%20Clock%20*%2F%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Mcu_DistributePllClock()%3B%26nbsp%3B%2F%2Finclude%20this%20setting%2C%26nbsp%3Bsystem%20will%20reset%20one%20time%20only.%3C%2FP%3E%3CP%3E%23endif%2F*MCU_NO_PLL%20%3D%3D%20STD_OFF*%2F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20Initialize%20PORT%20*%2F%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Port_Init(%20%26amp%3BPort_Config%20)%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2F*%20Set%20the%20MCU%20to%20RUN%20mode%20*%2F%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Mcu_SetMode(McuModeSettingConf_Run)%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%7D%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3EMain%20Loop%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20for%20(%3B%3B)%20%7B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20(void)Dio_FlipChannel((Dio_ChannelType)DioConf_DioChannel_View1)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1895079%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Setting%20S32K312%20PLL%20then%20system%20will%20reset%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1895079%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPlease%20refer%20to%20the%20discussion%20in%26nbsp%3B%3CSPAN%20class%3D%22lia-link-navigation%20lia-link-disabled%22%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FHSE-PLL-configuration%2Ftd-p%2F1672534%22%20target%3D%22_self%22%3EHSE%20PLL%20configuration%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1894338%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Setting%20S32K312%20PLL%20then%20system%20will%20reset%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1894338%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Robin%3C%2FP%3E%3CP%3EThank%20for%20your%20reply%2C%20the%20system%20reset%20problem%20is%20fixed.%3C%2FP%3E%3CP%3EOne%20more%20question%2C%20%3CSTRONG%3ES32K3xx_DCF_clients.xlxs%3C%2FSTRONG%3E%20mentions%26nbsp%3B%3CSTRONG%3EHSE_CLK_MODE_AND_GSKT_CTRL%20%3C%2FSTRONG%3Eregister%20can%20set%20to%201x%20then%20HSE%20clock%20can%20set%20up%20to%20120MHz%2C%20but%20how%20to%20change%20register%20setting%3F%3C%2FP%3E%3CP%3EBecause%20I%20can't%20find%26nbsp%3B%3CSTRONG%3EHSE_CLK_MODE_AND_GSKT_CTRL%20%3C%2FSTRONG%3Eregister%20in%20reference%20manual%2C%20I%20have%20found%20related%20register%20is%26nbsp%3B%3CSTRONG%3EHSE_CLK_MODE_OPTION%2C%3C%2FSTRONG%3E%20but%20that%20is%20read%20only%20register.%3C%2FP%3E%3CP%3EThanks.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22HSE_CLK.png%22%20style%3D%22width%3A%20771px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22HSE_CLK.png%22%20style%3D%22width%3A%20771px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F285846i5C5A196B209A0CA6%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22HSE_CLK.png%22%20alt%3D%22HSE_CLK.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1893925%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Setting%20S32K312%20PLL%20then%20system%20will%20reset%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1893925%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EPlease%20check%20if%20it%20is%20related%20to%20the%20reasons%20mentioned%20in%20the%20following%20discussion%3A%3C%2FSPAN%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FIf-I-don-t-give-s32k312-delay-the-CAN-stop-during-operation%2Fm-p%2F1828163%2Fhighlight%2Ffalse%23M32968%22%20target%3D%22_self%22%3EIf%20I%20don't%20give%20s32k312%20delay%2C%20the%20CAN%20stop%20during%20operation%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EI%20checked%20your%20Clock_Ip_PBcfg.c%2C%20and%20it%20seems%20to%20be%20caused%20by%20it%3A%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E%7B%3CBR%20%2F%3E%3CSTRONG%3EAIPS_SLOW_CLK%3C%2FSTRONG%3E%2C%3CBR%20%2F%3E%3CSTRONG%3E4%3C%2FSTRONG%3EU%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E0U%2C%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%2C%3C%2FP%3E%0A%3CP%3E%7B%3CBR%20%2F%3E%3CSTRONG%3EHSE_CLK%3C%2FSTRONG%3E%2C%3CBR%20%2F%3E%3CSTRONG%3E1%3C%2FSTRONG%3EU%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E0U%2C%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%2C%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%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%3C%2FLINGO-BODY%3E