Skip to content

cpu/cortexm: disable interrupts before sleeping#6499

Merged
PeterKietzmann merged 1 commit intoRIOT-OS:masterfrom
haukepetersen:fix_stm32l1_hardfaultonisr
Jan 27, 2017
Merged

cpu/cortexm: disable interrupts before sleeping#6499
PeterKietzmann merged 1 commit intoRIOT-OS:masterfrom
haukepetersen:fix_stm32l1_hardfaultonisr

Conversation

@haukepetersen
Copy link
Copy Markdown
Contributor

fixes #6484 (though temporarily for now)

A real fix will be provided with #6239

@haukepetersen haukepetersen added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Jan 27, 2017
@haukepetersen haukepetersen added this to the Release 2017.01 milestone Jan 27, 2017
@haukepetersen haukepetersen force-pushed the fix_stm32l1_hardfaultonisr branch from 0a0ba13 to 6e364b9 Compare January 27, 2017 11:51
@haukepetersen haukepetersen force-pushed the fix_stm32l1_hardfaultonisr branch from 6e364b9 to 3da9ceb Compare January 27, 2017 12:03
@haukepetersen haukepetersen changed the title cpu/stm32: disable sleep-mode for STM32L1 cpu/cortexm: disable interrupts before sleeping() Jan 27, 2017
@haukepetersen haukepetersen changed the title cpu/cortexm: disable interrupts before sleeping() cpu/cortexm: disable interrupts before sleeping Jan 27, 2017
@haukepetersen
Copy link
Copy Markdown
Contributor Author

Acutally, I changed the fix: The ARM Cortex-M reference manual advises to disable global interrupt before going to sleep. This prevents interrupts that might be triggered right between the execution of the __DSB and the __WFI instruction and would be subsequently lost.

Further there seems to be some hardware issue on some Cortex MCUs (e.g. on the stm32l1), that crash when waking up from __WFI with interrupts enabled...

@PeterKietzmann PeterKietzmann added Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 27, 2017
Copy link
Copy Markdown
Member

@PeterKietzmann PeterKietzmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haukepetersen great! Please provide a backport PR.

@PeterKietzmann
Copy link
Copy Markdown
Member

Did the backport for you in #6505

@haukepetersen haukepetersen deleted the fix_stm32l1_hardfaultonisr branch January 30, 2017 08:48
@immesys
Copy link
Copy Markdown
Contributor

immesys commented Feb 22, 2017

@haukepetersen, who did this fix, and @kaspar030 who did the new samd21/periph/pm.c. Is this a change that should be made universally? There are 4 places in the code where cortex chips execute __DSB(); __WFI(); and this is only one of them. The other three are in various periph/pm.c files. Should they be changed too?

@haukepetersen
Copy link
Copy Markdown
Contributor Author

@immesys: yes, it should be generalized -> see #6812

@miri64
Copy link
Copy Markdown
Member

miri64 commented Oct 18, 2017

There is a new release pending so at this point the backporting-needed label is only noise ;-)

@miri64 miri64 removed the Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch label Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

boards/nucleo-l1: hard faults with shell?

4 participants