Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to flash API Mote #46

Open
sandwich-destroyer opened this issue Sep 3, 2019 · 3 comments
Open

Unable to flash API Mote #46

sandwich-destroyer opened this issue Sep 3, 2019 · 3 comments

Comments

@sandwich-destroyer
Copy link

using instructions from here

root@kali:/opt/goodfet/firmware# make install
cp platforms/apimote2.h include/config.h
./gen_builddate_h
./gen_apps  monitor.h spi.h ccspi.h
msp430-gcc -mmcu=msp430f2618 -Wall -O1 -fno-strict-aliasing -g   -Duseuart1 -Dapimote -Dmsp430f2618 -Dapimote2 -Dplatform=apimote2 -Dboard=apimote4  -I include -I platforms -Duseuart1 -Dapimote   -c -o lib/apps.o lib/apps.c
msp430-gcc -mmcu=msp430f2618 -Wall -O1 -fno-strict-aliasing -g   -Duseuart1 -Dapimote -Dmsp430f2618 -Dapimote2 -Dplatform=apimote2 -Dboard=apimote4  -I include -I platforms -mmcu=msp430f2618   goodfet.o lib/msp430f2618.o lib/command.o lib/dco_calib.o lib/apps.o lib/msp430.o lib/arduino.o apps/monitor/monitor.o apps/spi/spi.o apps/radios/ccspi.o   -o goodfet
msp430-objcopy goodfet -O ihex goodfet.hex
#Note that 'make install' no longer erases the chip.
#Use 'make reinstall' if you want that.
goodfet.bsl --speed=38400 -p goodfet.hex
Unknown board specified.  Try board=goodfet41 if unsure.
Press Ctrl+C to cancel, or Enter to continue using unknown board.board=apimote2
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Changing baudrate to 38400 ...
Unknown board specified.  Try board=goodfet41 if unsure.
Press Ctrl+C to cancel, or Enter to continue using unknown board.board=apimote4
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Traceback (most recent call last):
  File "/usr/local/bin/goodfet.bsl", line 1987, in <module>
    main(0);
  File "/usr/local/bin/goodfet.bsl", line 1905, in main
    speed=speed,
  File "/usr/local/bin/goodfet.bsl", line 1166, in actionStartBSL
    self.txPasswd(self.passwd)                  #transmit password
  File "/usr/local/bin/goodfet.bsl", line 1136, in txPasswd
    wait=wait)           #if wait is 1, try to sync forever
  File "/usr/local/bin/goodfet.bsl", line 801, in bslTxRx
    rxFrame = self.comTxRx(cmd, dataOut, len(dataOut))  #Send frame
  File "/usr/local/bin/goodfet.bsl", line 480, in comTxRx
    rxHeader, rxNum = self.comRxHeader()        #receive header
  File "/usr/local/bin/goodfet.bsl", line 386, in comRxHeader
    if not hdr: raise BSLException("Timeout")
__main__.BSLException: Timeout
make: *** [Makefile:357: install] Error 1
root@kali:/opt/goodfet/firmware# make install
cp platforms/apimote2.h include/config.h
./gen_builddate_h
./gen_apps  monitor.h spi.h ccspi.h
msp430-gcc -mmcu=msp430f2618 -Wall -O1 -fno-strict-aliasing -g   -Duseuart1 -Dapimote -Dmsp430f2618 -Dapimote2 -Dplatform=apimote2 -Dboard=apimote4  -I include -I platforms -Duseuart1 -Dapimote   -c -o lib/apps.o lib/apps.c
msp430-gcc -mmcu=msp430f2618 -Wall -O1 -fno-strict-aliasing -g   -Duseuart1 -Dapimote -Dmsp430f2618 -Dapimote2 -Dplatform=apimote2 -Dboard=apimote4  -I include -I platforms -mmcu=msp430f2618   goodfet.o lib/msp430f2618.o lib/command.o lib/dco_calib.o lib/apps.o lib/msp430.o lib/arduino.o apps/monitor/monitor.o apps/spi/spi.o apps/radios/ccspi.o   -o goodfet
msp430-objcopy goodfet -O ihex goodfet.hex
#Note that 'make install' no longer erases the chip.
#Use 'make reinstall' if you want that.
goodfet.bsl --speed=38400 -p goodfet.hex
Unknown board specified.  Try board=goodfet41 if unsure.
Press Ctrl+C to cancel, or Enter to continue using unknown board.board=goodfet41
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Changing baudrate to 38400 ...
Unknown board specified.  Try board=goodfet41 if unsure.
Press Ctrl+C to cancel, or Enter to continue using unknown board.board=apimote1
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Traceback (most recent call last):
  File "/usr/local/bin/goodfet.bsl", line 1987, in <module>
    main(0);
  File "/usr/local/bin/goodfet.bsl", line 1905, in main
    speed=speed,
  File "/usr/local/bin/goodfet.bsl", line 1166, in actionStartBSL
    self.txPasswd(self.passwd)                  #transmit password
  File "/usr/local/bin/goodfet.bsl", line 1136, in txPasswd
    wait=wait)           #if wait is 1, try to sync forever
  File "/usr/local/bin/goodfet.bsl", line 801, in bslTxRx
    rxFrame = self.comTxRx(cmd, dataOut, len(dataOut))  #Send frame
  File "/usr/local/bin/goodfet.bsl", line 480, in comTxRx
    rxHeader, rxNum = self.comRxHeader()        #receive header
  File "/usr/local/bin/goodfet.bsl", line 386, in comRxHeader
    if not hdr: raise BSLException("Timeout")
__main__.BSLException: Timeout
make: *** [Makefile:357: install] Error 1

