diff --git a/cpu/cc2538/lpm.c b/cpu/cc2538/lpm.c index 74d00df91..da0349495 100644 --- a/cpu/cc2538/lpm.c +++ b/cpu/cc2538/lpm.c @@ -158,6 +158,9 @@ enter_pm0(void) static void select_32_mhz_xosc(void) { + /*First, make sure there is no ongoing clock source change */ + while((REG(SYS_CTRL_CLOCK_STA) & SYS_CTRL_CLOCK_STA_SOURCE_CHANGE) != 0); + /* Turn on the 32 MHz XOSC and source the system clock on it. */ REG(SYS_CTRL_CLOCK_CTRL) &= ~SYS_CTRL_CLOCK_CTRL_OSC;