This procedure also brings your r0ket back into shape in case you “bricked” it or experience other strange software glitches including a damaged file system for l0dables.
Revision | Change |
---|---|
1 | Initial |
2 | Improved Mesh |
3 | Improved r_player l0dable |
4 | Improved fahrplan, mesh, fonts |
5 | Fixed mesh |
6 | Actually pushed the mesh changes, improved game l0dable |
15 | numerous small bugfixes |
mount
/dev/sdb on /media/3355-4B37 type vfat [...]
sudo umount <device that was shown by the 'mount' command above>
sudo umount /dev/sdb
sudo dd if=dataflash.img of=<device that was shown by the 'mount' command above>
sudo dd if=dataflash.img of=/dev/sdb
sync
You're done. Yay!
You're done. Yay!
./flashscript r0ket-firmware-r15
FlashScript UNSAFE (user errors might cause loss of data and corruption)
#!/bin/bash myTmpdir=/tmp/r0ket/$(uuidgen) myCalled="$(pwd)" function ERROR { echo ERROR $@ } function DEBUG { echo DEBUG $@ } function PRINT { echo $@ } function DIE { echo DIED $@ exit 1 } function flashFirmware { myMount="$(diskutil info $(system_profiler SPUSBDataType | grep -A15 "NXP LPC13XX IFLASH" | grep "BSD Name" | awk -F: '{print $2}') | grep "Mount Point" | sed 's/[ ]*.*[ ][ ]//g')/" if [ -z "$myMount" ] || [ ! -d "$myMount" ]; then DIE "Could not flash firmware. Could not find mountpoint $myMount" fi cp -v "$FIRMWAREBIN" "$myMount" sleep 2 sync sleep 2 myroket="/dev/$(system_profiler SPUSBDataType | grep -A15 "NXP LPC13XX IFLASH" | grep "BSD Name" | awk -F: '{print $2}' | sed 's/ //')" PRINT Unmounting the rocket $myroket. Please enter your password: sudo umount "$myroket" return } function flashDataflash { myMount="$(diskutil info $(system_profiler SPUSBDataType | grep -A10 "r0ket" | grep 'BSD Name' | awk -F: '{print $2}' | sed 's/ //' ) | grep "Mount Point" | sed 's/[ ]*.*[ ][ ]//g')" if [ -z "$myMount" ] || [ ! -d "$myMount" ]; then DIE "Could not flash dataflash. Could not find mount $myMount" fi cd "$myMount" pwd cp -v R0KET.CFG NICK.CFG L0NICK.CFG FONT.CFG pubx.key puby.key priv.key $myTmpdir/backup/ cd $myTmpdir sleep 5 #PRINT "Please unmount the roket in the finder. Press the eject button on the newly mounted device. Then press return" #read myroket="/dev/$(system_profiler SPUSBDataType | grep -A10 "r0ket" | grep "BSD Name" | awk -F: '{print $2}' | sed 's/ //')" PRINT Unmounting the rocket $myroket. Please enter your password: sudo umount $myroket PRINT Flashing the rocket. Please enter your password: cd "$myCalled" echo sudo dd if=$FIRMWARE/dataflash.img of=$myroket sudo dd if=$FIRMWARE/dataflash.img of=$myroket sync sleep 3 sudo mount -t msdos $myroket $myTmpdir/mountpoint cd $myTmpdir/backup cp -v * $myTmpdir/mountpoint/ ls pubx.key puby.key priv.key || ( echo "Generating new keys" && cd .. && ./generate-keys && cp -v files/* $myTmpdir/mountpoint/ ) cd /tmp PRINT Unmounting the rocket $myroket. Please enter your password: sudo umount $myroket } function cleanUp { sudo rm -rf /tmp/r0ket/ } function init { mkdir -p $myTmpdir/backup mkdir -p $myTmpdir/mountpoint mkdir -p $myTmpdir/files } function main { init if [ -n "$@" ]; then if [ -e "$@/firmware.bin" ]; then FIRMWARE=$@ FIRMWAREBIN=$@/firmware.bin else DIE $@/firmware.bin seems not to be a firmware fi else DIE expected the path to the directory with the new firmware as parameter fi PRINT "Please turn off your r0ket and connect your r0ket to a USB port." PRINT "Please press the r0ket joystick to the LEFT and turn the rocket on. Then press return" read sleep 10 flashFirmware #PRINT "Please unmount the roket in the finder. Press the eject button on the newly mounted device. Then press return" #read PRINT "Please turn off your r0ket." PRINT "Please press the r0ket joystick DOWNWARDS and turn the rocket on. Then press return" read flashDataflash cleanUp } main $@
If completed the steps above once, you can update your dataflash by copying the files from the 'files' directory in the archive to the mounted dataflash of your r0ket. Do not forget to properly 'eject' or 'unmount' the device or you might loose data!