GoodFET42 in FreeBSD

Hardware info on main page.

History

2014-05-04: see if the new software works better:

tingo@kg-v2$ cd goodfet/trunk/client
tingo@kg-v2$ ./goodfet.monitor testleds
Flashing LEDs
Flashed 1 LED.
tingo@kg-v2$ ./goodfet.monitor listapps
GoodFET with f26f MCU
Clocked at 0x8fb1
Build Date: 2013-02-16 12:05
Firmware apps:
Monitor
SPI
MAXUSB
JTAG
JTAG430
JTAG430
JTAG430X2
JTAGARM7
OpenOCD
CHIPCON
AVR
NRF

works like before.

tingo@kg-v2$ ./goodfet.bsl -c /dev/ttyU0
Use -h for help
Use --fromweb to upgrade a GoodFET.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8

works like before

tingo@kg-v2$ ./goodfet.bsl -c /dev/ttyU0 --dumpinfo
Use -h for help
Use --fromweb to upgrade a GoodFET.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Use -h for help
Use --fromweb to upgrade a GoodFET.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Traceback (most recent call last):
  File "./goodfet.bsl", line 1985, in <module>
    main(0);
  File "./goodfet.bsl", line 1940, in main
    bsl.actionStartBSL(bslreset=reset)
  File "./goodfet.bsl", line 1162, in actionStartBSL
    self.txPasswd(self.passwd)                  #transmit password
  File "./goodfet.bsl", line 1132, in txPasswd
    wait=wait)           #if wait is 1, try to sync forever
  File "./goodfet.bsl", line 797, in bslTxRx
    self.bslSync(wait)                          #synchronize BSL
  File "./goodfet.bsl", line 756, in bslSync
    raise BSLException(self.ERR_BSL_SYNC)       #Sync. failed
__main__.BSLException: Bootstrap loader synchronization error (maybe you need -P)

fails. What are the parameters:

tingo@kg-v2$ ./goodfet.bsl -c /dev/ttyU0 -h

USAGE: ./goodfet.bsl [options] [file]
Version: 1.39-goodfet-8

If "-" is specified as file the data is read from the stdinput.
A file ending with ".txt" is considered to be in TIText format,
'.a43' and '.hex' as IntelHex and all other filenames are
considered as ELF files.

General options:
  -h, --help            Show this help screen.
  -c, --comport=port    Specify the communication port to be used.
                        (Default is 0)
                                0->COM1 / ttyS0
                                1->COM2 / ttyS1
                                etc.
  -P, --password=file   Specify a file with the interrupt vectors that
                        are used as password. This can be any file that
                        has previously been used to program the device.
                        (e.g. -P INT_VECT.TXT or -P goodfet.hex).
  -f, --framesize=num   Max. number of data bytes within one transmitted
                        frame (16 to 240 in steps of 16) (e.g. -f 240).
  -m, --erasecycles=num Number of mass erase cycles (default is 1). Some
                        old F149 devices need additional erase cycles.
                        On newer devices it is no longer needed. (e.g. for
                        an old F149: -m20)
  -U, --unpatched       Do not download the BSL patch, even when it is
                        needed. This is used when a program is downloaded
                        into RAM and executed from there (and where flash
                        programming is not needed.)
  -D, --debug           Increase level of debug messages. This won't be
                        very useful for the average user...
  -I, --intelhex        Force fileformat to IntelHex
  -T, --titext          Force fileformat to be TIText
  -N, --notimeout       Don't use timeout on serial port (use with care)
  -B, --bsl=bsl.txt     Load and use new BSL from the TI Text file
  -S, --speed=baud      Reconfigure speed, only possible with newer
                        MSP403-BSL versions (>1.5, read slaa089a.pdf for
                        details). If the --bsl option is not used, an
                        internal BSL replacement will be loaded.
                        Needs a target with at least 2kB RAM!
                        Possible values are 9600, 19200, 38400
                        (default 9600)
  -1, --f1x             Specify CPU family, in case autodetect fails
  -2, --f2x             Specify CPU family, in case autodetect fails
  -4, --f4x             Specify CPU family, in case autodetect fails
                        --F1x and --f2x are only needed when the "change
                        baudrate" feature is used and the autodetect feature
                        fails. If the device ID that is uploaded is known, it
                        has precedence to the command line option.
  --invert-reset        Invert signal on RST pin (used for some BSL hardware)
  --invert-test         Invert signal on TEST/TCK pin (used for some BSL
                        hardware)
  --swap-reset-test     Swap the RST and TEST pins (used for some BSL hardware)
  --telos-latch         Special twiddle in BSL reset for Telos hardware
  --telos-i2c           DTR/RTS map via an I2C switch to TCK/RST in Telos Rev.B
  --telos               Implies options --invert-reset, --invert-test,
                        --swap-reset-test, and --telos-latch
  --telosb              Implies options --swap-reset-test, --telos-i2c,
                        --no-BSL-download, and --speed=38400
  --apimote             Implies --swap-reset-test
  --goodfet10
  --goodfet20
  --goodfet30
  --goodthopter         Same as GF30.
  --tmote               Identical operation to --telosb
  --z1                  Bootstrap a Z1
  --no-BSL-download     Do not download replacement BSL (disable automatic)
  --force-BSL-download  Download replacement BSL even if not needed (the one
                        in the device would have the required features)
  --slow                Add delays when operating the conrol pins. Useful if
                        the pins/circuit has high capacitance.
  --dumpinfo        Print the info flash timing data so you can save a copy
                        for later.  You must provide -P if flash is not    empty.

