Flashing mLinux Firmware

NOTE: This section describes upgrading mLinux™ locally on your device and is intended for experts with the appropriate technical knowledge.  (Otherwise, use the alternative method Upgrading mLInux.)

Refer to the Downloads page for applicable pre-built images. 

The following procedure generally only applies to the MTCDT-xx-210L model but can be used to convert a MTCDT-xx-210A model to MTCDT-xx-210L.

For devices with the Supercap Feature, the device will not flash firmware if the power is out, and delay flashing the firmware if supercap is not sufficiently charged. (See Supercap Feature for more details.)

All downloads are available from the Downloads page.

View the Current Firmware Version

$ cat /etc/mlinux-version

 

Using Auto-Flash During Reboot (Recommended)

During the boot process, the device checks for a file named /var/volatile/do_flash_upgrade which indicates if it should attempt to flash itself. (NOTE: This file must be owned by root.  If /var/volatile/do_flash_upgrade exists, it will look for the upgrade files in two locations: /var/volatile/flash-upgrade and /media/card/flash-upgrade and then flash itself.

Summary

  • Copy kernel and rootfs to the newly created directory /var/volatile/flash-upgrade:
    mkdir /var/volatile/flash-upgrade
    cp <uImage path here> /var/volatile/flash-upgrade/uImage.bin
    cp <rootfs path here> /var/volatile/flash-upgrade/rootfs.jffs2OR ensure the sd card is formatted as follows:
    /media/card/flash-upgrade/uImage.bin
    /media/card/flash-upgrade/rootfs.jffs2
  • For mLinux 3.x, do the following commands:
    • Run touch /var/volatile/do_flash_upgrade
    • Run reboot
  • For mLinux 4 or higher, do the following command:
    • Run sudo touch /var/volatile/do_flash_upgrade
    • Run sudo reboot

 

The file names must match above exactly and are case-sensitive.

Detailed Steps

  1. Obtain the required update files from the downloads page. (You can also find these files in your current build of mLinux in the built/tmp/deploy/images directory.) Refer to the Conduit: mLinux Mode, Other Downloads, and click on Pre-Built Images. Select your hardware (currently MTCAP or MTCDT).
  2. Select the version you want to use.
  3. Then download the jffs2 file desired (base or factory image) and uImage file. For example:
    mlinux-factory-image-mtcdt-20150527081222.rootfs.jffs2
    uImage--3.12.27-r11.2-mtcdt-20150527052826.bin
  4. On your PC, rename the new firmware files like this:
    mlinux-factory-image-mtcdt-20150527081222.rootfs.jffs2rootfs.jffs2
    uImage--3.12.27-r11.2-mtcdt-20150527052826.binuImage.bin
  5. Connect the Conduit to your PC via an ethernet cable and ssh into it.
  6. On the Conduit, first create the destination directory:
    mkdir /var/volatile/flash-upgrade
  7. Copy the files to the device. If using Windows, you’ll need a tool like WinSCP or SCP in Cygwin.
    Using SCP on your PC:
    scp uImage.bin root@192.168.2.1:/var/volatile/flash-upgrade/uImage.bin
    scp rootfs.jffs2 root@192.168.2.1:/var/volatile/flash-upgrade/rootfs.jffs2
  8. After transferring the files, on the Conduit run:
    • For mLinux 3.x:
      • Run touch /var/volatile/do_flash_upgrade
      • Run reboot
    • For mLinux 4 or higher:
      • Run sudo touch /var/volatile/do_flash_upgrade
      • Run sudo reboot

During flashing, programmable LEDs will blink in a progression pattern.

Note: If you want to copy uImage.bin and rootfs.jffs2 into the tmpfs mounted at /var/volatile, first verify that there is enough space to fit the images in memory. If you flash a larger image and have an SD card inserted, copy the images into /media/card instead.

Using Auto-Flash During Reboot with image upgrade.bin

The Auto-Flash During Reboot can also be performed with an upgrade file. This process allows a system to be converted from mPower™ to mLinux or vice versa.

Summary

  • Besure to download an image compatible with the hardware type MTCDT and MTCAP have different image files
  • For mLinux download the factory or base image for MTCDT or MTCAP
  • Download an mlinux-*-upgrade.bin or conduit_AEP-X.X.X_upgrade.bin file from Downloads
  • Create a directory on the Conduit to receive the file
    mkdir /var/volatile/flash-upgrade
  • Copy the upgrade file, renaming as upgrade.bin, to the newly created directory /var/volatile/flash-upgrade:
    cp <uImage path here> /var/volatile/flash-upgrade/upgrade.bin
  • After transferring the files, on the Conduit run:
    • For mLinux 3.x:
      • Run touch /var/volatile/do_flash_upgrade
      • Run reboot
    • For mLinux 4 or higher:
      • Run sudo touch /var/volatile/do_flash_upgrade
      • Run sudo reboot

 

Convert to mPower

  1. Download mPower firmware from https://www.multitech.net/developer/downloads/
  2. Extract the conduit_aep_upgrade.bin or mtcap_aep_upgrade.bin file from the zip file.
  3. Follow the Auto-Flash instructions above using the aep_upgrade.bin file

 

Using U-boot & TFTP

Access U-Boot at boot time from the DEBUG serial port behind the front panel. See the Conduit Hardware Guide for debug information

Setting up your U-Boot environment

Linux: Install and configure a TFTP server. For example using in.tftpd and xinetd the following configuration will listen on port 69 and set /tftpboot as the tftp root dir.

/etc/xinetd.d/tftp:

service tftp
{
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = nobody
server          = /usr/sbin/in.tftpd
server_args     = -s /tftpboot
disable         = no
}

Windows: Download, install and configure Tftpd32, available at http://www.softpedia.com/get/Internet/Servers/FTP-Servers/Tftpd32.shtml.

 

On your PC, extract out the the .rootfs.jffs2 and .bin files and place them in the tftpboot directory . Then rename them like this:

mlinux-factory-image-mtcdt-20150527081222.rootfs.jffs2oe_rootfs.jffs2
uImage--3.12.27-r11.2-mtcdt-20150527052826.binoe_uImage.bin

 

Power on the device after connecting the debug cable. You need to interrupt U-Boot from booting the system; look for the Hit any key to stop autoboot.

U-Boot 2012.10-mtcdt-r6 (May 07 2015 - 13:37:07)

CPU: AT91SAM9G25
Crystal frequency: 12 MHz
CPU clock : 400 MHz
Master clock : 133.333 MHz
[...]
Hit any key to stop autoboot: 0
U-Boot>

 

Some units come already configured with a U-Boot environment that makes flashing the device simple. To check the contents of the U-Boot environment, run printenv and check for variables named krb, tftp_kernel and tftp_rootfs, etc.

If these variables do exist, then modify the serverip, ipaddr, and netmask variables to match your network and save the settings. Then skip to the “Flash from U-Boot” section below.

U-Boot> setenv ipaddr 192.168.2.1
U-Boot> setenv serverip 192.168.2.99
U-Boot> setenv netmask 255.255.255.0
Saving Environment to NAND...
Erasing redundant NAND...
Erasing at 0x160000 -- 100% complete.
Writing to redundant NAND... done
U-Boot>

If these variables don’t exist, follow these instructions to configure the U-Boot environment for flashing:

Download the uboot-setenv-mtcdt minicom script from the mLinux git repository to your development PC:

https://git.multitech.net/cgit/meta-multitech-atmel.git/tree/contrib/uboot-setenv-mtcdt.minicom

Copy that uboot-setenv-mtcdt script to a location with a shorter path. The full path needs to be short enough to fit in the Minicom run script menu.

$ cp uboot-setenv-mtcdt.minicom $HOME/uboot-setenv.minicom

Edit ${HOME}/uboot-setenv to match your network and device.

send setenv serverip              192.168.2.2
send setenv ipaddr                192.168.2.1
send setenv netmask               255.255.255.0

Run the U-Boot environment setup script. At minicom type CTRL-A G and enter ${HOME}/uboot-setenv as the name of the script to run. When the script finishes it should save and print out the environment. Make sure you expand ${HOME} to your actual home dir when entering the script name.

Flash from U-Boot

Make sure oe_uImage.bin and oe_rootfs.jffs2 are in your tftpboot directory, then run the krb command. U-boot will copy the firmware files from your PC, flash the device, and reboot.

U-Boot> run krb

 

NAND Flash Layout

Name Offset Size Usage
NANDFlash 0x00000000 0x10000000 Whole NAND
at91bootstrap 0x00000000 0x00040000 (256KB) Bootstrap [bootstrap.bin]
u-Boot 0x00040000 0x00080000 (512KB) U-Boot [u-boot.bin]
u-Boot Config 0x000C0000 0x000A0000 (640KB) U-Boot environment
u-Boot Redundant Config 0x00160000 0x000A0000 (640KB) U-Boot redundant environment
uImage 0x00200000 0x00600000 (6MB) Linux Kernel [uImage.bin]
Config 0x00800000 0x00800000 (8MB) Configuration [/var/config]
OEM Config 0x01000000 0x00800000 (8MB) OEM Specific configuration [not used by default]
Rootfs 0x01800000 0x0E800000 (232MB) root filesystem [rootfs.jffs]

Total Size: 256 MB

Block/Sector Size: 128 KB