Any body knows of a good tutorial on using the GNU blackfin toolchain with eclipse on Windows?
I'm trying to start with developing bare metal application on blackfin and I've installed the toolchain and eclipse C/C++ Juno but I'm unable to compile. Currently I'm getting the make: *** No rule to make target 'all' error but there are many other things I find myself lost at.
Many thanks in advance,
Hasan.
Edit: I've read a bit about the "make" programme, and decided to start a single-file test project to learn the command line toolchain (without the eclipse environment). Here is my main.c and associated 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 $@
Here is the result of running the make command on the cmd console:
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
This produced the .o and (supposedly) the elf file. And here is the result of trying to run the elf file using the toolchain simulator:
D:\work\experiments\bfin_test_project>bfin-elf-run bfin_test
program stopped with signal 11 (Segmentation fault).
According to http://docs.blackfin.uclinux.org/doku.php?id=toolchain:sim, this should be running the simulator in the virtual mode. (Not sure if I should be providing other files)
Also I'm not sure if the output file (bfin_test) is actually an elf file or if it can be run using the simulator (bfin-elf-run). But if so, I'm wondering why am I getting a segmentation fault of such a seemingly simple programme. Any idea anybody? Note that I get the same error when changing main to contain only "return 0;".
Could someone please tell me where I'm going wrong.
Thanks again,