Stellaris® ARM® Microcontrollers
Forum
Options
Subscribe via RSS
protective code
protective code
Posted by
pButler1
on
Oct 11 2007 23:17 PM
Prodigy
20
points
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
Report Abuse
Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.