Re: [Tinyos-help] something wrong happened in CC1000 driver in tinyos-2.x tree of cvs version
I looked into this a little bit and it seems like this bug was introduced when we put code that sets the white bit in the metadata. The problem is in packetReceiveDone(), we are checking if the radio is in RECEIVED_STATE before setting it to RECEIVED_STATE. The radio would be in RX_STATE and discard the packet. Here is the relevant code snippet: void enterReceivedState() { radioState = RECEIVED_STATE; } void packetReceiveDone() { message_t* pBuf; uint16_t snr; atomic { if (radioState != RECEIVED_STATE) { return; } post signalPacketReceived(); enterReceivedState(); } Phil, you own this code so you should decide how to fix this problem. BTW, I did not get the out of bound error that John found - maybe I did not run the test long enough... Thanks. - om_p On Mon, Jun 2, 2008 at 4:03 PM, John Regehr [EMAIL PROTECTED] wrote: Ok, we found some mica2s and put Oscilloscope on them after hacking CC1000SendReceiveP.nc to check for count going out of bounds. It is definitely going out of bounds at line 501. John On Sun, 1 Jun 2008, John Regehr wrote: We think we have found a problem in the CC1000 receive-side code that is perhaps related to the behavior described here. The suspected culprit is at line 501 of CC1000SendReceiveP.nc which looks like this: ((uint8_t *)rxBufPtr)[count++] = nextByte; We think that count is going out of bounds, leading to RAM corruption. To test this, introduce some code just before this line that is something like if (count=sizeof(message_t)) { ... blink LEDs in infinite loop ... } Confirmation that this check fails (or not) would be useful to us. We'd do this ourselves but we seem to have very few mica2s sitting around. The root problem may be a failure to clear count at an appropriate time. John On Sun, 1 Jun 2008, Philip Levis wrote: On May 30, 2008, at 1:22 PM, Dima Kogan wrote: I can confirm this. My CC1000-based motes work fine with the 2.0.2 release but crash with the latest cvs. I run a modified BlinkToRadio to test, with one node only transmitting and the other node only receiving. The transmitting node works ok. The receiving node seems to crash. As a test, I turn on an LED in Boot.booted() and don't turn it off in any part of the code. This LED blinks or turns off at various times on the transmitted node, which indicates that the mote is rebooting. ALso, the first packet from the transmitter is always received properly, with the erroneous behavior starting with the second packet. There have only been a few small changes to the CC1000 stack; the first was that it actually checks for CRCs, the second was the inclusion of support for 4 bit link estimation. Om, you were going to run some tests on mica2dots, right? Can you see if you encounter this problem? Phil ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] something wrong happened in CC1000 driver in tinyos-2.x tree of cvs version
David Gay committed a fix a few minutes ago and things seem to be working now. BTW, I did not get the out of bound error that John found - maybe I did not run the test long enough... Odd-- I believe we saw it almost immediately. Anyway, should be a non-issue now. Thanks, John ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] something wrong happened in CC1000 driver in tinyos-2.x tree of cvs version
Hello all : that is right , it is the problem of CC1000SendReceiveP.nc . i have compare the file CC1000SendReceiveP.nc between the version of cvs and release . i think there is no problem in ((uint8_t *)rxBufPtr)[count++] = nextByte; , because this section of programme is the same between the two version . i find the problem exists lines 575 , maybe radioState is always not equal to RECEIVED_STATE , so the sentence of return always run . if (radioState != RECEIVED_STATE) { return; } i delete the return sentence , the motes can receive packets . i don't know the real reason why radioState is not equal to RECEIVED_STATE , can someone give an explain ? thank you !! 2008/6/2 John Regehr [EMAIL PROTECTED]: We think we have found a problem in the CC1000 receive-side code that is perhaps related to the behavior described here. The suspected culprit is at line 501 of CC1000SendReceiveP.nc which looks like this: ((uint8_t *)rxBufPtr)[count++] = nextByte; We think that count is going out of bounds, leading to RAM corruption. To test this, introduce some code just before this line that is something like if (count=sizeof(message_t)) { ... blink LEDs in infinite loop ... } Confirmation that this check fails (or not) would be useful to us. We'd do this ourselves but we seem to have very few mica2s sitting around. The root problem may be a failure to clear count at an appropriate time. John On Sun, 1 Jun 2008, Philip Levis wrote: On May 30, 2008, at 1:22 PM, Dima Kogan wrote: I can confirm this. My CC1000-based motes work fine with the 2.0.2 release but crash with the latest cvs. I run a modified BlinkToRadio to test, with one node only transmitting and the other node only receiving. The transmitting node works ok. The receiving node seems to crash. As a test, I turn on an LED in Boot.booted() and don't turn it off in any part of the code. This LED blinks or turns off at various times on the transmitted node, which indicates that the mote is rebooting. ALso, the first packet from the transmitter is always received properly, with the erroneous behavior starting with the second packet. There have only been a few small changes to the CC1000 stack; the first was that it actually checks for CRCs, the second was the inclusion of support for 4 bit link estimation. Om, you were going to run some tests on mica2dots, right? Can you see if you encounter this problem? Phil ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help -- zhang jiwen ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] something wrong happened in CC1000 driver in tinyos-2.x tree of cvs version
Ok, we found some mica2s and put Oscilloscope on them after hacking CC1000SendReceiveP.nc to check for count going out of bounds. It is definitely going out of bounds at line 501. John On Sun, 1 Jun 2008, John Regehr wrote: We think we have found a problem in the CC1000 receive-side code that is perhaps related to the behavior described here. The suspected culprit is at line 501 of CC1000SendReceiveP.nc which looks like this: ((uint8_t *)rxBufPtr)[count++] = nextByte; We think that count is going out of bounds, leading to RAM corruption. To test this, introduce some code just before this line that is something like if (count=sizeof(message_t)) { ... blink LEDs in infinite loop ... } Confirmation that this check fails (or not) would be useful to us. We'd do this ourselves but we seem to have very few mica2s sitting around. The root problem may be a failure to clear count at an appropriate time. John On Sun, 1 Jun 2008, Philip Levis wrote: On May 30, 2008, at 1:22 PM, Dima Kogan wrote: I can confirm this. My CC1000-based motes work fine with the 2.0.2 release but crash with the latest cvs. I run a modified BlinkToRadio to test, with one node only transmitting and the other node only receiving. The transmitting node works ok. The receiving node seems to crash. As a test, I turn on an LED in Boot.booted() and don't turn it off in any part of the code. This LED blinks or turns off at various times on the transmitted node, which indicates that the mote is rebooting. ALso, the first packet from the transmitter is always received properly, with the erroneous behavior starting with the second packet. There have only been a few small changes to the CC1000 stack; the first was that it actually checks for CRCs, the second was the inclusion of support for 4 bit link estimation. Om, you were going to run some tests on mica2dots, right? Can you see if you encounter this problem? Phil ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] something wrong happened in CC1000 driver in tinyos-2.x tree of cvs version
Hello all : i don't know whether something wrong happened in the driver of cc1000 in the cvs version of tinyos-2.x , but when i use the cvs version , my mica2 motes can't communicate with each other . i install the /opt/tinyos-2.x/apps/tutorials/BlinkToRadio to two motes , i find the leds never blink. (my mote use 900 MHZ , i have changed the frequency in CC1000Const.h , this is no problem) . so i chaged the application to test whether the Radio can start , when the event startDone is signaled , i turn on the red led , i find it is on when i boot the mote . next , i test whether the radio can send the message , i send the message every 500 ms, when the sendDone() is signaled , i toggle the green led , the green led toggles as i expected . but i find there is a strange problem , when it run for some times , the green leds does't blink any more . also , the same application which installed different motes , some motes blink the green led, some don't . the motes are ok , i have tested them . i set when the mote receives the packet , it toggle the yellow led , but the led never blink , that is to say it never receive the packet . does someone has the same problem with me ? can someone give me an explain or solution ? thank you very much!! -- zhang jiwen ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Re: [Tinyos-help] something wrong happened in CC1000 driver in tinyos-2.x tree of cvs version
I can confirm this. My CC1000-based motes work fine with the 2.0.2 release but crash with the latest cvs. I run a modified BlinkToRadio to test, with one node only transmitting and the other node only receiving. The transmitting node works ok. The receiving node seems to crash. As a test, I turn on an LED in Boot.booted() and don't turn it off in any part of the code. This LED blinks or turns off at various times on the transmitted node, which indicates that the mote is rebooting. ALso, the first packet from the transmitter is always received properly, with the erroneous behavior starting with the second packet. Thanks for the help. On Fri, 30 May 2008 22:36:27 +0800 jiwen zhang [EMAIL PROTECTED] wrote: Hello all : i also find a strange problem . i install the application into mote 1 compiled under the tinyos-2.x tree which is non cvs version ; i also install the application into the mote 2 compiled under the cvs version . if i turn on the mote 2 firstly , the green led will blink that is to say it send the packet successfully , then i turn on the mote 1 , i find the mote2 does't blink the green led any mote , but the mote1 still can receive the packet , because the mote1 blinks it's yellow led (it also blink green led that is to say it can send packet successfully). i also use the BaseStation to snoop the message , there is no packet received . can anyone explain the problem ? i doubt 2008/5/30 jiwen zhang [EMAIL PROTECTED]: Hello all : i don't know whether something wrong happened in the driver of cc1000 in the cvs version of tinyos-2.x , but when i use the cvs version , my mica2 motes can't communicate with each other . i install the /opt/tinyos-2.x/apps/tutorials/BlinkToRadio to two motes , i find the leds never blink. (my mote use 900 MHZ , i have changed the frequency in CC1000Const.h , this is no problem) . so i chaged the application to test whether the Radio can start , when the event startDone is signaled , i turn on the red led , i find it is on when i boot the mote . next , i test whether the radio can send the message , i send the message every 500 ms, when the sendDone() is signaled , i toggle the green led , the green led toggles as i expected . but i find there is a strange problem , when it run for some times , the green leds does't blink any more . also , the same application which installed different motes , some motes blink the green led, some don't . the motes are ok , i have tested them . i set when the mote receives the packet , it toggle the yellow led , but the led never blink , that is to say it never receive the packet . does someone has the same problem with me ? can someone give me an explain or solution ? thank you very much!! -- zhang jiwen -- zhang jiwen ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help