I recently decided to embark on writing my own C++ real-time operating system for embedded systems – I’ve so far made some progress using software emulation with QEMU but I feel it’s time to move on to real hardware. I’ve chosen to use the very popular BeagleBoard XM – mostly because it represents incredible value for money given but also due to it’s extensive user community.
This blog post provides an overview of the components required to get started with a BeagleBoard XM and JTAG emulator. I will also include my experience/rationale in selecting and buying the various components required (Board, JTAG Emulator, etc).
Hardware – BeagleBoard XM
There are two variants of the BeagleBoard – they are the original ‘BeagleBoard’ and the newer ‘BeagleBoard XM’. The XM is very similar to the original but has a DM3730 SOC instead of the slower OMAP3530, it has twice the RAM and a real serial connector instead of header pins. However the XM doesn’t have any flash memory – but that’s OK as it can boot from the boards’ MMC device. The full differences can be found in section 2.2.1 in the helpful System Reference Manual. The recommend price for the XM at the time of writing this article was $149 – that’s just $24 more than the original board.
Unfortunately UK distributors always report that they are out of stock, show large lead times and after postage and package cost much more than the recommended price. I bought my board from Farnell – with postage and packaging it cost £144 – I waited until they showed that they had stock before ordering. Once ordered it arrived incredibly quick.
Don’t expect for any cables, power supply, instruction manual or CDs to arrive with your board – to keep costs down these haven’t been included. Though you will get a micro SD card and an MMC->microSD converter card with your XM. In order to do something useful with your board you are likely to need to buy more components – I acquired the following additional components:
- USB to Serial adapter/cable (you will need more components in this area if using the original BeagbleBoard)
- USB A to mini-B cable – I’m using this to power the board but you may instead need a 5V power supply if you’re intending to utilise the XM for more power hungry applications
In terms of hardware this is probably the bare minimum – assuming your PC has USB ports and an MMC slot. An Ethernet lead may also be useful and so may a HDMI cable – but I have no use for these just yet.
Hardware – JTAG Emulator
I intend to work at the bare-metal level with this board and write my own boot loader (aka MLO file in Davinci speak) – with this in mind it seemed essential to be able to see what’s going on with a JTAG. There are lots of JTAG emulators around that could be used with this board – this elinux.org article provides a good starting point.
Once again – price is an overriding factor. JTAG emulator’s can cost anywhere from less than a hundred pounds to thousands of pounds (including software licenses), but to some extent you get what you pay for. Though even the cheapest emulators will allow you to step through source (probably slowly), look at the processor’s registers and view/modify RAM. When considering price – it seemed like I was left between TinCanTool’s FlySwatter (at $49.95 though additional components would be required) and one of Spectrum Digital’s XDS emulators (e.g. XDS100v2 at $89). All the other emulators cost much much more or didn’t even list a price.
The FlySwatter seemed very attractive – besides price it provides a GDB remote interface meaning that you can connect to the JTAG device and debug programs using the very familiar GDB. Though if you prefer a nice UI – you can also utilise OpenOCD. I was already using GDB to debug my OS with QEMU so this seemed like a natural next step. However the JTAG pinout of the FlySwatter is different to that found on the board. JTAG connectors for TI boards can come in many different pin outs – not only may the connector be a different size (e.g. 14 or 20 pin) but the functions of those pin’s may be different (mostly due to ARM and TI having their own standard layouts) – furthermore those pins may use different voltages (1.8v or 3.3v). This means that if you’re not careful – you can plug in a cable that fits the connector and cause some damage to your board. So the best advice is to be very careful and check your manuals. The FlySwatter can be used with the BeagleBoard – but you would need to buy an adapter board (TinCanTool’s sells one for $19)
I ended up buying the XDS100v2 JTAG emulator for £81.59 from Farnell – it’s small, simple, has the correct connector and I have a vague memory of using one in the past. Also the FlySwatter was out of stock in all UK distributors and I just couldn’t wait. The XDS isn’t as open as many would like – you need to obtain a free license from TI in order to use it with their own Eclipse based software known as Code Composer Studio (CCS). Though I think it works very well and am more than happy to use it.
So if you’ve already got a BeagleBoard XM, an XDS100v2 and all the necessary cables we’re ready to set up our software environment – we’ll explore this in the next blog post. [© 2011 embedded-bits.co.uk]