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.
解決済! 解決策の投稿を見る。
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.
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.
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.
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