A picture of Blaise Gassend
The XDS510 Simulator

Introduction

Texas Instruments has some pretty cool DSPs. But programming many of them requires TI's XDS510 JTAG interface, that TI unfortunately sells for a horrendous (for a hobbyist) price. I have written an extension to Wine that enables TI's programming tools to function by using a software-simulated XDS510, and a trivial parallel interface. I have tested this system with the TMS320F241, but it should work with many other models, as long as the same XDS510 features that are used by the programming software are those that I have implemented. If you want to program an XDS510 cheaply, this is the thing for you. If Wine is a problem for you, the code that I have written can be adapted to TI's software in other ways. Don't hesitate to ask me for more information.

Another option may be to buy an imitation XDS510 such as the one sold here. I haven't tried it and would love to hear any feedback about it.

Other options

Thanks to Ben Apopei for pointing out two other ways to get an XDS510. First, if you are working for a university, TI has a university program that may be able to get an XDS510 given to you. Alternatively, you can go on eBay and get one for only a few hundred dollars.

You don't have Linux or Wine, you just want to try something quick from Windows.

You can use the code that I provided to hack into the DLLs in another way. Check out the Technical details section. Some people have already done this (many thanks to them!), here is what they have produced.

Guillaume Zin's modified Dosbox

Guillaume Zin has patched Dosbox using my code. You can download precompiled binaries and source for this work. I haven't tried this myself, but according to Guillaume, you just need to run DosBox, and then use TI's programming tools (see What You Will Need section below) from the resulting DOS window.

Lorenzo Lutti's

You can also try out Lorenzo Lutti's Windows port that is described in this readme file.

What you will need

  • A runnning Linux installation.
  • Wine: I used release 20000430, but it no longer seems to be available so you will have to do a little patching by hand.
  • The wine patch that I wrote.
  • A simple, easy to make at home, JTAG interface such as those provided by Lattice. See Appendix A of the LatticePro application note.
  • The JTAG programing tools that TI provides for free Prg2xx (the internal version, not parallel port or serial port). You will probably have to change the case of some file names since wine looks for its DLLs in a case sensitive way. The tools for the 2000 family are here, but they keep changin the link, so it is often broken. You can search for prg2xx to find their new location if the link is broken (and please email me the new link so I can update the page). I have only experimented with Prg2xx for the TMS320F241.

Prepatched version of wine

You can directly download a prepatched version of wine. It works fine for XDS510 programming, but it is rather old (2001), so you probably don't want to do anything else with it. With this you can start from step 5 in the patching wine section.

Please tell me if you have trouble compiling this source code. This is a new part of this website.

Patching wine

  1. Untar the Wine archive.
  2. Untar my archive in Wine's the msdos directory. This adds the files that actually do the real work.
  3. Now you have tell Wine about my files by modifying ioports.c in Wine's msdos directory. The following changes have to be made:
  • Add #include "hds510.h" at the top of the file.
  • Add XDS510_init(); in the last line of the IO_port_init function.
  • Change the default case in IO_inport to:
 if ((port >= XDS510(0x00) && port < XDS510(0x20)) ||
     (port >= XDS510(0x400) && port < XDS510(0x410)) ||
      port == XDS510(0x800))
 {
   res = XDS510_read(port - XDS510_BASE);
 }
 else
 {
   printf("Direct I/O read attempted from port %x\n", port);
   WARN("Direct I/O read attempted from port %x\n", port);
   res = 0xffffffff;
 }
 break;
  • Change the default case in IO_outport to:
 if ((port >= XDS510(0x00) && port < XDS510(0x20)) ||
     (port >= XDS510(0x400) && port < XDS510(0x410)) ||
      port == XDS510(0x800))
 {
   XDS510_write(port - XDS510_BASE, value);
 }
 else
 {
   printf("Direct I/O write attempted to port %x\n", port );
   WARN("Direct I/O write attempted to port %x\n", port );
 }
 break;
  1. Add xds510.c and xds510_io.c in C_SRCS in the Makefile.in of Wine's msdos directory.
  2. Modify xds510.c so that the address of your parallel port is in PAR_ADDR. You can also change the base address of the simulated xds510 in xds510.h.
  3. Run configure and make.
  4. If you want to install Wine, run make install. You can also choose not to install it, but in that case, you have to make sure that the winelibthat is being used is the one you just compiled.
  5. Install TI's tools and run them with Wine. You will need to configure wine so that it can write to the parallel port. You might have to rename the DLLs that come with the TI software so that the case is the way Wine wants it.

Using it

If all goes well, you should now be able to use TI's software with wine. If it doesn't work I would love to have some feedback to try to help you get it working.

Technical details

The simulator is quite straightforward. It intercepts ins and outs to the ports that the xds510 occupies in ioports.c. Then it interprets them in xds510.c and genereates JTAG signals that are sent to the parallel port in xds510_io.c.

The xds510 is built with the SN74ACT8990, a documented chip from TI. You can read about it (if this link fails search for Test bus controller on www.ti.com). You will find that I only implemented a subset ofthe xds510 functionality.

If you want to avoid Linux and Wine, you can intercept the ins and outs that the TI software makes by patching TI's SMG510W.DLL. There are just two simple functions in which IO is performed. If you can intercept them and get my code called from them, then you can use my simulator in Windows. Have fun, and tell me about your successes or failures!