I have the API Mote V4 but can not find documentation on just how to flash these...

@sandwich-destroyer
Copy link
Author

more output with make reinstall

root@kali:/opt/goodfet/firmware# make reinstall
cp platforms/apimote2.h include/config.h
./gen_builddate_h
./gen_apps  monitor.h spi.h ccspi.h
msp430-gcc -mmcu=msp430f2618 -Wall -O1 -fno-strict-aliasing -g   -Duseuart1 -Dapimote -Dmsp430f2618 -Dapimote2 -Dplatform=apimote2 -Dboard=apimote4  -I include -I platforms -Duseuart1 -Dapimote   -c -o lib/apps.o lib/apps.c
msp430-gcc -mmcu=msp430f2618 -Wall -O1 -fno-strict-aliasing -g   -Duseuart1 -Dapimote -Dmsp430f2618 -Dapimote2 -Dplatform=apimote2 -Dboard=apimote4  -I include -I platforms -mmcu=msp430f2618   goodfet.o lib/msp430f2618.o lib/command.o lib/dco_calib.o lib/apps.o lib/msp430.o lib/arduino.o apps/monitor/monitor.o apps/spi/spi.o apps/radios/ccspi.o   -o goodfet
msp430-objcopy goodfet -O ihex goodfet.hex
goodfet.bsl --speed=38400 -e -p goodfet.hex
Unknown board specified.  Try board=goodfet41 if unsure.
Press Ctrl+C to cancel, or Enter to continue using unknown board.board=apimote4
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Checking for info flash...  None.
Look at contrib/infos/README.txt for better performance.
Mass Erase...
Transmit default password ...
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Changing baudrate to 38400 ...
Unknown board specified.  Try board=goodfet41 if unsure.
Press Ctrl+C to cancel, or Enter to continue using unknown board.board=apimote4
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Traceback (most recent call last):
  File "/usr/local/bin/goodfet.bsl", line 1987, in <module>
    main(0);
  File "/usr/local/bin/goodfet.bsl", line 1887, in main
    bsl.actionStartBSL()
  File "/usr/local/bin/goodfet.bsl", line 1166, in actionStartBSL
    self.txPasswd(self.passwd)                  #transmit password
  File "/usr/local/bin/goodfet.bsl", line 1136, in txPasswd
    wait=wait)           #if wait is 1, try to sync forever
  File "/usr/local/bin/goodfet.bsl", line 801, in bslTxRx
    rxFrame = self.comTxRx(cmd, dataOut, len(dataOut))  #Send frame
  File "/usr/local/bin/goodfet.bsl", line 480, in comTxRx
    rxHeader, rxNum = self.comRxHeader()        #receive header
  File "/usr/local/bin/goodfet.bsl", line 386, in comRxHeader
    if not hdr: raise BSLException("Timeout")
__main__.BSLException: Timeout
make: *** [Makefile:359: reinstall] Error 1

@jspiel
Copy link

jspiel commented Sep 4, 2019

Hi @sandwich-destroyer,

All apimotes come pre-flashed. If you need to flash one, please use the flash_apimote.sh script in the Killerbee repository: https://github.com/riverloopsec/killerbee

Thanks!

@sandwich-destroyer
Copy link
Author

@jspiel thank you. This is great, I didn't know about that script. My API Mote did come pre-flashed but I was having issues enough that I got desperate and flashed it.
For reference here is the error I was getting pre-re-flash:

root@kali:/opt/killerbee/tools# python zbstumbler -v -i /dev/ttyUSB0
zbstumbler: Transmitting and receiving on interface '/dev/ttyUSB0'
Setting channel to 11.
Transmitting beacon request.
Warning: waiting for serial read timed out (most likely).
Setting channel to 12.
Warning: waiting for serial read timed out (most likely).
Warning: waiting for serial read timed out (most likely).
Warning: waiting for serial read timed out (most likely).
Warning: waiting for serial read timed out (most likely).
Warning: waiting for serial read timed out (most likely).
Transmitting beacon request.
Warning: waiting for serial read timed out (most likely).
issue in peeking for a register
list index out of range
ERROR: Unable to inject packet: list index out of range
root@kali:/opt/killerbee/tools# python zbid
           Dev Product String       Serial Number
See the GoodFET FAQ about missing info flash.

Please also note there is nothing at all on the GoodFET FAQ about missing info flash...

Here is the error I am getting with the flash_apimote.sh script.

root@kali:/opt/killerbee/firmware# ./flash_apimote.sh 
Flashing apimotev4_gf.hex to the connected USB serial device.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Checking for info flash...  None.
Look at contrib/infos/README.txt for better performance.
Mass Erase...
Transmit default password ...
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Changing baudrate to 38400 ...
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Traceback (most recent call last):
  File "./goodfet.bsl", line 1982, in <module>
    main(0);
  File "./goodfet.bsl", line 1882, in main
    bsl.actionStartBSL()
  File "./goodfet.bsl", line 1164, in actionStartBSL
    self.txPasswd(self.passwd)                  #transmit password
  File "./goodfet.bsl", line 1134, in txPasswd
    wait=wait)           #if wait is 1, try to sync forever
  File "./goodfet.bsl", line 800, in bslTxRx
    rxFrame = self.comTxRx(cmd, dataOut, len(dataOut))  #Send frame
  File "./goodfet.bsl", line 479, in comTxRx
    rxHeader, rxNum = self.comRxHeader()        #receive header
  File "./goodfet.bsl", line 385, in comRxHeader
    if not hdr: raise BSLException("Timeout")
__main__.BSLException: Timeout

It looks to be the same error as flashing manually.

Since this script resides in the killerbee repo I will move the issue over there! Thank you for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants