Home arrow Support arrow Forums

Luminary Micro Forums

pButler1

Fresh Boarder
Click here to see the profile of this user

2007/10/11 23:17

protective code

The following code was written after I killed one '811 development board. Feel free to use any part of it for your own purposes.

; The following protective code goes right at the reset address...
Reset
;------------------------------------------------------------------------------
; Wait for the user button on the '811 Evaluation Kit to be released.
; That way if we kill the JTAG (or in my case, stop the processor clock)
; we will be able to hold the button down and load new code.
;
; And just about as important, this code falls through if the button
; is not pressed at reset time.
;
ldr r3,=0x400FE108 ;System Control base address + RCGC2
movs r2,#0x1F ;(RCGC2) enable all GPIO
str r2,[r3]

ldr r1,=GPIOPortC+0x40 ;RC4 (debug board switch)
userButtonWait
ldr r2,[r1]
ands r2,r2,#0xFF
beq userButtonWait
; button is released -- it's now safe to try silly games

login or register to reply