fill stack region with pattern 0xADADADAD for detect stack usage
This commit is contained in:
1 parent
cf68679497
commit
b0779f0ee8
1 file changed
+11
-1
@@ -28,7 +28,7 @@
|
||||
.syntax unified
|
||||
.arch armv7e-m
|
||||
|
||||
/* Adafruit nrf52 use RTOS, thus disable stack here */
|
||||
/* Adafruit define stack & heap inside linker script */
|
||||
/* .section .stack
|
||||
.align 3
|
||||
#ifdef __STACK_SIZE
|
||||
@@ -362,6 +362,16 @@ Reset_Handler:
|
||||
|
||||
.L_loop1_done:
|
||||
|
||||
/* Adafruit fill stack region with pattern 0xADADADAD */
|
||||
ldr r0, =__StackLimit
|
||||
ldr r1, =__StackSize
|
||||
ldr r2, =0xADADADAD
|
||||
.L_fill:
|
||||
str r2, [r0]
|
||||
adds r0, 4
|
||||
subs r1, 4
|
||||
bne .L_fill
|
||||
|
||||
/* This part of work usually is done in C library startup code. Otherwise,
|
||||
* define __STARTUP_CLEAR_BSS to enable it in this startup. This section
|
||||
* clears the RAM where BSS data is located.
|
||||
|
||||
Reference in new issue
Block a user