Stellaris Launchpad as a JTAG programmer (not yet)
I haven’t got this working (yet). There may even be limitations to the hardware that mean this couldn’t work.
The general idea was to use a cheap ($4.99) Texas Instruments Stellaris Launchpad (LM4F120XL) board in place of a pricier ($34.95) Dangerous Prototypes Bus Blaster. All of the basic pieces seemed to be there – USB connectivity, JTAG breakout.
I’ve got as far as having OpenOCD playing along with the ICDI, but I’ve not yet been able to make it work as a JTAG programmer.
Last weekend I was following Zizzle’s excellent guide on using cheap Chinese STM32 based boards with touch screens, which I wrote about myself in ‘STM32 Dev the easy way‘. Some of the examples used Bus Blaster, and showed that it was faster, easier and more flexible than programming via the USB/serial port. I don’t have a Bus Blaster, but I do have a couple of Stellaris Launchpad boards.
The Stellaris Launchpad has a set of holes onboard that will take header pins to break out JTAG. TI provide a guide on their wiki, (superficially) explaining how these can be used. Sadly it’s not entirely clear whether JTAG support is generic, or limited to other TI devices. I hooked up the boards like this:
Zizzle’s examples with the Bus Blaster used Open On-Chip Debugger (OpenOCD) as the software plumbing. Support for TI’s In Circuit Debugging Interface (ICDI) wasn’t present in the version bundled in the VM I was using, but is available in more recent dev builds. I cloned the project from git and set about putting in place the dependencies that I needed to make a new version with ICDI support enabled. This blog post from Scompo traces out similar steps to the ones I took if you’re interested in the detail.
Once OpenOCD was correctly built, and I had the right udev settings to allow use of the USB device without sudo I was able to connect to the Launchpad. The next stage was to modify Zizzle’s config files to use the TI board rather than Bus Blaster:
Zizzle starts OpenOCD with the command line ‘openocd -f jtag/stm_board.cfg’, and the stm_board.cfg looks like this:
telnet_port 4444 gdb_port 3333 gdb_memory_map enable gdb_flash_program enable source [find jtag/busblaster.cfg] source [find target/stm32f1x.cfg]
The busblaster.cfg looks like this:
interface ft2232 ft2232_device_desc "Dual RS232-HS" ft2232_layout jtagkey ft2232_vid_pid 0x0403 0x6010
and I found a corresponding file for the Launchpad that looks like this:
interface hla hla_layout ti-icdi hla_vid_pid 0x1cbe 0x00fd # unused but set to disable warnings adapter_khz 1000
So with a change to the second to last line to reference the ti-icdi.cfg rather than the busblaster.cfg I was all set. Sadly this is what I see when I try to start things up:
Open On-Chip Debugger 0.7.0-dev-00135-g76afade (2013-01-13-08:03) Licensed under GNU GPL v2 For bug reports, read http://openocd.sourceforge.net/doc/doxygen/bugs.html adapter speed: 1000 kHz adapter speed: 1000 kHz adapter_nsrst_delay: 100 Runtime Error: target/stm32f1x.cfg:27: invalid command name "jtag_ntrst_delay" in procedure 'script' at file "embedded:startup.tcl", line 58 at file "jtag/stm_board.cfg", line 8 at file "target/stm32f1x.cfg", line 27
and that’s where I’m presently stuck :(
It would be very nice if the Stellaris Launchpad could be used as a generic JTAG programmer, and all of the pieces seem to be available, they’re just not quite moving together for me yet. It’s quite possible that TI have locked things down so that it isn’t actually possible, which would perhaps be a bit mean of them, but might explain why I’m not just following the steps of somebody more knowledgeable’s howto. I’ll write updates if anything changes.
Filed under: making | 5 Comments
Tags: Bus Blaster, dev board, ICDI, JTAG, launchpad, LM4F120XL, OpenOCD, programmer, Stellaris, STM32, ti