User Tools

Site Tools


simulat0r

This is an old revision of the document!


Simulat0r

The simulat0r allows you to develop and test applications for the r0ket even without having the actual hardware

1. What is it?

The simulat0r basically is a set of headerfiles and some C code which enables you to compile r0ket applications on x86 machines and run them using a qt GUI frontend. Currently only the LEDs, display and input button are supported, but that should be enough to develop simple games, a cool nickname-scroller firmware or similar stuff.

2. Installation

Start in the build section and at least clone the git repository. We also recommend installing the ARM compiler - even though not needed for the simulat0r it helps you check if your code will at least compile for the real r0ket and code/memory sizes fit.

You will also need the qt4-devel package of your distribution including cmake. We have successfully built the simulat0r on Fedora and Debian Linux as well as on FreeBSD.

3. Try it out

After installation go to the simulat0r directory and built one of the sample applications:

r0ket/$ cd simulat0r
simulat0r/$ make APP=spaceinvaders

If all needed libs are installed, the built should succeed and result in an executable, start it:

simulat0r/$ gui/build/qsimulat0r

and you should see a X window showing the display and the 4 LEDs in the corners.

The 5-way button is emulated using the cursor keys+space or 84562 on your number pad

4. Start your own project

The easiest way to start your own application is to use a sample as template. Even when developing in the simulat0r you should do this in the normal firmware/applications directory, so you can easily also compile it for the target platform from time to time. After copying the source you have to execute a shell-script to create an include-stub in the simulat0r-tree.

r0ket/$ cp firmware/applications/spaceinvaders.c firmware/applications/coolapp.c
r0ket/$ simulat0r/bin/update-bridge-files.sh

5. Developing

Now your normal cycle would be to edit the source in r0ket/firmware/applications/ and build the simulat0r. As said, from time to time you also should do a “normal” build in the standard firmare:

r0ket/$ cd firmware
firmware/$ make APP=coolapp

to check if everything at least compiles.

Please always keep in mind: the x86 platform of the simulat0r is much more powerful than the real target device. You have to be very strict in your memory usage and also don't have a full blown C library at your hands. Also not all types are available.

One advantage of this is that you can easily add debug output to stdout/err and even write logfiles from within your simulat0r application. Please put #ifdef SIMULATOR blocks around such code so it doesn't get included in the target build. On the other had, if you for some reason need to include ARM assembler code, put #ifdef ARM around it (and possible replacement code like putstr(“would do … here\n”) in the correspodning #else part). Also keep in mind: your PC most probably is much faster than the r0ket (which can't pass the speed of light for legal reasons), so timing most probably will be different. Use delayms() to get predictable timing for animations etc.

8. Ideas for projects

We don't want to limit your creativity, so surprise us. The current simulat0r mainly supports the development of display-centric applications like games and demos, so things like Tetris or a Blinkenlights viewer should be possible (and as far as I know nobody started those yet. Let us know if you do…).

An don't worry - even if you start now there will be enough to code at the Camp, like make your game interact over RF with a second r0ket…

7. Questions

If you have any questions regarding development you are welcome to visit our IRC channel, see the contact page.

Please also contact us if you are building a cool application you would like to be part of the official firmware or at least have it included in our repository.

simulat0r.1311132742.txt.gz · Last modified: 2011/07/20 05:32 by ray