Chinaunix首页 | 论坛 | 博客
  • 博客访问: 139392
  • 博文数量: 49
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 515
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-08 10:33
文章分类

全部博文(49)

文章存档

2010年(2)

2009年(30)

2008年(17)

我的朋友

分类: LINUX

2008-10-28 21:38:20

今天编写了一个小程序,全是熟悉开发板的。功能是这样的:
在开发板上,GPB0和GPB1上连接的是LED灯,想让它从0~3循环闪烁,程序在SDRAM中运行。
程序流程是这样的:关闭WATCHDOG,初始化SDRAM,把程序拷贝到SDRAM中,之后在运行。今天主要遇到的问题是编译的问题。我的工具链安装的位置是 /home/yuaf/guangpan/tools/../bin和环境变量添加的路径也是这里。若我写的程序在/home/yuaf/program里,这时用acc-linux-gcc工具链就编译不了。若程序在/home/yuaf/guangpan/hardware下就能编译,我就把环境变量改了。是在/etc/envirment里添加的。具体就是在/urs/local下新建一个目录,放置工具链下的/bin文件,只是把/bin文件拷贝在里面。结果不好使,导致原来好使的就不好使,就是所有的都编译不了啊。之后没有办法,还是得重新还原回去。还有在编译程序的时候,出现了
cc    -c -o head.o head.S
head.S: Assembler messages:
head.S:7: Error: no such instruction: `bl close_watchdog'
head.S:8: Error: no such instruction: `bl init_memery'
head.S:9: Error: no such instruction: `bl copy_steppingstone_to_sdram'
head.S:10: Error: no such instruction: `ldr pc,=on_sdram'
head.S:12: Error: no such instruction: `ldr sp,=0x34000000'
head.S:13: Error: no such instruction: `bl main'
head.S:15: Error: no such instruction: `b halt_loop'
head.S:18: Error: no such instruction: `ldr r0,=0x53000000'
head.S:19: Error: expecting operand after ','; got nothing
head.S:20: Error: invalid char '[' beginning operand 2 `[r0]'
head.S:21: Error: too many memory references for `mov'
head.S:23: Error: no such instruction: `ldr r0,=SDRAM_BASE'
head.S:24: Error: expecting operand after ','; got nothing
head.S:25: Error: expecting operand after ','; got nothing
head.S:27: Error: no such instruction: `ldr r4,[r1],'
head.S:28: Error: invalid char '[' beginning operand 2 `[r0]'
head.S:29: Error: too many memory references for `cmp'
head.S:30: Error: no such instruction: `bne l'
head.S:31: Error: too many memory references for `mov'
head.S:34: Error: no such instruction: `ldr r0,=MEM_CTL_BASE'
head.S:35: Error: no such instruction: `ldr r1,mem_cfg_val'
head.S:36: Error: too many memory references for `add'
head.S:38: Error: no such instruction: `ldr r3,[r1],'
head.S:39: Error: invalid char '[' beginning operand 2 `[r0]'
head.S:40: Error: too many memory references for `cmp'
head.S:41: Error: no such instruction: `bne r'
head.S:42: Error: too many memory references for `mov'
make: *** [head.o] 错误 1
如下错误,最开始我怀疑是我在vim里面写的有错误,可是重新写了,还是出现同样的错误。然后,我就没有用make了,我用acc-linux-gcc 这下就好使了,一直到最后的生成 .bin文件。我就以为是Makefile写错了,之后重新写了一遍, 之后就好使了。看来是Makefile里面写错了。以后得小心点。
阅读(964) | 评论(0) | 转发(0) |
0

上一篇:arm芯片学习

下一篇:GNU ARM汇编简介

给主人留下些什么吧!~~