User Tools

Site Tools


build

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
build [2011/08/13 12:25]
pony_tail [3. Build]
build [2013/02/19 14:25] (current)
trapicki [4. Deploy] added instructions for manual firmware deployment
Line 1: Line 1:
 ====== Build environment ====== ====== Build environment ======
 <note tip> <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. ​+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... </​note>​ 
  
-ALSO: current git doesn'​t build working firmware (too large). We are checking that right now. Check out older release currently! 
-</​note>​ 
 ===== 0. Work in Progress ===== ===== 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]]. ​ 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]]. ​
Line 11: Line 10:
  
 ===== 1. Compiler ===== ===== 1. Compiler =====
 +<note tip>
 +As of November 2012, CodeSourcery got bought by [[http://​www.mentor.com/​embedded-software/​codesourcery|Mentor Graphics]]. The old "​Sourcery G++ Lite" is now [[http://​www.mentor.com/​embedded-software/​sourcery-tools/​sourcery-codebench/​editions/​lite-edition/​|Sourcery CodeBench Lite Edition]]. The links in this page to the old toolchain don't work; if it's legal, I could upload my copy of arm-2011.03-42-arm-none-eabi.bin somewhere for everybody to download. Otherwise, you could try to register on mentor.com ​ and download the freely available [[http://​www.mentor.com/​embedded-software/​sourcery-tools/​sourcery-codebench/​editions/​lite-edition/​arm-eabi/​|Sourcery CodeBench Lite Edition (EABI Release)]] and see if the old installation instructions still make sense.\\
 +[[mailto:​bruno@anche.no|White_Rabbit]] </​note>​
 <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.
Line 57: Line 59:
  
 # at me one c-file dont found: "​sys/​sysctl.h"​ # at me one c-file dont found: "​sys/​sysctl.h"​
-change ​in this c-file ​the entry "#​include <​sys/​sysctl.h>"​ to "#​include '/​usr/​include/​sys/​sysctl.h'"​+fix it in this c-file ​:"#​include <​sys/​sysctl.h>"​ to "#​include '/​usr/​include/​sys/​sysctl.h'"​
 </​code>​ </​code>​
 +
 +Someone asked me to write this down, so [[building_with_a_free_toolchain|here]]'​s how I built the firmware with stock binutils, gcc, newlib and gdb.
 +
 ===== 2. Source ===== ===== 2. Source =====
 <note tip> <note tip>
Line 103: Line 108:
 ===== 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,​ 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.+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, see [[#​manual|below]]. 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.
 </​note>​ </​note>​
 +
 +==== automatic =====
  
   * Install udev rule   * Install udev rule
Line 116: Line 123:
  
 <note important>​ <note important>​
-On ubuntu, nautilus will automount the USB-Storage device, and our automouter ​will not work. Disable the nautilus-automounter:​+On ubuntu, nautilus will automount the USB-Storage device, and our automounter ​will not work. Disable the nautilus-automounter:​
 <​code>​ <​code>​
 gconf-editor gconf-editor
Line 140: Line 147:
 </​note>​ </​note>​
  
 +==== 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=/​dev/<​devicename>​ bs=1024 skip=2
 +
 +The right device is 34 kiByte in size.
 ===== 5. Building the original Firmware ===== ===== 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. 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.
Line 152: Line 167:
 firmware/​$>​ ../​tools/​bootloader/​autoflash firmware/​$>​ ../​tools/​bootloader/​autoflash
 </​code>​ </​code>​
 +
 +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... ​ 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... ​
build.1313231106.txt.gz · Last modified: 2011/08/13 12:25 by pony_tail