ldqmoon 发表于 2009-9-14 13:49:29

linux 下安装avr-libc出现的一些问题,,请教

按照
http://www.nongnu.org/avr-libc/user-manual/install_tools.html#install_avr_binutils
中介绍的方法来安装 avr-libc
PATH已经设置好了 ,在安装 binutils-2.19.1的时候出现了如下问题
我使用 ../configure --prefix=$PREFIX --target=avr --disable-nls

$PREFIX已经指定到/usr/local/avr了

编译时出现

cc1: warnings being treated as errors
../../opcodes/avr-dis.c: In function 'avr_operand':
../../opcodes/avr-dis.c:112: error: format not a string literal and no format arguments
../../opcodes/avr-dis.c:152: error: format not a string literal and no format arguments
../../opcodes/avr-dis.c:161: error: format not a string literal and no format arguments
../../opcodes/avr-dis.c:172: error: format not a string literal and no format arguments
make: *** Error 1
make: Leaving directory `/home/ldqmoon/Desktop/binutils-2.19.1/obj-avr/opcodes'
make: *** Error 1
make: Leaving directory `/home/ldqmoon/Desktop/binutils-2.19.1/obj-avr/opcodes'
make: *** Error 2
make: Leaving directory `/home/ldqmoon/Desktop/binutils-2.19.1/obj-avr/opcodes'
make: *** Error 2
make: Leaving directory `/home/ldqmoon/Desktop/binutils-2.19.1/obj-avr'
make: *** Error 2




请问,这是为什么啊?

aozima 发表于 2009-9-14 13:53:48

你这是在编译avr-libc吗?
编译器都还没编译好

另外没必要用--prefix=$PREFIX来的
直接写--prefix=**就可以了...看得明了

chopin1998 发表于 2009-9-14 13:57:48

直接用apt-get的好了
RPM系应该也有类似yum的东西。

aozima 发表于 2009-9-14 13:59:23

有些东西不自己试下永远不知道自己在干什么
当自己试下后,不论成功与否
以后出现问题解决问题的思路就会有新的高度

aozima 发表于 2009-9-14 14:08:07

供参考
./bbs_upload/files_18/ourdev_480855.jpg

ldqmoon 发表于 2009-9-14 14:14:32

“编译器都还没编译好”    是指什么编译器没编译好? 是avr-gcc还是gcc?
如果是gcc的话, 这个有装好的,可以查看gcc的版本。 如果avr-gcc, 我就是打算装这个阿。

现在在用 apt-get 安装, 感觉好用很多

ldqmoon 发表于 2009-9-14 14:16:57

非常感谢aozima
顺便问一下,
make maybe-configure-bfd
push bfd
popd

这三句是作什么用的?

ldqmoon 发表于 2009-9-14 14:38:15

晕死, 有 apt-get装完后都不知道他装到哪里去了,还算自己装的好

aozima 发表于 2009-9-14 14:45:41

which avr-gcc

不过很多东东飞散在各处,只有用安装工具自带的删除才行

本来可以
make
make install
这样的

这里分开是好检查在哪一步出错
具体要去看Makefile了太大,打开一次都要折寿,更别说看了

aozima 发表于 2009-9-14 15:23:54

刚刚更新了我的avr-gcc
记录如下:
点击此处下载 ourdev_480875.txt(文件大小:1K) (原文件名:new_avr.txt)

然后下载BOZAI的程序测试OK(http://www.ourdev.cn/bbs/bbs_content.jsp?bbs_sn=850436)
不过他的Makefile写得有点点问题
avr-gcc.exe只是WIN下面的
然后avr-siza的参数好像有点不对,取消之

ldqmoon 发表于 2009-9-14 18:57:10

我这边的AVR开发环境已经搞了, 谢谢aozima,
avr-gcc默认是装到/usr/bin/下了, 头文件在/usr/bin/avr下了.
同时还装了uisp,发现ubuntu 的apt-get还真是好用, 很多软件才可以用那个来装, federa下好象就没有. 而且

测试程序是我自己的, 用的是winavr下的Makefile, 更改CFLAG指向头文件和库文件, 不过好象不支持多级目录的.
刚好minicom也设置好了, 接下来再测试一下.

aozima 发表于 2009-9-14 19:30:31

federa下用 yum

Makefile自己去改吧

ldqmoon 发表于 2009-9-14 19:57:22

Makefile 没问题的 , 不过出了新的问题:
使用minicom时不能 发送数据到avr上,发送数据后avr就复位了。 程序在windows下就没问题。 设置minicom为115200 8N1,无硬件流控制。

aozima 发表于 2009-9-14 20:00:44

AVR复位和PC及PC上发来的数据扯不上关系吧...
顶多收到数据后中断,这也是你程序中可预计的结果

可能的原因是:
你没有使用中断,但中断却被打开了,于是,收到数据后产生了中断
而avr-libc把末使用的中断都指向了RESET....于是...

ldqmoon 发表于 2009-9-23 09:56:05

接收中断确实是被打开了, 中断也没用.
不过在winavr下没问题, 换到linux下就出了问题,难道两者有不同? 或者说是版本差别?

回头再试下

looker 发表于 2009-9-23 10:19:16

mark
页: [1]
查看完整版本: linux 下安装avr-libc出现的一些问题,,请教