cpu/cortexm_common: remove special cortexm_sleep handle for stm32l152re

__set_PRIMASK(state) had been directly inlined to avoid a hardfault that
occured when branching after waking up from sleep with DBG_STANDBY,
DBG_STOP or DBG_SLEEP set in DBG_CR.

The hardfault occured when returning from the branch to irq_restore,
since the function is now inlined the branch does not happen either.

Refer to #14015 for more details.
This commit is contained in:
Francisco Molina 2020-05-04 16:08:47 +02:00
parent 4ad3164599
commit b5e4224a6f
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8

View File

@ -170,12 +170,7 @@ static inline void cortexm_sleep(int deep)
unsigned state = irq_disable();
__DSB();
__WFI();
#if defined(CPU_MODEL_STM32L152RE)
/* STM32L152RE crashes if branching to irq_restore(state). See #11830. */
__set_PRIMASK(state);
#else
irq_restore(state);
#endif
}
/**