diff --git a/qiboot/README b/qiboot/README index e69de29..ab9cad4 100644 --- a/qiboot/README +++ b/qiboot/README @@ -0,0 +1,6 @@ +use follow command to run this program +start OpenOCD,then do this + + > reset halt + > load_image /path/to/led_on 0 + > resume diff --git a/qiboot/src/led.S b/qiboot/src/led.S index 8e539df..04a98ee 100644 --- a/qiboot/src/led.S +++ b/qiboot/src/led.S @@ -1,9 +1,17 @@ -.global _start -_start: +.globl _start +_start: b start_code + +start_code: ldr sp,=1024*4 - -.extern main - bl main + + /* turn off the watchdog */ +# define pWTCON 0x53000000 + ldr r0, =pWTCON + mov r1, #0x0 + str r1, [r0] + +.extern blink_led + bl blink_led .global delay delay: subs r0,r0,#0x1 diff --git a/qiboot/src/led.c b/qiboot/src/led.c index 5e8447b..29a32a2 100644 --- a/qiboot/src/led.c +++ b/qiboot/src/led.c @@ -8,7 +8,7 @@ extern void delay(int time); -int main() +int blink_led() { GPBCON = 0x5; GPBDW = 0xffff;