build
This is an old revision of the document!
Table of Contents
Build environment
0. Work in Progress
In the current project state things might change from time to time. If you actually start developing something for the r0ket now, we'd recommend to join our Mailing List and IRC channel - see contact.
1. Compiler
The CodeSourcery G++ package provides a GNU cross-compiler toolchain for ARM.
- Run installer
chmod +x arm-2011.03-42-arm-none-eabi.bin ./arm-2011.03-42-arm-none-eabi.bin
- On ubuntu, the installer complains that /bin/sh points to /bin/dash and not /bin/bash. Change it like proposed (with 'sudo dpkg-reconfigure -plow dash', “Install as /bin/sh?” → No). You can change it back to dash later, if you like.
- “Minimal” is the appropriate install option, if you don't want to use the CodeSourcery IDE.
- add compiler to your path (eg. ~/.bashrc)
export PATH=$PATH:<pathtocodesourcery>/Sourcery_G++_Lite/bin/
- restart console
Complete console commands for Ubuntu: When installing CordeSourcery chose the proposed Paths. Replace <USERNAME> with your username.
mkdir r0ket cd r0ket wget http://www.codesourcery.com/sgpp/lite/arm/portal/package8736/public/arm-none-eabi/arm-2011.03-42-arm-none-eabi.bin sudo dpkg-reconfigure -plow dash chmod +x arm-2011.03-42-arm-none-eabi.bin ./arm-2011.03-42-arm-none-eabi.bin echo 'export PATH=$PATH:/home/<USERNAME>/CodeSourcery/Sourcery_G++_Lite/bin' >> ~/.bashrc bash
2. Source
The code for r0ket ist based on the (BSD-licensed) microBuilder-library for the LPC1300-family. High-level functions are provided to print and paint on the display, access the filesystem on the dataflash, the 2.4 GHz RF interface, etc.
- Install git
sudo apt-get install git-core
- Clone git repository
git clone git://github.com/r0ket/r0ket.git
3. Build
The source for the actual applications (in opposition to the libraries) resides at 'firmware/applications'. Start from an example or roll your own. APPNAME.c must provide a 'void main_APPNAME(void)' function, which works as the app's main function. The makefile is set up so that you can call 'make APP=APPNAME' to build the firmware image for APPNAME.c. It defaults to 'APP=$USERNAME'
cd firmware vi applications/hello.c
#include <sysinit.h> #include "basic/basic.h" #include "lcd/render.h" void main_hello(void) { DoString(10,20,"Hello World"); lcdDisplay(); while (1) {} }
make APP=hello
4. Deploy
The LPC1343 has a USB-ISP, it can be booted as an USB storage device, and the firmware can be copied as a file. Unfortunately, this only works on Windows. On Linux, the firmware has to be directly written to the device. Additionally, a bug in the ROM causes the CPU to hang for 20 seconds when entering the bootloader. To make development more convenient, the autoflash tool monitors the USB for r0kets in ISP-Mode and automatically flashes the last built firmware. An “ISPAndReset()”-function in the library enables the user to reset the r0ket to ISP-mode and circumvent the 20 second delay.
- Install udev rule
sudo cp tools/bootloader/42-nxp-flash.rules /etc/udev/rules.d/ sudo /etc/init.d/udev restart
- start autoflasher
cd firmware make flash APP=hello
On ubuntu, nautilus will automount the USB-Storage device, and our automouter will not work. Disable the nautilus-automounter:
gconf-editor apps > nautilus > preferences Uncheck the "media_automount" option
- (re)start r0ket in ISP-mode
- Method 1 (up to 30 seconds, but works always)
- Power off r0ket
- Press and hold button “Left”
- Connect r0ket via USB
- Method 2 (fast, works always when a firmware is installed that uses [default])
- Power off r0ket
- Press and hold button “Enter”
- Connect r0ket via USB
- Method 3 (fast, works if installed firmware provides the functionality)
- Connect r0ket via USB
- Select menu option “Invoke ISP” (or similar)
If the r0ket is in ISP-mode, all four LEDs are dimly lit
build.1312145831.txt.gz · Last modified: by sec
