LPC5536 hard fault during clock config

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

LPC5536 hard fault during clock config

跳至解决方案
947 次查看
WDA
Contributor I

About once in every twenty boots, I get a hard fault during clock config:

WDA_0-1668201917746.png

If I insert a delay before the divider setup (commented out in the above picture), I don't get faults anymore. Has anyone seen this kind of problem before, or know what might cause it? This is on a custom board with a 24MHz crystal.

标签 (1)
0 项奖励
回复
1 解答
919 次查看
WDA
Contributor I

After talking with some FAEs from Avnet, we discovered that the Config Tools do not generate the code to wait for the XO_READY bit. After adding this line in clock_config.c, it is working fine.

    CLOCK_SetupExtClocking(24000000U);                            /* Enable XTALHF clock */
    while(!(ANACTRL->XO32M_STATUS & ANACTRL_XO32M_STATUS_XO_READY_MASK)); /* Wait for XO ready */

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
926 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello,

That sound like a hardware issue I recommend reviewing the schematic from the EVK maybe the crystal is not initialization well, please review the app note in the crystal recommendations. Hardware Design Guidelines for LPC55(S)xx Microcontrollers (nxp.com)

Best regards,
Pavel

0 项奖励
回复
920 次查看
WDA
Contributor I

After talking with some FAEs from Avnet, we discovered that the Config Tools do not generate the code to wait for the XO_READY bit. After adding this line in clock_config.c, it is working fine.

    CLOCK_SetupExtClocking(24000000U);                            /* Enable XTALHF clock */
    while(!(ANACTRL->XO32M_STATUS & ANACTRL_XO32M_STATUS_XO_READY_MASK)); /* Wait for XO ready */

 

0 项奖励
回复