Hard Fault when entering POWER_EnterDeepSleep

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

Hard Fault when entering POWER_EnterDeepSleep

跳至解决方案
2,664 次查看
bentuline
Contributor II

Hello,

I'm trying to implement deep sleep on an LPC54605, and I've run into a problem where upon entering the function POWER_EnterDeepSleep I'll get a hard fault exception (IBUSERR specifically, seen through MCUXpresso LPC Link debugger). Doesn't seem to matter what arguments I provide. I've been making changes to an existing software project, and the chunk of code that performs the sleep/wakeup does seem to work on this hardware so I don't think there's any fundamental hardware issue here. I haven't been able to spot any noticeable differences in the code, even if I move the sleep routine to be the first thing run after clock initialization I'll still see this error. 

Are there any known things to avoid when entering deep sleep on this chip? Most issues I've seen have been with wakeup, although that doesn't seem to be my problem. Alternatively, is the source available for this deep sleep mode? The fact that the driver source is only provided as a binary doesn't help here. 

标签 (2)
0 项奖励
回复
1 解答
2,614 次查看
bentuline
Contributor II

I think I found the difference actually, and it's sort of a result of the code I had taken over. I hadn't realized a coworker of mine had taken  SYSCON_PDRUNCFG_PDEN_SRAM1_2_3_MASK out of the 'exclude from deep sleep' bitmask. It looks like due to the growth of the application these banks had started to be used. So I guess the moral of the story is only disable what you know for a fact you're not using. 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
2,615 次查看
bentuline
Contributor II

I think I found the difference actually, and it's sort of a result of the code I had taken over. I hadn't realized a coworker of mine had taken  SYSCON_PDRUNCFG_PDEN_SRAM1_2_3_MASK out of the 'exclude from deep sleep' bitmask. It looks like due to the growth of the application these banks had started to be used. So I guess the moral of the story is only disable what you know for a fact you're not using. 

0 项奖励
回复
2,612 次查看
bentuline
Contributor II

Hi Jun, 

I can't seem to replicate this issue in a different environment. I guess what my question really is, is what are the prerequisites to safely enter deep sleep?

I can see that the fault occurs on the instruction "mov.w r12,#128", when r12 has a value of 0xffefbf7f (which sounds incorrect). Assuming the attached fsl_power_lib.c from the 2.3 SDK is still fairly representative of the 2.10 SDK, I imagine this corresponds to the line below based on the constant value:

 

SYSCON->AHBCLKCTRLSET[0] = SYSCON_AHBCLKCTRL_FLASH_MASK;

Not really sure why it would crash here to be honest, since it should just load a constant value into r12. I'm guessing the fault really occurs earlier but it's not clear what the problem would be. 

0 项奖励
回复
2,636 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

How can I reproduce your issue?

under SDK folder there is low power demo code power_manager_lpc. Could you test how to revise this demo to showcase your problem?

Thanks,

Jun Zhang

0 项奖励
回复