Updating the firmware

From RobotinoWiki

Manual firmware update

Normally the firmware is updated by a Debian package. However, sometimes it can be necessary to update it manually. The memory of the controller contains a USB bootloader that allows you to replace the firmware. To launch the USB bootloader, use the Arm Debugger and connect to the device. Then check the Enter USB bootloader checkbox and click Reset device. If this is not possible for any reason (like erroneous firmware which causes the controller to hang), turn off the device and turn it on again while pressing both buttons. Make sure that the device is connected via USB.

Once the bootloader has been launched, your OS will report a new removable drive called CRP DISABLD which contains a 496kB file firmware.bin. To update the firmware, just replace this file by a new firmware.bin (don't mind that the new file will probably be significantly smaller than 496kB). If the bootloader is running, both buttons' LEDs are toggled every 200 ms. After 60 seconds of inactivity, the device will be reset automatically and launch the firmware, if present, otherwise the bootloader will be launched again. To reset the device and launch the firmware manually, button 1 (green) must be pressed for more than 10 seconds. If button 2 is also pressed, the bootloader will be launched after reset. As long as button 1 is pressed, the LEDs are toggled every 100 ms.

Update procedure on Windows

The file can be copied easily by drag & drop using the Windows Explorer. After a few seconds the device will be reset and launch the new firmware.

Update procedure on Linux

This is a little more complicated: it is not possible to use the cp command or a graphical file manager because this would lead to a corrupt memory and the firmware would not be able to run correctly. Instead, mcopy from the mtools package must be used. If it is not installed on your system, install it using your distribution's package managament system or build it from the sources. Then follow these steps (assumed that the device node is /dev/sdb. The real name depends on your system; on Robotino it is /dev/robotinoarm_bootloader):

  • If the system has mounted the removable drive, unmount it:
umount /dev/sdb
  • Clear the device's file system:
mdel -i /dev/sdb ::*.*
  • Copy the new firmware to the device:
mcopy -i /dev/sdb firmware.bin ::firmware.bin

After a few seconds the device will be reset and launch the new firmware.

USB Bootloader installation

If you have a pretty 'fresh' device with no piece of software on it, you must install the USB bootloader first. This is only possible via a serial connection using a special tool like Flash Magic. You also need the file Memory.hex which contains the bootloader software. To install the bootloader, follow these steps:

  • Download and install Flash Magic. Launch the tool after successful installation.
  • Set the correct jumpers to have the device entered the bootloader mode and connect the device to your PC with a serial cable.
  • Select Baud Rate '57600' and Interface 'None'.
  • Check Erase all Flash+Code Rd Prot.
  • Enter the path to Memory.hex into the Hex File text edit.
  • Optionally check 'Verify after programming'.
  • Click 'Start' to start the transfer.
  • After successful transfer, reset the jumpers for normal operation mode.
  • Connect the device via USB. Now you should be able install a new firmware.