21

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?

claws
  • 52,236
  • 58
  • 146
  • 195
  • 1
    The ARM System Developer's Guide is a great book. I have it on my desk at all times. If you're still stuck after getting answers, feel free to visit more of us ARM-lovers on IRC. ##arm on FreeNode. –  Apr 16 '10 at 10:10

4 Answers4

23

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

  • No$GBA supports DS too these days. There's also DeSmuME, which is open source and works well for me. – bobince Apr 16 '10 at 11:22
  • 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. – old_timer Apr 16 '10 at 17:56
  • @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. –  Apr 17 '10 at 05:55
  • 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.. – old_timer Apr 18 '10 at 00:10
  • cool, I didnt know there were special privileges for gaining 2000 points. that is a little scary too, editing other peoples answers. – old_timer Apr 18 '10 at 00:14
  • 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. –  Apr 18 '10 at 01:35
  • edits can be rolled back if found necessary. – Thorbjørn Ravn Andersen Apr 24 '10 at 06:59
7

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.

old_timer
  • 69,149
  • 8
  • 89
  • 168
4

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
  • 208,748
  • 37
  • 389
  • 560
  • as I said, I can't afford buying any kind of boards. I really mean it. Isn't there any other solution? – claws Apr 16 '10 at 07:35
  • Have you used the Raspberry Pi (1 or 2)? If so, how do you like it compared to the BeagleBoard? – Z boson Jun 25 '15 at 10:58
  • @Zboson: if that question is addressed to me then no, I haven't actually played with the BeagleBoard or the Raspberry Pi. I bought an [Efika MX](http://genesi.company/products/efika) a few years ago so that I could play with Neon SIMD, but performance was somewhat disappointing. – Paul R Jun 25 '15 at 11:12
  • How have you learned Neon then? – Z boson Jun 25 '15 at 11:14
  • Well I learned enough to do some benchmarking - I implemented some filters etc, both using intrinsics and raw assembly. At that time gcc's code generation was pretty poor for Neon, so raw assembly was actually worthwhile (2x faster than intrinsics IIRC). Apparently gcc has improved in this area recently though. – Paul R Jun 25 '15 at 11:17
  • What hardware do you use now for Neon? – Z boson Jun 25 '15 at 11:30
  • I don't really, apart answering the occasional question here on SO. I still have the above-mentioned Efika MX, and I boot it up occasionally, but most of the work I do these days is on x86. – Paul R Jun 25 '15 at 11:41
-1

Go get one RPi3 for you. You can check https://www.element14.com/community/community/raspberry-pi.

This is really cheap and very simple to use. And you well get great community support as well. Check https://www.raspberrypi.org/products/raspberry-pi-3-model-b/ for more information.

LinuxStuff
  • 71
  • 7