views:

419

answers:

3

Hello,

I'm familiar with X86[-64] architecture & assembly. I want to start develop for an ARM processor. But unlike desktop processors, I don't have an actual ARM processor. I think I need an ARM simulator.

http://www.armtutorial.com/ say

An ARM assembly compiler will be required, the most accessible is the ARMulator.

I thought of downloading Armulator but found from http://forums.arm.com/index.php?showtopic=13744 that

Its not sold seperately. But you can download an eval of RVDS - which includes RVISS/ARMulator

I've downloaded & installed RVDS but It looks very complex. I'm unable to figure out what do I need to do to write ARM assembly & run it.

Do you have any better suggestions?

+3  A: 

You could get yourself something like a BeagleBoard to play with - they only cost around $200. You can install Ubuntu and the ARM toolchain on it.

Paul R
as I said, I can't afford buying any kind of boards. I really mean it. Isn't there any other solution?
claws
+11  A: 

Options for environments

  • Install Linux in the QEMU system emulator. It can emulate a variety of ARM-based chipsets.
  • Get an emulator for a specific ARM-chipset like a game handheld. Gameboy Advance is fun to play with. NoCash GBA and VisualBoy Advance are two great GBA emulators.

Toolchains

You will need a toolchain. A toolchain is a collection of low-level tools like an assembler, a linker, a compiler, an archiver and a bunch of other usefull stuff. Even more, you want a cross-toolchain, which means that the toolchain runs on one system, but builds executables for another architecture. This way you can build applications that run on ARM-devices, but on your x86-based PC. It's faster and more convenient.

If you run Windows, DevkitPro is a fairly good choice. For Unix/Linux/BSD variants, you have CodeSourcery's free toolchains, and the GCC toolchain from gnuarm.com. There are several others, but you don't need more options.

Documentation

Get the specification for your ARM CPU of choice at infocenter.arm.com. One reference you need no matter the CPU is the ARM Architecture Reference Manual (Often abbreviated ARMARM). I'm hosting an older version, which covers the ARM architecture and instruction set version up to ARMv4T, here, but you will find the current and later versions on infocenter.arm.com as well. If you go for GBA, notice that the CPU is an ARM7TDMI, with the instruction set version ARMv4T.

The ARMARM contains tips and examples for usual nitty-gritty system coding, tips on how to proceed on certain design issues, as well as a reference of both the ARM instruction set, Thumb instruction set and co-processors like MMUs, MPUs, DSPs and FPUs.

If you stick with QEMU, that's pretty much all you need, since the Linux kernel handles everything. QEMU also has user-mode emulation (with a C-library stub). If you go for one of the GBA emulators, here's a nice reference over the GBA hardware and hardware registers: CowBiteSpec. Also make sure to check out http://www.gbadev.org/.

Nintendo DS is probably an option as well, but I don't know of any decent emulators for that handheld yet. Good luck to you :-)

EDIT: Here's a trivial example of some GBA code I wrote years ago: GBA Color fill 240x160 16-bit example

Mads Elvheim
No$GBA supports DS too these days. There's also DeSmuME, which is open source and works well for me.
bobince
Excellent answer, pretty darn close to what i would have said. I would add visualboyadvance as a gba emulator. Learn arm first then thumb later. Avoid a cortex-m3 as a first chip (arm first,thumb later). Eventually go to sparkfun.com and look at the armmite pro or one of the many olimex boards. or one of the ti formerly luminarymicro stellaris boards (these are cortex-m3 though, the 811 is easily bricked). Avoid the lpc xpresso and mbed2.
dwelch
@dwelch: Feel free to add stuff to the post if you have additional advice. You got the privilege at the 2000 points mark :-)It should be noted that the questioner said he/she couldn't afford evaluation boards, hence why I only mention emulators. I did indeed mention VBA at the very beginning.
Mads Elvheim
sorry, missed the vba, comment. I am sure you know how it goes, you start with the emulators, then with time you get better and maybe go buy that real gba on ebay or a $30 board here or there. Emulation is a good start but the emulators cheat, I have caught all of them being less trouble than the real thing to get something working on. Sorry for not seeing the vba reference..
dwelch
cool, I didnt know there were special privileges for gaining 2000 points. that is a little scary too, editing other peoples answers.
dwelch
Stack Overflow is a wiki system, and points are calculated based on the percentage of "ownership" of the text and its contributors. So you can edit any answer in good conscience, given it's done in good faith. Just my 2 cents. You can also add new tags to questions.
Mads Elvheim
edits can be rolled back if found necessary.
Thorbjørn Ravn Andersen
+4  A: 

A few comments, not competing for a complete answer to the posters question.

The beagleboard is cool, $150 but it takes another $150 in usb stuff to make it useful. The embest beagleboard is cheaper overall due to the lack of stuff you have to buy to go with it. But now there is the hawkboard, also an omap based board, costs under $100 and so far seems very well done. I am liking it more than the beagleboard at the moment, far less painful.

The open-rd board offers far more than the beagleboard for that price range, something to look into if/when you have a toy budget. both the open board and the enclosed for another $100 have a full sata connector so you can put a laptop drive on it and not have to use painfully slow flash devices or usb.

The poster doesnt have the resources to buy these toys. I would argue that if you continue to pursue this and get good at embedded ARM you will have the will and find the way. Which is why I mention Sparkfun and others have $30-$50 boards that work out of the box. Post a question to stackoverflow before you buy though asking which is better. I have many and there are a number of them I found unusable or too painful to bother with, I wouldnt want you to spend all your toy budget on something that is not worth having.

I have some qemu arm integrator example code laying around here, let me package it up and provide a working example. I have lots of other arm and gba code laying around, maybe I will post that as well.

The ARM architecture started out and last time I worked with their people/tools using an emulator called the armulator (google/wikipedia it). So emulating arm in particular is not uncommon.

Writing your own emulator would/could be a fun project or taking an existing one and adding your own peripherals. qemu and mame are too bulky to play with as-is, you might be able to extract the arm from mame without too much trouble.

EDIT:

A simple arm example for running on qemu:

http://www.dwelch.com/integrator.tar.gz

EDIT2

This is fun, I found that the armulator is out in the public, gdb has a copy skeye and others too, grabbed it, gnawed it down to just an armv4t and wrote a quick arm and thumb test program. Been wanting a standalone arm/thumbulator anyway.

http://www.dwelch.com/armulator-20100421a.tar.gz

dwelch
thanks, for the example
Chintan
No problem, I got frustrated with that armulator and created my own instruction set simulator, thumb only though.http://thumbulator.blogspot.com/I know, I know, I always say learn ARM first then thumb. Oh well..
dwelch