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.
This article explains the setup on a Linux machine. Instructions for Mac OS X are available here.
chmod +x arm-2011.03-42-arm-none-eabi.bin ./arm-2011.03-42-arm-none-eabi.bin
export PATH=$PATH:<pathtocodesourcery>/Sourcery_G++_Lite/bin/
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
cd /usr/ports/devel/ sudo cp -r ./arm-rtms-gcc ./arm-none-eabi-gcc cd arm-none-eabi-gcc vi Makfile > change line 11 "TGTABI = rtems" to "TGTABI = none-eabi" > uncommit line 12 "WITH_RTEMS_PATCHES= yes" sudo make install clean # at me one c-file dont found: "sys/sysctl.h" # fix it in this c-file :"#include <sys/sysctl.h>" to "#include '/usr/include/sys/sysctl.h'"
Someone asked me to write this down, so here's how I built the firmware with stock binutils, gcc, newlib and gdb.
sudo apt-get install git-core
git clone git://github.com/r0ket/r0ket.git
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
gmake APP=hello
sudo cp tools/bootloader/42-nxp-flash.rules /etc/udev/rules.d/ sudo /etc/init.d/udev restart
cd firmware make flash APP=hello
gconf-editor apps > nautilus > preferences Uncheck the "media_automount" option
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:
The right device is 34 kiByte in size.
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 “feature” forever. Also you will leave the mesh of sheeps and enter the mesh of hackers, as the keys are different. Don't trust the INVADERS highscore on the hackers mesh though. Finally openAMD will stop encrypting messages - so if you have tracking enabled people can sniff and fake your ID. And of course you can always try to break the read protection of a working badge and extract its crypto keys and release them on wikileaks. We'd love to see that. But wait for day 2 with that so we can see the mesh working before for some time…
After running the release-all script, copy the release/final.bin to firmware/firmware.bin and flash it using autoflasher:
firmware/$> cp SECRETS SECRETS.release firmware/$> ./release-all firmware/$> cp ../release/final.bin firmware.bin firmware/$> ../tools/bootloader/autoflash
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 ../release/files/ onto the bage. The new .c0d files are now signed with the git-“SECRETS” and therefore will run again on your firmware, as well as you'll be able to run l0dables others built using the same keys.
If your filesystem is corrupted, you can download http://y.nu/r0ket-df.dd and dd it onto the device before mounting it. Or you can flash the initial.bin created by the above process before flashing final.bin, starting initial.bin format the dataflash and starts massstorage.