In my last blog post I described my rationale for buying a BeagleBoard XM and a compatible JTAG emulator – the XDS100v2. This post follows on from that and describes the steps required for setting up TI’s Code Composer Studio such that you can use the XDS100v2 with the BeagleBoard XM to find out what the board is doing.
The XDS100v2 probably works best with the Code Composer Studio (CCS) software – so the first step is to download and install it. There are a number of versions of CCS that can be used – but the general advice is to use version 4.2.3.00004 for 32 bit Windows. There is a newer version but this seems like a work in progress and it’s probably best to not ‘go against the grain’. I’ve not seen much evidence that CCS with the XDS works under Linux. As a result of this it’s quite likely that you’ll end up wanting both a Windows and Linux installation – I use Linux natively and run Windows in a VirtualBox OSE virtual machine – it seems to serve my purposes.
The latest versions of Code Composer Studio can be found here – I downloaded and installed the massive 1.1GB DVD image which is described as the ‘Latest production DVD image‘. However in order to access the download you need to fill out a ‘U.S. Government export approval’ online form and to access this you will need to sign in with a TI.com account. Whilst it’s a pain – the entire process can be completed within 10 minutes and doesn’t cost a penny – the slow part is waiting for the download to complete.
The downloaded image is in fact just a ZIP file with an EXE inside – I executed this and installed the ‘Custom’ version – removing support for items I didn’t intend to use such as ‘Code Generation’ and ‘Target Content’ – but if you have the disk space then installing everything will do no harm. If you haven’t deselected it – the installer will also conveniently install the USB drivers for your XDS100v2 emulator.
Once installed, execute the ‘Code Composer Studio v4′ desktop shortcut – if you’re not familiar with Eclipse it will start by asking you where you want your workspace to live. The workspace is just an area for your projects – I usually check the ‘set as default’ checkbox and click OK. The first time you start CCS it will detect that the software is unlicensed and bring up a dialog box – fortunately it is possible to obtain a free license for use with the XDS100v2. You can select the ‘Activate a License’ option and follow the prompts to generate a free license from TI. Once again you will need to use your TI.com account and agree to some more terms. If you do everything correctly you’ll end up with a ‘.lic’ file emailed to you – all you need to do is use the licensing dialog box to point to the location of your license file. Finally all the hassle is out of the way. There is more information on the installation and license process on this page of the TI wiki.
The next step is to set up CCS to make use of your XDS100v2 for the BeagleBoard XM. The following steps describe this process – but they are limited to providing basic access to the board – i.e. you will not be able to download programs into RAM and run them, but will be able to view processor registers, display RAM and step through source.
1. You first need to create a Target Configuration File which will describe the target you intend to connect to. You can do this by clicking File | New | Target Configuration File. Type in a suitable file name and click Finish. At this point you will see an editor allowing you to specify which device and emulator you wish to use. You may also notice that the BeagleBoard is not present in this list. To get around this I utilised an existing configuration found on the TI Forums here. Click on the ‘Source‘ tab and copy the contents of this file into the editor. Click Save and you’re done.
2. Connect the JTAG emulator to the board and the emulator to your PC. If you are using a virtual machine for CCS you must also give it access to your USB device – use the Devices | USB Devices menu in VirtualBox. If all goes to plan, Windows should detect and find suitable drivers for the XDS.
3. In order to launch your new target configuration click Target | Launch TI Debugger. If you have multiple target configurations you may need to use the View | Target Configurations menu to specify which one to use (Right click on the file and click ‘Launch Selected Configuration‘).
4. Turn on your BeagleBoard and then click Target | Connect Target. Wait a little while and you will see in the ‘Debug‘ window that you are connected. Use the ‘View‘ menu to view Memory, Registers and disassembly and the controls in the ‘Debug‘ window to start, stop, reset, step, etc.
You should now be able to connect to your board and find out what’s going on. With a little more work you should be able to perform source level debugging and download and run programs straight from CCS.
In my next post I will describe how to write some bare metal code that can be installed on the MMC card (as an MLO file) which will get executed as soon as the processor comes out of reset. We’ll also use CCS to demonstrate that it is correctly running. [© 2011 embedded-bits.co.uk]