Hello!
I was wondering if you could shed any light on the
errors i am having. I am following this tutorial for mote to mote
communication http://docs.tinyos.net/index.php/Mote-mote_radio_communication
and
it generates the following errors:
[r...@xps BlinkToRadio]# make micaz install mib510,/dev/ttyUSB0
mkdir -p build/micaz
compiling BlinkToRadioAppC to a micaz binary
ncc -o build/micaz/main.exe -Os -Wall -Wshadow -Wnesc-all -target=micaz
-fnesc-cfile=build/micaz/app.c -board=micasb -DDEFINED_TOS_AM_GROUP=0x22
--param max-inline-insns-single=100000 -DIDENT_APPNAME=\"BlinkToRadioApp\"
-DIDENT_USERNAME=\"root\" -DIDENT_HOSTNAME=\"XPS\"
-DIDENT_USERHASH=0x0e919144L -DIDENT_TIMESTAMP=0x4c3f1531L
-DIDENT_UIDHASH=0xafa97991L -fnesc-dump=wiring
-fnesc-dump='interfaces(!abstract())' -fnesc-dump='referenced(interfacedefs,
components)' -fnesc-dumpfile=build/micaz/wiring-check.xml
BlinkToRadioAppC.nc -lm
In file included from BlinkToRadioAppC.nc:9:
In component `BlinkToRadioC':
BlinkToRadioC.nc: In function `Timer0.fired':
BlinkToRadioC.nc:43: warning: passing argument 2 of `Packet.getPayload'
makes integer from pointer without a cast
/opt/tinyos-2.x/tos/chips/cc2420/lpl/DummyLplC.nc:39:2: warning: #warning
"*** LOW POWER COMMUNICATIONS DISABLED ***"
BlinkToRadioC.nc: In function 'BlinkToRadioC$Timer0$fired':
BlinkToRadioC.nc:43: warning: passing argument 2 of
'BlinkToRadioC$Packet$getPayload' makes integer from pointer without a cast
/opt/tinyos-2.x/tos/interfaces/Packet.nc:115: note: expected 'uint8_t' but
argument is of type 'void *'
/opt/tinyos-2.x/tos/lib/timer/VirtualizeTimerC.nc: In function
'VirtualizeTimerC$0$fireTimers':
/usr/lib/ncc/nesc_nx.h:272: warning: dereferencing pointer 'btrpkt' does
break strict-aliasing rules
/usr/lib/ncc/nesc_nx.h:272: warning: dereferencing pointer 'btrpkt' does
break strict-aliasing rules
BlinkToRadioC.nc:43: note: initialized from here
/usr/lib/ncc/nesc_nx.h:283: warning: dereferencing pointer 'header' does
break strict-aliasing rules
/opt/tinyos-2.x/tos/chips/cc2420/packet/CC2420PacketP.nc:100: note:
initialized from here
/usr/lib/ncc/nesc_nx.h:253: warning: dereferencing pointer 'header' does
break strict-aliasing rules
/opt/tinyos-2.x/tos/chips/cc2420/packet/CC2420PacketP.nc:100: note:
initialized from here
/usr/lib/ncc/nesc_nx.h:253: warning: dereferencing pointer 'result' does
break strict-aliasing rules
/opt/tinyos-2.x/tos/chips/cc2420/packet/CC2420PacketP.nc:100: note:
initialized from here
/usr/lib/ncc/nesc_nx.h:248: warning: dereferencing pointer 'header' does
break strict-aliasing rules
/opt/tinyos-2.x/tos/chips/cc2420/packet/CC2420PacketP.nc:100: note:
initialized from here
/usr/lib/ncc/nesc_nx.h:278: warning: dereferencing pointer 'header' does
break strict-aliasing rules
/opt/tinyos-2.x/tos/chips/cc2420/packet/CC2420PacketP.nc:100: note:
initialized from here
/usr/lib/gcc/avr/4.4.2/../../../../avr/bin/ld: BFD 2.17 internal error,
aborting at reloc.c line 445 in bfd_get_reloc_size
/usr/lib/gcc/avr/4.4.2/../../../../avr/bin/ld: Please report this bug.
make: *** [exe0] Error 1
The code that is throwing these errors is:
#include <Timer.h>
#include "BlinkToRadio.h"
module BlinkToRadioC {
uses interface Boot;
uses interface Leds;
uses interface Timer<TMilli> as Timer0;
uses interface Packet;
uses interface AMPacket;
uses interface AMSend;
uses interface SplitControl as AMControl;
uses interface Receive;
}
implementation {
bool busy = FALSE;
message_t pkt;
uint16_t counter = 0;
event void Boot.booted() {
call AMControl.start();
}
event void AMControl.startDone(error_t err) {
if (err == SUCCESS) {
call Timer0.startPeriodic(TIMER_PERIOD_MILLI);
}
else {
call AMControl.start();
}
}
event void AMControl.stopDone(error_t err) {
}
event void Timer0.fired() {
counter++;
call Leds.set(counter);
if (!busy) {
BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)(call
Packet.getPayload(&pkt, NULL));
btrpkt->nodeid = TOS_NODE_ID;
btrpkt->counter = counter;
if (call AMSend.send(AM_BROADCAST_ADDR, &pkt, sizeof(BlinkToRadioMsg))==
SUCCESS) {
busy = TRUE;
}
}
}
event message_t* Receive.receive(message_t* msg, void* payload, uint8_t len)
{
if (len == sizeof(BlinkToRadioMsg)) {
BlinkToRadioMsg* btrpkt = (BlinkToRadioMsg*)payload;
call Leds.set(btrpkt->counter);
}
return msg;
}
event void AMSend.sendDone(message_t* msg, error_t error) {
if (&pkt == msg) {
busy = FALSE;
}
}
}
I can't see what I have done wrong!
Thanks for any assistance,
--
Paul
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help