From b2e0eefbaf0fdfeaec3fe13235d96b2ab7dfca1a Mon Sep 17 00:00:00 2001 From: Francisco Molina Date: Mon, 4 May 2020 16:08:47 +0200 Subject: [PATCH] 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. See #14015 for more details. --- cpu/cortexm_common/include/cpu.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cpu/cortexm_common/include/cpu.h b/cpu/cortexm_common/include/cpu.h index d79d654953268..117cec92d5d31 100644 --- a/cpu/cortexm_common/include/cpu.h +++ b/cpu/cortexm_common/include/cpu.h @@ -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 } /**