build
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| build [2011/06/20 14:18] – iggy | build [2013/02/19 14:25] (current) – [4. Deploy] added instructions for manual firmware deployment trapicki | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | <note warning> | ||
| - | The released source does NOT contain the full firmare of r0ket for the camp. If you build your own version some of the hidden functionality may be lost. If you want to recover to the original state we will provide a flash service on site. | ||
| - | </ | ||
| - | |||
| ====== Build environment ====== | ====== Build environment ====== | ||
| + | <note tip> | ||
| + | See point 5 on how to rebuild a near-original firmware for your r0ket. The original firmware that comes with your badge contains secret keys that you will not find in git. If you reflash your firmware, those will be lost - but that's not as bad as it sounds unless you like properitary stuff. WE RECOMMEND THAT YOU READ POINT 5 BELOW BEFORE YOU REFLASH YOUR FIRMWARE THOUGH. Meanwhile the keys are leaked, so rebuilding an original firmware is possible. Guess we will also check them into git soon... </ | ||
| + | |||
| + | |||
| + | ===== 0. Work in Progress ===== | ||
| + | After all it's r0ket science. If you actually start developing something for the r0ket now, we'd recommend to join our Mailing List and IRC channel - see [[contact|contact]]. | ||
| + | |||
| + | This article explains the setup on a Linux machine. Instructions for Mac OS X are available [[build_mac|here]]. | ||
| ===== 1. Compiler ===== | ===== 1. Compiler ===== | ||
| + | <note tip> | ||
| + | As of November 2012, CodeSourcery got bought by [[http:// | ||
| + | [[mailto: | ||
| + | <note tip> | ||
| + | The CodeSourcery G++ package provides a GNU cross-compiler toolchain for ARM. | ||
| + | </ | ||
| - | * Download [[http:// | + | * Download [[http:// |
| * Run installer | * Run installer | ||
| * < | * < | ||
| ./ | ./ | ||
| + | < | ||
| + | * 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', " | ||
| + | * " | ||
| + | </ | ||
| + | |||
| * add compiler to your path (eg. ~/.bashrc) | * add compiler to your path (eg. ~/.bashrc) | ||
| * < | * < | ||
| + | * restart console | ||
| + | |||
| + | Complete console commands for Ubuntu: | ||
| + | When installing CordeSourcery chose the proposed Paths. | ||
| + | Replace < | ||
| + | |||
| + | < | ||
| + | mkdir r0ket | ||
| + | cd r0ket | ||
| + | wget http:// | ||
| + | sudo dpkg-reconfigure -plow dash | ||
| + | chmod +x arm-2011.03-42-arm-none-eabi.bin | ||
| + | ./ | ||
| + | echo ' | ||
| + | bash | ||
| + | </ | ||
| + | |||
| + | <note tip> | ||
| + | Running on FreeBSD8.2 with gcc4.5.2 | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | cd / | ||
| + | sudo cp -r ./ | ||
| + | cd arm-none-eabi-gcc | ||
| + | vi Makfile | ||
| + | > change line 11 " | ||
| + | > uncommit line 12 " | ||
| + | sudo make install clean | ||
| + | |||
| + | # at me one c-file dont found: " | ||
| + | # fix it in this c-file :"# | ||
| + | </ | ||
| + | |||
| + | Someone asked me to write this down, so [[building_with_a_free_toolchain|here]]' | ||
| ===== 2. Source ===== | ===== 2. Source ===== | ||
| Line 25: | Line 75: | ||
| ===== 3. Build ===== | ===== 3. Build ===== | ||
| - | * < | + | <note tip> |
| - | make</ | + | The source for the actual applications (in opposition to the libraries) resides at ' |
| + | </ | ||
| + | |||
| + | < | ||
| + | cd firmware | ||
| + | vi applications/ | ||
| + | </ | ||
| + | |||
| + | <code c> | ||
| + | #include < | ||
| + | #include " | ||
| + | #include " | ||
| + | void main_hello(void) { | ||
| + | DoString(10, | ||
| + | lcdDisplay(); | ||
| + | while (1) {} | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | make APP=hello | ||
| + | </code> | ||
| + | |||
| + | <note tip> | ||
| + | For FreeBSD | ||
| + | </note> | ||
| + | <code bash> | ||
| + | gmake APP=hello | ||
| + | </ | ||
| ===== 4. Deploy ===== | ===== 4. Deploy ===== | ||
| <note tip> | <note tip> | ||
| - | 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, | + | 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, |
| </ | </ | ||
| + | |||
| + | ==== automatic ===== | ||
| * Install udev rule | * Install udev rule | ||
| Line 38: | Line 118: | ||
| * start autoflasher | * start autoflasher | ||
| - | * < | + | * < |
| - | ../ | + | cd firmware |
| + | make flash APP=hello </ | ||
| + | |||
| + | <note important> | ||
| + | On ubuntu, nautilus will automount the USB-Storage device, and our automounter will not work. Disable the nautilus-automounter: | ||
| + | < | ||
| + | gconf-editor | ||
| + | apps > nautilus > preferences | ||
| + | Uncheck the " | ||
| + | </ | ||
| + | </ | ||
| + | * (re)start r0ket in ISP-mode | ||
| + | * Method 1 (up to 30 seconds, but works always) | ||
| + | * Power off r0ket | ||
| + | * Press and hold button " | ||
| + | * Connect r0ket via USB | ||
| + | * Method 2 (fast, works always when a firmware is installed that uses [default]) | ||
| + | * Power off r0ket | ||
| + | * Press and hold button " | ||
| + | * Connect r0ket via USB | ||
| + | * Method 3 (fast, works if installed firmware provides the functionality) | ||
| + | * Connect r0ket via USB | ||
| + | * Select menu option " | ||
| + | |||
| + | < | ||
| + | If the r0ket is in ISP-mode, all four LEDs are dimly lit | ||
| + | </ | ||
| + | |||
| + | ==== manual ==== | ||
| + | |||
| + | Due to some incompatibility in the Linux vfat driver, just mounting and copying the firmware does not work. The firmware has to be dd'ed to the r0ket: | ||
| + | - connect r0ket in ISP mode | ||
| + | - make sure that the device is not mounted | ||
| + | - dd if=firmware.bin of=/ | ||
| + | |||
| + | The right device is 34 kiByte in size. | ||
| + | ===== 5. Building the original Firmware ===== | ||
| + | To rebuild the original firmware you can use the release-all script in firmware/. It will build the firmware and all additional programs and put them into /release. You have to copy SECRETS to SECRETS.release first. | ||
| + | |||
| + | Note: the SECRETS in the git contain different keys than those you had on your badge originally. That way the original firmware can only execute l0dables signed by the vendor (us!!), which makes it at least as cool as an iBadge. So if you reflash your badge you will lose this " | ||
| + | |||
| + | After running the release-all script, copy the release/ | ||
| + | < | ||
| + | firmware/ | ||
| + | firmware/ | ||
| + | firmware/ | ||
| + | firmware/ | ||
| + | </ | ||
| + | |||
| + | If you get some message the firmware is too large, it might be an accident in our source, but more probably you were using a different compiler than exactly the version we used. | ||
| - | * Method 1 | + | Now hold joystick to the left and power on, release joystick after a second or so. LEDs will light dim, after about 20 seconds the autoflasher should tell you flashed sdX... |
| - | * Power off r0ket | + | |
| - | * Press and hold button X | + | |
| - | * Connect r0ket via USB | + | |
| - | * Method 2 | + | Then start your badge holding joystick down (not press center but down), that starts the USB massstorage. Mount it (should be a 512K volume). Erase all files (except your own ones, like received stuff from others if you have that) and/or copy the files from ../ |
| - | * Connect r0ket via USB | + | |
| - | * Select menu option | + | |
| + | If your filesystem is corrupted, you can download http:// | ||
build.1308572299.txt.gz · Last modified: by iggy
