使用 nor u-boot 下载 程序成功,但是nand 中 出现 如下
file:///C:\Users\housansan\Documents\Tencent Files\617381238\Image\Image1\@BB_@2CNMEGH${H4E(UM1E8.jpg
证明烧写没有成功,是不是交叉编译环境不对 arm-linux-gcc 4.3.3 ,还是Makefile不对,到底哪里错了, 求助!!!!
led_on.c 源码如下:
#define GPBCON (*(volatile unsigned long *)0x56000010)
#define GPBDAT (*(volatile unsigned long *)0x56000014)
int main()
{
GPBCON = 0x00000400; // 设置GPB5为输出口, 位[11:10]=0b01
GPBDAT = 0x00000000; // GPB5输出0,LED1点亮
return 0;
}
crt0.S 如下
.text
.global _start
_start:
ldr r0, =0x53000000
mov r1, #0x0
str r1, [r0]
ldr sp, =1024*4
bl main
halt_loop:
b halt_loop
Makefile 如下:
led_on_c.bin : crt0.S led_on_c.c
arm-linux-gcc -nostdlib -c -o crt0.o crt0.S
arm-linux-gcc -nostdlib -c -o led_on_c.o led_on_c.c
arm-linux-ld -Ttext 0x0000000 -g crt0.o led_on_c.o -o led_on_c_elf
arm-linux-objcopy -O binary -S led_on_c_elf led_on_c.bin
arm-linux-objdump -D -m arm led_on_c_elf > led_on_c.dis
clean:
rm -f led_on_c.dis led_on_c.bin led_on_c_elf *.o
|