Saturday 3 August 2013

Texas Instruments CC Debugger

Texas Instruments offers great tools to get you started on their zigbee like wireless transceiver line.
CC Debugger and Smart RF studio.
You can buy a CC debugger for about 48$ at the Ti webshop, but where is the fun in that?
Luckily Ti provides the schema files , boot loader and firmware for the CCDebugger, so you easily can build one yourself.
I even found the gerber files for the product on the internet and ordered a batch of 10 pcbs from Itead.
I don't need them all, but this is their minimum order size.

What can you do with this tool?
The debugger helps you to evaluate signal strength , configuring the wireless modules and explore different configurations.
The modern Zigbee devices are incredibly powerful cheap but also very complicated.
A tool which helps you getting started is most welcome. 

The build of the toll was not really challenging but the programming gave me headaches for a while.
After I soldered the components to the pcb, I plugged the board into an usb slot.
Both leds lid up which means according to the manual empty controller.
So I had to load the boot loader into the CC2511 controller chip.
To do so you either need a  (programmed) CC Debugger or some fancy expensive dev board from Ti .
Luckily I own a Goodfet tool.

I fired up the console and connected the CC Debugger to the Goodfet.
The first step is to check if the programmer recognises the module 

> goodfet.cc test


SmartRF not found for chip 0x9104.
Tracing execution at startup.
Verifying that debugging a NOP doesn't affect the PC.
Checking pokes to XRAM.
Done.

Great, success.
Next step programming the bootloader




> goodfet.cc flash ../../../../usb_bootloader_srf05dbg.hex

SmartRF not found for chip 0x9104.
Flashing ../../../../usb_bootloader_srf05dbg.hex
Buffering 0000 toward 000000
Buffering 0100 toward 000000
Buffering 0200 toward 000000
Buffering 0300 toward 000000
Flashing buffer to 0x000000
Flashed page at 000000
Buffering 0400 toward 000400
Buffering 0500 toward 000400
Buffering 0600 toward 000400
Buffering 0700 toward 000400
Flashing buffer to 0x000400
Flashed page at 000400
.....
Flashed page at 001000
Buffering 1400 toward 001400
Buffering 1500 toward 001400
Flashing buffer to 0x001400
Flashed final page at 001400

Done, the rest is easy.
Start Smart RF Studio from Ti , plug in the CC Debugger and Smert RF Studio will program the device for you. Great!!!

Figuring out how to program the device took me a while, I even killed one CC2511 but once you figured it out all becomes so easy,...
Debugging the chips using the Goodfet is also possible, but Smart Rf Studio is way simpler and has a Gui.
I admit I am lazy,...

CCDebugger board top side
CCDebugger board bottom side


Links:
CC Debugger
Smart RF Studio
Goodfet

Friday 2 August 2013

Meet the Goodfet v42

The Goodfet is a super versatile tool for debugging and programming.

Once you received your pcb from Trevor you practically only need two integrated circuits and few passives.
The FT232 ic is responsible for usb to serial communication and the MSP430F2618 is the "brain" of the tool.

When the build is completed, simply  plug the Goodfet into a free usb port.
Open a console and enter dmesg to find out where the Goodfet is attached to.

> demesg

[ 4225.304042] usb 2-3: new full-speed USB device number 31 using ohci_hcd
[ 4225.610251] ftdi_sio 2-3:1.0: FTDI USB Serial Device converter detected
[ 4225.610327] usb 2-3: Detected FT232RL
[ 4225.610333] usb 2-3: Number of endpoints 2
[ 4225.610339] usb 2-3: Endpoint 1 MaxPacketSize 64
[ 4225.610344] usb 2-3: Endpoint 2 MaxPacketSize 64
[ 4225.610349] usb 2-3: Setting MaxPacketSize 64
[ 4225.623183] usb 2-3: FTDI USB Serial Device converter now attached to ttyUSB0

In this case it is ttyUSB0

Then edit your environment file and add the following lines:

> nano dev/environment

export board=goodfet42
export GOODFET=/dev/ttyUSB0 

 
The next step is to save your info file (important!) because after programming it is 
gone.
 
> board=goodfet42 goodfet.bsl --dumpinfo >info.txt
Use -h for help
Use --fromweb to upgrade a GoodFET.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)

 
This is what my info.txt file looks like
 
> nano info.txt
 
