If a software update is published for one or more of the processors in the stack, the user can apply the update by following the instructions on this page. In addition, if the data on P3's SD card becomes corrupted, the card can be returned to factory condition by following the instructions as far as reprogramming P3.
The instructions below walk through reprogramming the stack in reverse order, i.e. P3, P2 then P1. Some updates will require only updating P3; others will require updating P3 then P2, in that order. Updates to P1, if they are required, should be applied last of all.
Software updates will be delivered in the form of a new MDK release. The releases are tagged with a code
YYMMDD, and each release will indicate which parts of the system need to be updated to move to the new release. Releases should not be mixed freely, but can be assumed to be backwards compatible with firmware that is not updated by that release.
You can use any micro-SD card of at least 4GB in size with MIRO; MIRO ships with a suitable card, but you might usefully maintain multiple cards with different configurations.
Before we program the card, we need to choose an options string to pass to the programmer. Concatenate the options below, as required.
Data partition size
By default, the data partition is 2GB. If you have a card larger than 4GB, you can choose a larger size by using the option string
<gigabytes> can be between 2 and 28). The size of paritition that will fit will be 2-4GB smaller than the card itself—start at (size-2GB) and decrease the size until you don't get an error message.
Choose a root password, and use the option string
--pass=<password>. If you do not select a root password, anyone will be able to log in to your MIRO as root and this may pose a significant security risk to your network.
sshpassinstalled and a command line of the form
sshpass -p password ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@IP_ADDRESS.
The usual external interface to MIRO is the wireless network (WiFi) link. The network connection starts automatically when MIRO starts up, and you can then communicate with MIRO's on-board computer through SSH. In order for this to work, MIRO needs your network credentials.
You can program the card with your network credentials at this stage. Use the option string
~/.mdk/wpa_supplicant.confon your workstation; if this file exists, its content will be appended to
wpa_supplicant.confduring card creation. The two approaches to providing credentials are entirely equivalent, except that in a file you can specify as many networks as you like, whereas you can only specify one on the command line.
If you plan to run software, including the ROS master node, on-board MIRO, you can pass the option
--onboard. If, instead, you want your robot to communicate with a ROS master on a remote machine, you need to provide the IP address of that remote machine, using
--masteraddr=<address>. Both options modify the
USER CONFIGURATION section at the top of the file at
~/.profile, so you can easily change these options on a programmed card.
We prefer to run without swap, so that is the default. You can control this when you are programming the system using the option strings
--swap=off (obviously, not both at the same time).
To program the SD card, you will plug it into a card reader attached to your workstation. The card will appear with some physical device name under
/dev, and you need to obtain this device name to proceed.
ls /dev/sd* | grep -v [0-9]at the command prompt before and after plugging in your card reader; your card is the device name that appears. Another way is to run
dmesg | tailafter plugging in the device—the last few lines will indicate the physical device name (something like "sdf", which would correspond to the device
Navigate to the
bin folder in the MDK and proceed as follows to program the card. There is a safety check to reduce the chance of erasing the wrong device—the first time you program a card, you must start with it unplugged, and plug it in only when you are prompted to do so, or programming will not proceed.
You can put the options you chose, above, on the end of your command line, as shown below.
By way of example, the programming line we use here is shown below. NB that your option line will very probably be different!
On subsequent attempts to program the same card, the programming tool will recognise that the card has a MIRO system on it already and the safety check will be skipped (i.e. programming will proceed even if your card is already plugged in when you start the programmer). Please note that this will not protect any data you have stored on the card alongside the MIRO system—this will be erased if you reprogram the card.
Programming will now proceed, with some information along the way to let you know what's happening. If all goes well, the final step will be to unmount the card so that you can remove it from the card reader and plug it back into MIRO.
Update stored image
If you plan to commission multiple MIROs, you can—optionally—make changes to the P3 image files stored in a copy of the MDK and they will then be propagated to any MIROs you program from that copy.
You will find the system overlays stored at
~/mdk/image/P3/rootfs (mounted at
~/mdk/image/P3/home (mounted at
/home). You can safely add files as well as edit files, including making changes that you would usually make through the options passed to the programming tool, listed above. For instance, to add your network credentials at this level, edit the file at
~/mdk/image/P3/rootfs/etc/wpa_supplicant.conf. To add a user, add a home directory to
~/mdk/image/P3/home/<user> and add their details to configuration files in
Login through Debug Port
The image above shows the 3-wirethrough which you can login to P3 as an alternative to logging in through the wireless network. This will not usually be necessary, but may prove helpful if access to the wireless is temporarily unavailable (access is always enabled).
Suitable USB adapters are such as CP2103, CP2104, FT232 (shown above), but any serial port will do; the port speed is 115200bps. A typical login session follows, where the user's adapter has been assigned
/dev/ttyUSB0 by the workstation.
root—if you have set a root password, you will be asked for it.
The updated P3 system includes the firmware image for P2. If this is to be updated also, you should start by updating P3 (above), and then login to P3 as normal, proceeding as follows.
Updates to P1 should not be required. In case they are, your workstation can connect to the UART programming port on the P1 board (UC4) using any available UART port. Remove the shell, and then proceed as follows.
- Connect a USB-to-UART bridge between your workstation and the debug port at UC4:J6, and tie BOOT0 to high. One way to do this is to use a 4-way cable as shown in the image with a CP2103 or similar bridge.
- Power-up MIRO by switching it on underneath. If the programming port is connected correctly, MIRO will not exhibit any behaviour (in particular, the display lights on either wheel arch will remain unlit). If they do light, P1 has not entered programming mode - check that the BOOT0 pin is being held high and cycle the power again.
- Open a terminal on your workstation and change into the
bindirectory of the MDK.
- Change into the sub-directory for your operating system.
- Run the programming tool, as shown below, using the supplied script.
If the programming script is not successful, check the connections between your UART port and UC4.
program_P1.shto suit your local system; edit the script as required. To identify the port under Linux, run
ls /dev/ttyUSB*both before and after you plug in the bridge. To identify the port under Windows, look in Device Manager as you plug in the bridge. P1 will only accept one program per reset, so always cycle MIRO's power before you try programming again. If you get "Permission denied", you can either proceed using
sudoor add your user to the
dialoutgroup and logout/login before trying again.