6410 从sd卡启动,参照下面教程。
led_on.s:
.text
.global _start
_start:
ldr r0, =0x7f008800 //GPK4-gpk7 output
ldr r1, =0x11110000
str r1, [r0]
ldr r0, =0x7f008808 //gpkdat
ldr r1, =0xf0 //10100000 低8位设置
str r1, [r0]
main_loop:
ldr r1,=0xa0;
str r1,[r0]
bl delay
ldr r1,=0x60;
str r1,[r0]
bl delay
b main_loop
delay:
ldr r2,=0xffffff
delay1:
sub r2,r2,#1
cmp r2,#0x0
bne delay1
mov pc,r14
Makefil:
CROSS_COMPILE :=arm-linux -
CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJDUMP = $(CROSS_COMPILE)objdump
led_on.bin : led_on.S
$(CC) -g -c -o led_on.o led_on.S
$(LD) -Ttext 0x0000000 -g led_on.o -o led_on_elf
$(OBJCOPY) -O binary -S led_on_elf led_on.bin
clean:
rm -f led_on.bin led_on_elf *.o
编译后生成led_on.bin ,用winhex烧写到sd卡,sd插上。led一闪一闪。
http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=3472292&bbs_page_no=1&bbs_id=3065http://topic.csdn.net/u/20110710/14/28ce2621-9d78-4eb6-9ff1-a0bc74222103.html[ 此帖被lingchidai在2011-09-29 20:18重新编辑 ]