Program Flow Specifiers:
  -e, --masserase       Mass Erase (clear all flash memory)
  -E, --erasecheck      Erase Check by file
  -p, --program         Program file
  -v, --verify          Verify by file

The order of the above options matters! The table is ordered by normal
execution order. For the options "Epv" a file must be specified.
Program flow specifiers default to "pvr" if a file is given.
Don't forget to specify "e" or "eE" when programming flash!

Data retreiving:
  -u, --upload=addr     Upload a datablock (see also: -s).
  -s, --size=num        Size of the data block do upload. (Default is 2)
  -x, --hex             Show a hexadecimal display of the uploaded data.
                        (Default)
  -b, --bin             Get binary uploaded data. This can be used
                        to redirect the output into a file.

Do before exit:
  -g, --go=address      Start programm execution at specified address.
                        This implies option --wait.
  -r, --reset           Reset connected MSP430. Starts application.
                        This is a normal device reset and will start
                        the programm that is specified in the reset
                        vector. (see also -g)
  -w, --wait            Wait for <ENTER> before closing serial port.

If it says "NAK received" it's probably because you specified no or a
wrong password.

nothing more.

2014-05-04: trying to dump info:

tingo@kg-v2$ uname -a
FreeBSD kg-v2.kg4.no 8.4-STABLE FreeBSD 8.4-STABLE #7 r256430: Sun Oct 13 19:43:35 CEST 2013     root@kg-v2.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
tingo@kg-v2$ pwd
/usr/home/tingo/work/goodfet/trunk/client

dump it:

tingo@kg-v2$ echo $board
goodfet42
tingo@kg-v2$ ./goodfet.bsl -c /dev/ttyU0 --dumpinfo
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Use -h for help
Use --fromweb to upgrade a GoodFET.
Transmit default password ...
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Use -h for help
Use --fromweb to upgrade a GoodFET.
Transmit default password ...
Traceback (most recent call last):
  File "./goodfet.bsl", line 1874, in <module>
    main(0);
  File "./goodfet.bsl", line 1824, in main
    bsl.txPasswd(); #default pass
  File "./goodfet.bsl", line 1053, in txPasswd
    wait=wait)           #if wait is 1, try to sync forever
  File "./goodfet.bsl", line 754, in bslTxRx
    self.bslSync(wait)                          #synchronize BSL
  File "./goodfet.bsl", line 713, in bslSync
    raise BSLException(self.ERR_BSL_SYNC)       #Sync. failed
