build
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| build [2011/06/21 00:57] – work in progress added ray | build [2013/02/19 14:25] (current) – [4. Deploy] added instructions for manual firmware deployment trapicki | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== 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 ===== | ===== 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|contact]]. | + | 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> | <note tip> | ||
| The CodeSourcery G++ package provides a GNU cross-compiler toolchain for ARM. | 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' | + | * 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', " |
| * " | * " | ||
| </ | </ | ||
| Line 19: | Line 28: | ||
| * 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 32: | Line 76: | ||
| ===== 3. Build ===== | ===== 3. Build ===== | ||
| <note tip> | <note tip> | ||
| - | The source for the actual applications (in opposition to the libraries) resides at ' | + | The source for the actual applications (in opposition to the libraries) resides at ' |
| </ | </ | ||
| Line 44: | Line 88: | ||
| #include " | #include " | ||
| #include " | #include " | ||
| - | #include " | ||
| void main_hello(void) { | void main_hello(void) { | ||
| - | backlightInit(); | ||
| - | font = & | ||
| DoString(10, | DoString(10, | ||
| - | lcdDisplay(0); | + | lcdDisplay(); |
| while (1) {} | while (1) {} | ||
| } | } | ||
| Line 58: | Line 99: | ||
| </ | </ | ||
| + | <note tip> | ||
| + | For FreeBSD | ||
| + | </ | ||
| + | |||
| + | <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 68: | Line 118: | ||
| * start autoflasher | * start autoflasher | ||
| - | * < | + | * < |
| + | cd firmware | ||
| + | make flash APP=hello | ||
| <note important> | <note important> | ||
| - | On ubuntu, nautilus will automount the USB-Storage device, and our automouter | + | On ubuntu, nautilus will automount the USB-Storage device, and our automounter |
| < | < | ||
| gconf-editor | gconf-editor | ||
| Line 80: | Line 133: | ||
| * Method 1 (up to 30 seconds, but works always) | * Method 1 (up to 30 seconds, but works always) | ||
| * Power off r0ket | * Power off r0ket | ||
| - | * Press and hold button " | + | * Press and hold button " |
| * Connect r0ket via USB | * Connect r0ket via USB | ||
| * Method 2 (fast, works always when a firmware is installed that uses [default]) | * Method 2 (fast, works always when a firmware is installed that uses [default]) | ||
| Line 93: | Line 146: | ||
| If the r0ket is in ISP-mode, all four LEDs are dimly lit | 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. | ||
| + | |||
| + | 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... | ||
| + | |||
| + | 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 ../ | ||
| + | |||
| + | If your filesystem is corrupted, you can download http:// | ||
build.1308610659.txt.gz · Last modified: by ray
