Dave applications hangs in bool XMC_SCU_CLOCK_IsLowPowerOscillatorStable(void)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User9640
Level 1
Level 1
Hello Dave team,

I have an issue were the J-Link Debug session fails to move pass
this function:

bool XMC_SCU_CLOCK_IsLowPowerOscillatorStable(void)
{
return ((SCU_HIBERNATE->HDSTAT & SCU_HIBERNATE_HDSTAT_ULPWDG_Msk) == 0UL);
}

Stays there indefinitely and cant debug program.

The program will run if I reset the XMC4700 Relax Kit

Any Ideas as to why this would happen?
0 Likes
3 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

Could you try modifying the function XMC_SCU_CLOCK_EnableLowPowerOscillator() as below:

/* API to configure the 32khz Ultra Low Power oscillator */
void XMC_SCU_CLOCK_EnableLowPowerOscillator(void)
{
/* Enable OSC_ULP */
XMC_SCU_INTERRUPT_ClearEventStatus(XMC_SCU_INTERRUPT_EVENT_OSCULCTRL_UPDATED);
SCU_HIBERNATE->OSCULCTRL &= ~SCU_HIBERNATE_OSCULCTRL_MODE_Msk;
while ((XMC_SCU_INTERUPT_GetEventStatus() & XMC_SCU_INTERRUPT_EVENT_OSCULCTRL_UPDATED) == 0);

/* Clear ULP WDG status */
XMC_SCU_INTERRUPT_ClearEventStatus(XMC_SCU_INTERRUPT_EVENT_HDCLR_UPDATED);
SCU_HIBERNATE->HDCLR = (uint32_t)SCU_HIBERNATE_HDCLR_ULPWDG_Msk;
while ((XMC_SCU_INTERUPT_GetEventStatus() & XMC_SCU_INTERRUPT_EVENT_HDCLR_UPDATED) == 0);

/* Enable ULP WDG */
XMC_SCU_INTERRUPT_ClearEventStatus(XMC_SCU_INTERRUPT_EVENT_HDCR_UPDATED);
SCU_HIBERNATE->HDCR |= (uint32_t)SCU_HIBERNATE_HDCR_ULPWDGEN_Msk;
while ((XMC_SCU_INTERUPT_GetEventStatus() & XMC_SCU_INTERRUPT_EVENT_HDCR_UPDATED) == 0);
}


Regards,
Jesus
0 Likes
User13086
Level 1
Level 1
Hi Jesus,

the RealTimeClock (RTC with 32kHz Crystal) did not run
on my Sytem (XMC4700 with DAVE432).

After modifying the function XMC_SCU_CLOCK_EnableLowPowerOscillator()
with your changes the RTC works fine.


Regards
Hans
0 Likes
User12537
Level 1
Level 1
@Jesus: Had the same problem like Hans. Works very well! Thank you very much!

Dirk
0 Likes