I'm using the flash api. The assembly code I am using was found in another post here.
;-------------------------------------------------------------------------------
;
; Copy the Flash API from flash to SRAM.
;
.def _copyAPI2RAM_
.asmfunc
_copyAPI2RAM_
.ref api_load
flash_load .word api_load
.ref api_run
flash_run .word api_run
.ref api_size
flash_size .word api_size
ldr r0, flash_load
ldr r1, flash_run
ldr r2, flash_size
add r2, r1, r2
copy_loop1:
ldr r3, [r0], #4
str r3, [r1], #4
cmp r1, r2
blt copy_loop1
bx lr
.endasmfunc
I have found that the watchdog flag is reset upon entering this RAM copying function.
I'm checking the watchdog flag in the SYS_EXCEPTION register (addr 0xFFFFFFE4). When I trigger a watchdog reset, the flag is set correctly prior to this stmdaeq function.
Then when I step pass flash_run, the watchdog flag is cleared.
why is this happening?