任何人都知道在 Windows 上使用 GNU blackfin 工具链和 Eclipse 的好教程吗?
我正在尝试在 blackfin 上开发裸机应用程序,并且我已经安装了工具链和 eclipse C/C++ Juno,但我无法编译。目前我得到了make:***没有规则使目标“全部”错误,但我发现自己迷失了许多其他事情。
提前谢谢了,
哈桑。
编辑:我已经阅读了一些关于“make”程序的信息,并决定启动一个单文件测试项目来学习命令行工具链(没有 eclipse 环境)。这是我的 main.c 和相关的 makeFile:
//main.c
#include <stdio.h>
int main(void)
{
volatile int x = 42;
printf("%i\n", x);
return 0;
}
#makeFile
CPU = bf533-any
CROSS_COMPILE = bfin-elf-
CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)gcc
CFLAGS = -c -Wall
bfin_test: main.o
$(LD) main.o -mcpu=$(CPU) -o $@
main.o: main.c
$(CC) $(CFLAGS) main.c -mcpu=$(CPU) -o $@
下面是在 cmd 控制台上运行 make 命令的结果:
D:\work\experiments\bfin_test_project>dir
Volume in drive D is Data
Volume Serial Number is 248D-2C8D
Directory of D:\work\experiments\bfin_test_project
14/04/2013 12:30 <DIR> .
14/04/2013 12:30 <DIR> ..
11/04/2013 13:30 102 main.c
14/04/2013 12:29 257 makeFile
14/04/2013 12:29 264 makeFile~
3 File(s) 623 bytes
2 Dir(s) 634,582,650,880 bytes free
D:\work\experiments\bfin_test_project>make
bfin-elf-gcc -c -Wall main.c -mcpu=bf533-any -o main.o
bfin-elf-gcc main.o -mcpu=bf533-any -o bfin_test
c:/program files (x86)/analog devices/gnu toolchain/2012r2/elf/bin/../lib/gcc/bf
in-elf/4.3.5/../../../../bfin-elf/lib\libc.a(lib_a-closer.o): In function `close
_r':
/usr/src/packages/BUILD/blackfin-toolchain-2012R2/gcc-4.3/newlib/libc/reent/clos
er.c:53: warning: _close is not implemented and will always fail
c:/program files (x86)/analog devices/gnu toolchain/2012r2/elf/bin/../lib/gcc/bf
in-elf/4.3.5/../../../../bfin-elf/lib\libc.a(lib_a-fstatr.o): In function `fstat
_r':
/usr/src/packages/BUILD/blackfin-toolchain-2012R2/gcc-4.3/newlib/libc/reent/fsta
tr.c:62: warning: _fstat is not implemented and will always fail
c:/program files (x86)/analog devices/gnu toolchain/2012r2/elf/bin/../lib/gcc/bf
in-elf/4.3.5/../../../../bfin-elf/lib\libc.a(lib_a-isattyr.o): In function `isat
ty_r':
/usr/src/packages/BUILD/blackfin-toolchain-2012R2/gcc-4.3/newlib/libc/reent/isat
tyr.c:58: warning: _isatty is not implemented and will always fail
c:/program files (x86)/analog devices/gnu toolchain/2012r2/elf/bin/../lib/gcc/bf
in-elf/4.3.5/../../../../bfin-elf/lib\libc.a(lib_a-lseekr.o): In function `lseek
_r':
/usr/src/packages/BUILD/blackfin-toolchain-2012R2/gcc-4.3/newlib/libc/reent/lsee
kr.c:58: warning: _lseek is not implemented and will always fail
c:/program files (x86)/analog devices/gnu toolchain/2012r2/elf/bin/../lib/gcc/bf
in-elf/4.3.5/../../../../bfin-elf/lib\libc.a(lib_a-readr.o): In function `read_r
':
/usr/src/packages/BUILD/blackfin-toolchain-2012R2/gcc-4.3/newlib/libc/reent/read
r.c:58: warning: _read is not implemented and will always fail
c:/program files (x86)/analog devices/gnu toolchain/2012r2/elf/bin/../lib/gcc/bf
in-elf/4.3.5/../../../../bfin-elf/lib\libc.a(lib_a-writer.o): In function `write
_r':
/usr/src/packages/BUILD/blackfin-toolchain-2012R2/gcc-4.3/newlib/libc/reent/writ
er.c:58: warning: _write is not implemented and will always fail
这产生了 .o 和(据说)elf 文件。这是尝试使用工具链模拟器运行 elf 文件的结果:
D:\work\experiments\bfin_test_project>bfin-elf-run bfin_test
program stopped with signal 11 (Segmentation fault).
根据http://docs.blackfin.uclinux.org/doku.php?id=toolchain:sim,这应该是在虚拟模式下运行模拟器。(不确定我是否应该提供其他文件)
另外我不确定输出文件(bfin_test)是否实际上是一个elf文件,或者它是否可以使用模拟器(bfin-elf-run)运行。但如果是这样,我想知道为什么我会遇到这样一个看似简单的程序的分段错误。有人知道吗?请注意,将 main 更改为仅包含“return 0;”时,我得到了同样的错误。
有人可以告诉我哪里出错了。
再次感谢,