The pseudo-code makes it all sound so easy...
I'd start by looking at how I calculate 'C's address.
The devil is in the details in this sort of thing
so posting your actual code might help.
MS



David wrote:
> Hi,
> 
> I wrote a program that always crashes after calling send for a fixed  
> amount of times. The number of successful sends is constant for each  
> build but sometimes vary when changing the program code. It usually  
> lays between 3 and 5 times.
> What I do in the program is basically:
> 
> - Create a message_t
> - Create a pointer to a nx_structure A which contains an array of  
> nx_uint8_t of fixed size TOSH_DATA_LENGTH
> - Create a pointer to another nx_structure B
> - Create a pointer to another nx_structure C
> - Calculate the length of the payload I want to send
> - Get a pointer to the message payload with Packet.getPayload() and  
> let the pointer of type A point to it
> - Let the pointer of B point to the same place, this means the first  
> byte of the payload
> - Let the pointer of C point to the first byte after the last byte of B
> - Fill the elements of B and C with needed values
> - Broadcast the Message with AMSend.send() where the length parameter  
> is the calculated length of the payload which is lower than the array  
> contained in A
> 
> Is there some general mistake in what I am trying to do? I tried  
> everything I can think of but as long as I am calling AMSend.send()  
> the mote keeps on crashing. When commenting it out the application  
> runs fine. Commenting out other parts of my code does not stop the  
> mote from crashing. It even crashes when I try to call AMSend.send()  
> with a length parameter of sizeof(A). Does anyone have an clue where  
> to look now?
> 
> (btw. I'm working with iris motes if that matters)
> 
> Thanks, David.
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to