@1000
aa 55 ff 3f cd ab aa 55 34 12 ff ff aa 55 ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff 8b 86 fe 16 ff ff ff ff ff ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff 08 10 00 80 01 00 d0 81 ba 0b da 0d 04 82 05 07 
4c 08 fe 08 ff ff ff ff ff ff ff ff 01 08 9a 8f a2 8e 95 8d d2 86 
q
 
 
Next step program the newest firmware to the device
  
 
> board=goodfet42 goodfet.bsl --fromweb
Use -h for help
Use --fromweb to upgrade a GoodFET.
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...  Saved!
Grabbing goodfet42 firmware from http://goodfet.sourceforge.net/dist/goodfet42.hex
Failed to run curl, trying wget
2013-08-01 09:46:07 URL:http://goodfet.sourceforge.net/dist/goodfet42.hex [55933/55933] -> "/tmp/.goodfet42.hex" [1]
Mass Erase...
Transmit default password ...
Invoking BSL...
Transmit default password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Program ...
19870 bytes programmed.
Programming info flash...

 
I also programmed the install info created from the info file, tough I am nut sure this step 
is necessary.
 
> board=goodfet42  make installinfo
goodfet.bsl --speed=38400 -P goodfet.hex -p info.txt || true  #MSP430F2xx targets only, inelegant.
MSP430 Bootstrap Loader Version: 1.39-goodfet-8
Invoking BSL...
Transmit password ...
Current bootstrap loader version: 2.13 (Device ID: f26f)
Changing baudrate to 38400 ...
Program ...
256 bytes programmed. 

 
Programming is now completed and you should now own a working Goodfet tool.
To be on the safe side lets invoke a self test.

 
>board=goodfet42  goodfet.monitor test
Performing monitor self-test.
Self-test complete. 
 
Great a new working Goodfet tool is born.
To see what this tool is capable of lets enter
 

> board=goodfet42  goodfet.monitor listapps full
 
GoodFET with f26f MCU
Clocked at 0x8f9a
Build Date: 2013-01-23 16:28
Firmware apps:
Monitor
    The monitor app handles basic operations on the MSP430
    such as peeking and poking memory, calling functions and
    managing the baud rate.

SPI
    The SPI app handles the SPI bus protocol, turning
    your GoodFET into a USB-to-SPI adapter.

MAXUSB
    This allows you to write USB Host or USB Device drivers for
     the MAX3421 and MAX3420 chips.

JTAG
    The JTAG app handles basic JTAG operations such as
    resetting the TAP, resetting the target, detecting
    the instruction register width, shifting bits into
    both the instruction and data registers.

JTAG430
    The JTAG430 app adds to the basic JTAG app
    support for JTAG'ing MSP430 devices.

JTAG430
    The JTAG430 app adds to the basic JTAG app
    support for JTAG'ing MSP430 devices.

JTAG430X2
    The JTAG430X2 app extends the basic JTAG app with support
    for 20-bit MSP430X2 devices, such as the MSP430F5xx Family.

JTAGARM7
    The JTAGARM7 app extends the basic JTAG app with support
    for JTAG'ing ARM7TDMI based devices.

OpenOCD
    The OpenOCD app handles the OpenOCD bitbang protocol.

CHIPCON
    The CHIPCON app adds support for debugging the chipcon
    8051 processor.

AVR
    The AVR app adds support for debugging AVR based devices.

NRF
    The NRF app adds support for the NordicRF register
    interface.
 
 


If that is not a powerful tool I don't know what is.
I will add some future blogs showing in detail how to use this swiss army knife of 
programmers debuggers and tools. 
 
Goodfet42 and Goodfet41
 
 
Links:
Goodfet42 


Thursday 1 August 2013

Goodfet hardware developing tools

Trevor Goodspeed is an amazing hacker and hardware designer.

In the moment there are three pcbs available.

First the Goodfet Trevor's signature module.

The GoodFET is a JTAG adapter,  based upon Texas Instruments MSP430 FET UIF
The Goodfet can not only be used as a programmer, but also as an universal serial bus interface.

Second the GoodThopter

The GoodThopteris an opensource Can bus monitor.
The main purpose of this board is to explore Automotive communication buses, currently supporting only the CAN bus. In addition to the Goodfet a high-speed CAN Transceiver and a Stand-alone CAN Controller with a SPI Interface was added. The GoodThopter also allows users to purchase the cheaper OBD2 cables from SparkFun.

And third the Facedancer

The Facedancer is a hardware revision of the GoodFET except unlike the general-purpose GoodFET boards, the only purpose of this board is to allow USB devices to be written in host-side Python, so that one workstation can test the USB device drivers of another host.

I received pcbs from the above modules and will post a more detailed blog entry for each of them soon.



Trevors hardware and software are available under the BSD license, and free-as-in-beer boards will be given to those who ask politely.

Goodthopter Facedancer and Goodfet pcbs


Links:
Goodfet further information
Goodfet Homepage
GoodThopter Homepage
Facedancer Homepage
Ordering blank pcbs