__main__.BSLException: Bootstrap loader synchronization error

Nope didn't work. Try to upgrade then:

tingo@kg-v2$ ./goodfet.bsl -c /dev/ttyU0 --fromweb
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Use -h for help
Use --fromweb to upgrade a GoodFET.
Mass Erase...
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Use -h for help
Use --fromweb to upgrade a GoodFET.
Mass Erase...
Traceback (most recent call last):
  File "./goodfet.bsl", line 1874, in <module>
    main(0);
  File "./goodfet.bsl", line 1789, in main
    for f in toinit: f()
  File "./goodfet.bsl", line 1067, in actionMassErase
    0xa506)             #Required setting for mass erase!
  File "./goodfet.bsl", line 755, in bslTxRx
    rxFrame = self.comTxRx(cmd, dataOut, len(dataOut))  #Send frame
  File "./goodfet.bsl", line 434, in comTxRx
    rxHeader, rxNum = self.comRxHeader()        #receive header
  File "./goodfet.bsl", line 340, in comRxHeader
    if not hdr: raise BSLException("Timeout")
__main__.BSLException: Timeout

also didn't work.

tingo@kg-v2$ ./goodfet.monitor listapps
GoodFET with f26f MCU
Clocked at 0x8fb1
Build Date: 2013-02-16 12:05
Firmware apps:
Monitor
SPI
MAXUSB
JTAG
JTAG430
JTAG430
JTAG430X2
JTAGARM7
OpenOCD
CHIPCON
AVR
NRF

Ok, it didn't break. Try as root:

root@kg-v2# ./goodfet.bsl --dumpinfo
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Use -h for help
Use --fromweb to upgrade a GoodFET.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Use -h for help
Use --fromweb to upgrade a GoodFET.
Traceback (most recent call last):
  File "./goodfet.bsl", line 1874, in <module>
    main(0);
  File "./goodfet.bsl", line 1782, in main
    bsl.comInit(comPort)                            #init port
  File "./goodfet.bsl", line 319, in comInit
    self.SetRSTpin()                        #enable power
  File "./goodfet.bsl", line 481, in SetRSTpin
    self.SetDTR(level, self.invertRST)
  File "./goodfet.bsl", line 461, in SetDTR
    self.serialport.setDTR(not level)
  File "/usr/local/lib/python2.7/site-packages/serial/serialposix.py", line 531, in setDTR
    if not self._isOpen: raise portNotOpenError
ValueError: Attempting to use a port that is not open
root@kg-v2# ./goodfet.bsl -c /dev/ttyU0 --fromweb
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Use -h for help
Use --fromweb to upgrade a GoodFET.
Mass Erase...
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Use -h for help
Use --fromweb to upgrade a GoodFET.
Mass Erase...
Traceback (most recent call last):
  File "./goodfet.bsl", line 1874, in <module>
    main(0);
  File "./goodfet.bsl", line 1789, in main
    for f in toinit: f()
  File "./goodfet.bsl", line 1067, in actionMassErase
    0xa506)             #Required setting for mass erase!
  File "./goodfet.bsl", line 755, in bslTxRx
    rxFrame = self.comTxRx(cmd, dataOut, len(dataOut))  #Send frame
  File "./goodfet.bsl", line 434, in comTxRx
    rxHeader, rxNum = self.comRxHeader()        #receive header
  File "./goodfet.bsl", line 340, in comRxHeader
    if not hdr: raise BSLException("Timeout")
__main__.BSLException: Timeout

No go. Ok, check out a new version of the software:

tingo@kg-v2$ svn co https://svn.code.sf.net/p/goodfet/code goodfet
[...snipped...]
A    goodfet/reports/avr/glitch/stock
A    goodfet/reports/avr/glitch/graphs.gnuplot
A    goodfet/reports/avr/glitch/Makefile
Checked out revision 1675.

done.