Hi,

> You are right. I have now correct that part but I have another problem.
> When compiled with the mps430-gcc my code give this output:
> 
> rom...@romolo-laptop:/opt/tinyos-1.x/apps/Blink_functionC$ msp430-gcc
> c_code.c
> /opt/msp430/lib/gcc-lib/msp430/3.2.3/../../../../msp430/lib/crt430x110.o:g
> crt0.S:72: undefined reference to `_reset_vector__' /tmp/ccYaaPUX.o: In
> function `stampa':
> c_code.c:(.text+0x12): undefined reference to `printf'

The compilation fails because gcc looks for the main function in c_code.c and 
it can't find it. Anyway, you don't need to compile it manually, let make do 
that job. Add to your Makefile the lines:

PFLAGS+=-I/path/to/c_code.h
PFLAGS+=/path/to/c_code.c


> rom...@romolo-laptop:/opt/tinyos-1.x/apps/Blink_functionC$ make telosb
> mkdir -p build/telosb
>     compiling Blink to a telosb binary
> ncc -o build/telosb/main.exe -O -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d
> -Wnesc-all -target=telosb -fnesc-cfile=build/telosb/app.c -board=
> -I%T/lib/Deluge
> -Wl,--section-start=.text=0x4800,--defsym=_reset_vector__=0x4000
> -DIDENT_PROGRAM_NAME=\"Blink\" -DIDENT_USER_ID=\"romolo\"
> -DIDENT_HOSTNAME=\"romolo-laptop\" -DIDENT_USER_HASH=0xed3257d1L
> -DIDENT_UNIX_TIME=0x4caf1d65L -DIDENT_UID_HASH=0xa4999627L -mdisable-hwmul
> -I/opt/tinyos-1.x/tos/lib/CC2420Radio Blink.nc -lm /tmp/ccaA9vDU.o: In
> function `TimerM$executeTimers':
> app.c:(.text+0x4e4): undefined reference to `stampa'
> make: *** [exe0] Error 1
> 

I don't use TinyOS 1.x but if you correctly modify the Makefile, the output 
should be something like:

ncc -o build/telosb/main.exe -O -Wall -Wshadow -DDEF_TOS_AM_GROUP=0x7d -Wnesc-
all -target=telosb -fnesc-cfile=build/telosb/app.c -I/path/to/c_code.h 
/path/to/c_code.c <other_stuff>.

If you still have problems, let us take a look to a minimal compilable example 
exhibiting your symptoms, attaching the Makefile and the .nc, .c, .h files

Regards.

-- 
Giuseppe Cardone, Ph.D. Student
DEIS-LIA - Università degli Studi di Bologna
E-mail: [email protected]
Web: http://lia.deis.unibo.it/Staff/GiuseppeCardone/

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to