MPC5744 CLOCK SETUP FAIL

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MPC5744 CLOCK SETUP FAIL

409 次查看
acechongya
Contributor II
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;
}

 

标记 (1)
0 项奖励
回复
0 回复数
%3CLINGO-SUB%20id%3D%22lingo-sub-2322840%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Empc5744%20%E6%97%B6%E9%92%9F%E8%AE%BE%E7%BD%AE%E5%A4%B1%E8%B4%A5%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2322840%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3E%E6%82%A8%E5%A5%BD%EF%BC%8C%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%E6%88%91%E4%BD%BF%E7%94%A8%20mbd%20%E7%94%9F%E6%88%90%E4%BB%A3%E7%A0%81%EF%BC%8C%E4%BD%86%E5%90%AF%E5%8A%A8%E5%A4%B1%E8%B4%A5%E3%80%82%20%E5%9C%A8%3CSTRONG%3ECLOCK_DRV_Init%3C%2FSTRONG%3E%E5%8A%9F%E8%83%BD%E4%B8%AD%20cpu%20%E6%AD%BB%E6%9C%BA%E3%80%82%3C%2FDIV%3E%3CDIV%3E%E6%88%91%E7%9A%84%E7%A1%AC%E4%BB%B6%E6%98%AF%20DEVKIT-MPC5744P%E3%80%82%E4%BD%A0%E8%83%BD%E5%91%8A%E8%AF%89%E6%88%91%E4%B8%80%E4%BA%9B%E5%8E%9F%E5%9B%A0%E5%90%97%EF%BC%9F%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3Estatus_t%20CLOCK_DRV_Init(clock_manager_user_config_t%20const%20*%20config)%3C%2FDIV%3E%3CDIV%3E%7B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20status_t%20result%20%3D%20STATUS_SUCCESS%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20DEV_ASSERT(config%20!%3D%20NULL)%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%2F*%20%E6%B8%85%E9%99%A4%E6%89%80%E6%9C%89%E7%94%B5%E6%BA%90%E6%A8%A1%E5%BC%8F%E4%B8%8B%E7%9A%84%E5%A4%96%E8%AE%BE%E6%97%B6%E9%92%9F%E9%97%A8%E6%8E%A7%E5%92%8C%E6%89%80%E6%9C%89%E6%97%B6%E9%92%9F%E6%BA%90%E3%80%82%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20*%20%E5%8F%AA%E5%90%AF%E7%94%A8%20IRC%20%E7%B1%BB%E5%9E%8B%E7%9A%84%E6%97%B6%E9%92%9F%E6%BA%90%E5%B9%B6%E5%B0%86%E5%85%B6%E8%AE%BE%E7%BD%AE%E4%B8%BA%E7%B3%BB%E7%BB%9F%E6%97%B6%E9%92%9F%E6%BA%90%E3%80%82*%2F%3C%2FDIV%3E%3CDIV%3E%20%20%20%20result%20%3D%20CLOCK_SYS_Reset()%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%E5%A6%82%E6%9E%9C%20(STATUS_SUCCESS%20%3D%3D%20%E7%BB%93%E6%9E%9C)%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%2F*%20%E9%85%8D%E7%BD%AE%E6%97%B6%E9%92%9F%E6%BA%90%E3%80%82*%2F%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20result%20%3D%20CLOCK_SYS_ConfigureCgmcs(config)%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%E5%A6%82%E6%9E%9C%20(STATUS_SUCCESS%20%3D%3D%20%E7%BB%93%E6%9E%9C)%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%7B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20%E9%85%8D%E7%BD%AE%E5%A4%96%E8%AE%BE%E6%97%B6%E9%92%9F%E9%97%A8%E6%8E%A7%E3%80%81%E7%B3%BB%E7%BB%9F%E6%97%B6%E9%92%9F%E6%BA%90%3C%2FDIV%3E%3CDIV%3E*%20%E5%92%8C%E6%89%80%E6%9C%89%E7%94%B5%E6%BA%90%E6%A8%A1%E5%BC%8F%E4%B8%8B%E7%9A%84%E6%97%B6%E9%92%9F%E6%BA%90%E3%80%82*%2F%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20result%20%3D%20CLOCK_SYS_ConfigureMcMe(config)%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%E5%A6%82%E6%9E%9C%20(STATUS_SUCCESS%20%3D%3D%20%E7%BB%93%E6%9E%9C)%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%7B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20%E9%85%8D%E7%BD%AE%E5%A4%96%E8%AE%BE%E6%97%B6%E9%92%9F%E3%80%82*%2F%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20result%20%3D%20CLOCK_SYS_ConfigureCgm(config)%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%23if%20FEATURE_HAS_SDPLL_CLK%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%E5%A6%82%E6%9E%9C%20(STATUS_SUCCESS%20%3D%3D%20%E7%BB%93%E6%9E%9C)%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20%E9%85%8D%E7%BD%AE%E5%A4%96%E8%AE%BE%E6%97%B6%E9%92%9F%E3%80%82*%2F%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20result%20%3D%20CLOCK_SYS_ConfigureSdpll(config)%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%E5%A6%82%E6%9E%9C%20(STATUS_SUCCESS%20%3D%3D%20%E7%BB%93%E6%9E%9C)%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ECLOCK_SYS_SetCMU(config)%EF%BC%9B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%23else%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%E5%A6%82%E6%9E%9C%20(STATUS_SUCCESS%20%3D%3D%20%E7%BB%93%E6%9E%9C)%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ECLOCK_SYS_SetCMU(config)%EF%BC%9B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%23endif%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%2F*%20%E8%AE%A1%E7%AE%97%E6%97%B6%E9%92%9F%E6%BA%90%E7%9A%84%E9%A2%91%E7%8E%87%E5%B9%B6%E7%BC%93%E5%AD%98%E8%BF%99%E4%BA%9B%E5%80%BC%E3%80%82%E8%BF%90%E8%A1%8C%E6%97%B6%E4%B8%8D%E8%B0%83%E7%94%A8%E8%AF%A5%E5%87%BD%E6%95%B0%20*%2F%3C%2FDIV%3E%3CDIV%3E%20%20%20%20CLOCK_SYS_CalculateFrequenciesOfClockSources(false)%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%23if%20(defined(PRAMC_0)%20%7C%7C%20defined(PRAMC_1)%20%7C%7C%20defined(PRAMC_2))%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20uint32_t%20systemFrequency%20%3D%200U%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20(void)CLOCK_DRV_GetFreq(SCS_CLK%2C%26amp%3BsystemFrequency)%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%E5%A6%82%E6%9E%9C%20(systemFrequency%26gt%3B%3D%20FEATURE_FT_DIS_CHECK_SYSTEM_FREQUENCY)%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FDIV%3E%3CDIV%3E%23if%20defined(PRAMC_0)%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EPRAMC_EnableFlowThrough(PRAMC_0%2C%20false)%EF%BC%9B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%23endif%3C%2FDIV%3E%3CDIV%3E%23if%20defined(PRAMC_1)%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EPRAMC_EnableFlowThrough(PRAMC_1%2C%20false)%EF%BC%9B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%23endif%3C%2FDIV%3E%3CDIV%3E%23if%20defined(PRAMC_2)%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EPRAMC_EnableFlowThrough(PRAMC_2%2C%20false)%EF%BC%9B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%23endif%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%E4%B8%8D%E7%84%B6%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FDIV%3E%3CDIV%3E%23if%20defined(PRAMC_0)%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EPRAMC_EnableFlowThrough(PRAMC_0%2C%20true)%EF%BC%9B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%23endif%3C%2FDIV%3E%3CDIV%3E%23if%20defined(PRAMC_1)%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EPRAMC_EnableFlowThrough(PRAMC_1%2C%20true)%EF%BC%9B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%23endif%3C%2FDIV%3E%3CDIV%3E%23if%20defined(PRAMC_2)%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EPRAMC_EnableFlowThrough(PRAMC_2%2C%20true)%EF%BC%9B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%23endif%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%26nbsp%3B%20%7D%3C%2FDIV%3E%3CDIV%3E%23endif%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%20%20%20%20%E8%BF%94%E5%9B%9E%E7%BB%93%E6%9E%9C%EF%BC%9B%3C%2FDIV%3E%3CDIV%3E%7D%3C%2FDIV%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E