Hi,
I used mbd generate code, but startup fail. cpu dead in function of CLOCK_DRV_Init .
my hardware is DEVKIT-MPC5744P. can you tell some reasons ?
status_t CLOCK_DRV_Init(clock_manager_user_config_t const * config)
{
status_t result = STATUS_SUCCESS;
DEV_ASSERT(config != NULL);
/* Clears peripheral clock gating and all clock sources in all power modes.
* Only an IRC type clock source is enabled and set as system clock source. */
result = CLOCK_SYS_Reset();
if (STATUS_SUCCESS == result)
{
/* Configure clock sources. */
result = CLOCK_SYS_ConfigureCgmcs(config);
if (STATUS_SUCCESS == result)
{
/* Configure peripheral clock gating, system clock source
* and clock sources in all power modes. */
result = CLOCK_SYS_ConfigureMcMe(config);
if (STATUS_SUCCESS == result)
{
/* Configure peripheral clocks. */
result = CLOCK_SYS_ConfigureCgm(config);
#if FEATURE_HAS_SDPLL_CLK
if (STATUS_SUCCESS == result)
{
/* Configure peripheral clocks. */
result = CLOCK_SYS_ConfigureSdpll(config);
if (STATUS_SUCCESS == result)
{
CLOCK_SYS_SetCMU(config);
}
}
#else
if (STATUS_SUCCESS == result)
{
CLOCK_SYS_SetCMU(config);
}
#endif
}
}
}
/* Calculate frequencies of clock sources and cache these values. This function is not called at runtime */
CLOCK_SYS_CalculateFrequenciesOfClockSources(false);
#if (defined(PRAMC_0) || defined(PRAMC_1) || defined(PRAMC_2))
uint32_t systemFrequency = 0U;
(void)CLOCK_DRV_GetFreq(SCS_CLK, &systemFrequency);
if (systemFrequency >= FEATURE_FT_DIS_CHECK_SYSTEM_FREQUENCY)
{
#if defined(PRAMC_0)
PRAMC_EnableFlowThrough(PRAMC_0, false);
#endif
#if defined(PRAMC_1)
PRAMC_EnableFlowThrough(PRAMC_1, false);
#endif
#if defined(PRAMC_2)
PRAMC_EnableFlowThrough(PRAMC_2, false);
#endif
}
else
{
#if defined(PRAMC_0)
PRAMC_EnableFlowThrough(PRAMC_0, true);
#endif
#if defined(PRAMC_1)
PRAMC_EnableFlowThrough(PRAMC_1, true);
#endif
#if defined(PRAMC_2)
PRAMC_EnableFlowThrough(PRAMC_2, true);
#endif
}
#endif
return result;
}