Skip to content

Commit

Permalink
Explicitly set the stack pointer in the reset handler.
Browse files Browse the repository at this point in the history
It turned out that running from debugger the stack pointer might be wrong
(initialized to the value of the system flash).
  • Loading branch information
mikewolfram committed May 5, 2020
1 parent 4e02180 commit 59ce752
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modm/platform/core/cortex/reset_handler.sx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
.type Reset_Handler, %function
.func Reset_Handler
Reset_Handler:
ldr r0,=__main_stack_top
mov sp,r0
bl __modm_initialize_platform
b __modm_startup
.endfunc

0 comments on commit 59ce752

Please sign in to comment.