Pan17WJ / tinyos-main

Automatically exported from code.google.com/p/tinyos-main
1 stars 0 forks source link

tos-bsl broken for shimmer family #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A recent change to tos-bsl.in (Aug 14, 2011), in 
tinyos-main/tools/platforms/msp430/pybsl/, has broken bsl functionality for the 
shimmer family of motes (shimmer1, 2, 2r and span). I.e. rev r5693 of this file 
is broken, rev r5015 works. I have not tested other devices so I don't know if 
this problem is limited to shimmer devices.

To reproduce the problem run the new tos-bsl (r5693) on a shimmer device:
tos-bsl --invert-test --invert-reset -c /dev/ttyUSB5 -r -e -I -p main.ihex
which results in the following output:

MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Mass Erase...
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Mass Erase...
Traceback (most recent call last):
  File "./tos-bsl", line 1918, in <module>
    main(0);
  File "./tos-bsl", line 1833, in main
    for f in toinit: f()
  File "./tos-bsl", line 1098, in actionMassErase
    0xa506)             #Required setting for mass erase!
  File "./tos-bsl", line 758, in bslTxRx
    rxFrame = self.comTxRx(cmd, dataOut, len(dataOut))  #Send frame
  File "./tos-bsl", line 440, in comTxRx
    rxHeader, rxNum = self.comRxHeader()        #receive header
  File "./tos-bsl", line 346, in comRxHeader
    if not hdr: raise BSLException("Timeout")
__main__.BSLException: Timeout

Run the same command with the old version of tos-bsl (r5015) from the same 
folder, targeting the same device, the output is as follows (as expected):

MSP430 Bootstrap Loader Version: 1.39-telos-8
Mass Erase...
Transmit default password ...
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 1.61 (Device ID: f16c)
Program ...
3052 bytes programmed.
Reset device ...

Original issue reported on code.google.com by mikeghe...@gmail.com on 31 Aug 2011 at 1:53

GoogleCodeExporter commented 9 years ago
After a bit of digging it turns out the issue is at line 668 of tos-bsl.in 
(r5693).

The indentation of this line has been changed from the previous version 
(r5015), so as to put this function call into the previous if statement.

When I move remove a tab from this line (see attached patch) it now works on 
all versions of shimmer motes.

I suspect this was an accidental/unintentional (possibly text editor induced) 
change (going on the space/tab changes around that line in the file), but I 
cannot be sure of this.

Anybody have any more information on this change?

Original comment by mikeghe...@gmail.com on 1 Sep 2011 at 10:23

Attachments:

GoogleCodeExporter commented 9 years ago
Looks like the Zolertia check-in broke shimmer support.

Original comment by philip.l...@gmail.com on 12 Sep 2011 at 12:36

GoogleCodeExporter commented 9 years ago
Fixed the indent, however I do not own a shimmer platform so I haven't tested 
it myself.  Tested with Z1/telosb and worked well.

Original comment by ali...@zolertia.com on 12 Sep 2011 at 9:53

GoogleCodeExporter commented 9 years ago

Original comment by ali...@zolertia.com on 12 Sep 2011 at 9:54

GoogleCodeExporter commented 9 years ago
I've tested this update and I can confirm that the fix works for the shimmer 
family.

Incidentally, the reason this was never a problem for the telosb or z1 is that 
they both have their own reset functions (telosBReset() and bslResetZ1() 
respectively), so this problematic line is never reached. Additionally it would 
not have been a problem for the telos, as the "if" statement the line in 
question was pushed into was telos specific.

Original comment by mikeghe...@gmail.com on 12 Sep 2011 at 10:38

GoogleCodeExporter commented 9 years ago
Thanks for the follow up and the patch, sorry for any inconvenience.

Original comment by ali...@zolertia.com on 12 Sep 2011 at 10:47