JTAG to SWD Adapter for Crossworks

Thursday, March 25, 2010

One of the main problems facing people who have started working with Cortex M0/M3 devices is the limited number of HW debuggers supporting SWD.  While some Cortex-M3 devices support both SWD and JTAG (the LPC1700 family, for example), many smaller device only support SWD, including the LPC1100 (Cortex-M0) and LPC1300 (Cortex-M3).  If you wanted to work in Crossworks, the only real choice for debugging SWD-only devices was (until now) Segger's J-Link for ARM (REVIEW: Segger J-Link for ARM EDU).

While the J-Link works perfectly in Crossworks, and is an absolute bargain for hobbiests at 49 €/$60 USD, if you already own an ARM-USB-OCD or ARM-USB-TINY debugger from Olimex or don't qualify for the EDU/non-commercial version of the J-Link for ARM, you may be interested in the JTAG-to-SWD adapter currently in development by Rowley Associates (the company behind Crossworks for ARM).  It converts the JTAG-only Olimex debuggers to an SWD compatible device, and conveniently includes both the classic 20-pin 0.1" Molex-type connector found on most ARM JTAG boards, as well as the newer (and much smaller) 2x5 0.05" SWD connector, which is the official Cortex connector.  (This is one advantage the adapter has over the J-Link, which only includes a 20-pin 0.1" connector, requiring you to purchase an adapter board if you need to use the smaller 0.05" SWD connector.)

The device works exactly like the ARM-USB-OCD/TINY would: you simply plug the adapter directly into the 20-pin slot on the ARM-USB-OCD/TINY, connect your development board to the adapter via either a 2x5 pin or 2x10 pin cables (which will need to be purchased seperately if you don't already have them), and press F5 to deploy the compiled code and start debugging.  The only modification to be made in Crossworks is that you need to select 'SWD' instead of the default 'JTAG' for the debugger's Target Interface Type, as seen below:

Rowley JTAG to SWD converter settings

After playing around with it a bit using the LPC1343 Reference Design, we found no issues with the device, and appreciated the fact that we were able to use the smaller 0.05" SWD connector.  The small size of the 2x5 pin connector allows you to add SWD support even on very space constrained boards, something that just isn't possible with the classic 20-pin Molex-type 'box'.

The adapter is priced at $45.00 USD and 'should' theoretically work with other FTDI based debuggers -- it's apparently been tested and works with the Amontec JTAGKey and JTAGKey2 -- but we've only tested it with an Olimex ARM-USB-OCD ourselves, so you may wish to contact Rowley Associates if you plan on using it with anything other than an Olimex ARM-USB-OCD/TINY or Amontech debugger.

Rowley JTAG to SWD converterRowley JTAG to SWD adapter Top View

Full story  | Comments (0)

LPC1343 Code Base Now Accessible

Wednesday, March 24, 2010

We've published the LPC1343 Code Base to allow people to test out the software, though it's still a 'work-in-progress'.  Until an official release is published, no guarantees can be made about the method signatures or features included, and there are a few known issues with the current code (the included Chibi drivers for the AT86RF212 do not currently compile from the command-line using GCC, for example, and there are a number of improvements that need to be made to the PMU code).  An initial version of the LPC1343 Code Base Documentation is also available online, as well as a tutorial: Setting up a GCC Development Environment for the Cortex M0/M3.

The subversion repository also contains project files for CodeLite C/C++ IDE (open-source) and Crossworks for ARM 2.0 (commercial but GCC-based).  Both tools are available for Windows, Linux and Mac OSX.

A big thank to Roel Verdult for providing the make file and generic startup code and linker script, which are also compatible with LPC1100 (Cortex-M0) and LPC1700 (Cortex-M3) families.  In the future, we will try to provide one common code base for the entire LPC1000 family, but for the moment the LPC1100 and LPC1300 software libraries are maintained seperately.  The LPC1100 Code Base should be publish in the coming weeks, once the code can be modified to make use of the startup files provided by Roel.

Roel has also provided an open-source tool to fix the checksum on binaries that will be used with the LPC1343's USB Bootloader.  The source code is provided in the "tools/lpcrc" folder, and a compiled binary version for Windows (32-bit) is available in the root folder.  Once the binary file is built using 'make', you simply need to run the lpcrc.exe tool with the name of the .bin file and then upload it to the LPC1343 via the USB bootloader. For example:

lpcrc firmware.bin

Full story  | Comments (1)