Skip to content

Commit

Permalink
cpu/cortexm_common: remove special cortexm_sleep handle for stm32l152re
Browse files Browse the repository at this point in the history
__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 RIOT-OS#14015 for more details.
  • Loading branch information
fjmolinas committed May 7, 2020
1 parent a05deb9 commit b2e0eef
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions cpu/cortexm_common/include/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down

0 comments on commit b2e0eef

Please sign in to comment.