Update or flash the Dev Board

Periodically, we'll release software updates or a new version of Mendel Linux for the Dev Board. This page describes how to install these updates on your board.

Update your Dev Board with apt-get

To update all software packages such as the Edge TPU runtime and API library, connect to the board's shell and run the following commands (first, make sure your board is online).

Note: This only upgrades packages in your current version of Mendel. To upgrade your Mendel version, you must flash the system image.
sudo apt-get update

sudo apt-get dist-upgrade

It might take a couple minutes to update all packages, but that's it. Your software packages are now up to date.

Notice: Due to a known issue in Mendel, if your Dev Board is currently running Mendel 2.0 or lower, some packages do not properly upgrade when using apt-get. Check your version by running cat /etc/mendel_version; if it's 2.0 or lower, we recommend that you flash the system image.

Flash a new system image

Flashing is supported using Linux or Mac.

Caution: This deletes all system and local data. Be sure to back up any personal data before you proceed. For example, if your work is saved in the /home path, then you can create a TAR of that directory and use mdt pull to copy the TAR from the board. Then after you flash, use mdt push to move it back.
Note: These instructions assume you already have a system image on the board. If you don't, instead follow the Get Started guide.

Before you begin the flashing procedure, verify that the boot mode switches are set to eMMC mode as follows. (If they're not set this way, power off the board before you change them.)

Boot mode Switch 1 Switch 2 Switch 3 Switch 4
eMMC ON OFF OFF OFF
Figure 1. Boot switches set to eMMC mode

Now flash the board as follows:

  1. Add the udev rule. (Linux only)

    If you haven't used your current Linux computer to connect to your Dev Board, run the following commands so it can recognize the board over USB:

    sudo sh -c "echo 'SUBSYSTEM==\"usb\", ATTR{idVendor}==\"0525\", MODE=\"0664\", \
    GROUP=\"plugdev\", TAG+=\"uaccess\"' >> /etc/udev/rules.d/65-edgetpu-board.rules"
    
    sudo udevadm control --reload-rules && udevadm trigger
  2. Connect to the USB data port.

    Attach a USB cable from your host computer to the USB port on the Dev Board labeled "OTG" (see figure 2).

    Figure 2. A USB-C data cable connected to the board (in addition to the power cable)
  3. Power on the board.

    If it's not already booted, plug in the board and wait for it to power on.

    Verify the board is connected to your computer by running this command from your computer (requires MDT):

    mdt devices
    

    You should see output such as this:

    orange-horse        (192.168.100.2)
    
  4. Reboot the board into fastboot mode.

    Caution: You are about to delete all system and local data. Now is the time to back up any personal data.

    Run the following command from your computer:

    mdt reboot-bootloader
    

    After a moment, you can verify the board started in fastboot mode with this command (requires fastboot):

    fastboot devices
    

    You should see a line printed like this:

    1b0741d6f0609912        fastboot
    

    Help! If fastboot devices prints nothing, wait a few more seconds for the device to reboot into fastboot, then try again.

    If it still prints nothing, verify the Dev Board is connected to your computer via USB as shown in figure 2 and you rebooted the board with the command sudo reboot-bootloader. If so, try installing a more recent version of fastboot from Android SDK Platform-tools and try again. (Be sure to add the new fastboot to your PATH environment variable.)

  5. Download and flash the system image.

    Run the following commands on your host computer:

    cd $HOME/Downloads
    
    curl -O https://dl.google.com/coral/mendel/enterprise/mendel-enterprise-day-13.zip
    unzip mendel-enterprise-day-13.zip \ && cd mendel-enterprise-day-13
    bash flash.sh

    This starts the flashing process and you'll see various output.

    It takes about 5 minutes to complete. When flashing is complete, your board will reboot. It might take another minute before MDT can identify the device.

  6. Log in and restore data.

    You can log in to the board's shell using MDT:

    mdt shell
    

    And then restore any data you backed up and reconnect to the internet, if necessary.

Note: Your board's hostname is randomly generated the first time it boots from a new flashing. We do this to ensure that each device within a local fleet is likely to have a unique name. Of course, you can change this name using standard Linux hostname tooling (such as hostname).

If you attempt to connect with the serial console, the login and password are reset to the defaults: login is mendel; password is mendel.

Flash from U-Boot on an SD card

If you get unlucky and you can't even boot your board into U-Boot, then you can recover the system by booting into U-Boot from an image on the SD card and then reflash the board from your Linux or Mac computer as follows.

  1. Enable boot from SD card.

    Unplug the Dev Board and change the boot mode switches to boot from SD card:

    Boot mode Switch 1 Switch 2 Switch 3 Switch 4
    SD Card ON OFF ON ON

    Figure 3. Boot switches set to SD card mode
  2. Flash an SD card with the recovery image.

    On your host computer, download and unpack the latest system image:

    curl -O https://dl.google.com/coral/mendel/enterprise/mendel-enterprise-day-13.zip
    
    unzip mendel-enterprise-day-13.zip

    Inside the package, find the recovery.img file.

    Then use a program such as balenaEtcher to flash the recovery.img file to your microSD card.

    Help! If the flash program displays a warning such as, "The image does not appear to contain a partition table," that's okay—it's true that there is no partition table in this image, but this is working as intended so you can continue.
  3. Connect to the serial console.

    Note: The board should not be powered on yet.

    Use a USB-microB cable to connect your host computer to the serial console port on the board (see figure 4). The orange and green LEDs on the board will illuminate.

    Follow these instructions to open the serial console. When you complete those steps, the prompt should disappear and your terminal should become completely blank (because the board is not powered on yet).

    Figure 4. A USB-microB cable connected to the serial console port
  4. Insert the SD card and then power on the board.

    The SD card slot is on the bottom of the Dev Board.

    Plug in your 2 - 3A power cable to the USB-C port labeled "PWR" (see figure 5).

    Caution: Do not attempt to power the board by connecting it to your computer.

    Figure 5. A USB-C power cable connected to the board (in addition to the serial cable)
  5. Start fastboot.

    At the u-boot prompt that appears in your screen session (from step 3), start fastboot mode:

    fastboot 0
    

    The cursor moves to the next line but there is no output. That's as expected.

  6. Connect to the USB data port.

    Use a USB-C cable to connect your host computer (Linux or Mac) to the USB-C data port on the Dev Board labeled "OTG" (see figure 6). (This is the connection used by fastboot.)

    Figure 6. A USB-C data cable connected to the board (in addition to the serial and power cables)

    After a moment, you can verify that the board started in fastboot mode by running the following command from your connected host computer (requires fastboot):

    fastboot devices
    

    You should see a line printed like this:

    1b0741d6f0609912        fastboot
    
  7. Flash the image.

    On your host computer, navigate into the unpacked system image directory (from step 2) and execute the flash script:

    cd mendel-enterprise-day-13
    
    bash flash.sh

When flashing is complete, your board will reboot. However, because you set the boot mode to SD card, that's what it will do so you'll again see the u-boot prompt. So unplug the power and reset the boot switches to eMMC mode:

Boot mode Switch 1 Switch 2 Switch 3 Switch 4
eMMC ON OFF OFF OFF

Then boot the board again. When it's done booting, the console prompts you to login.

Login is mendel
Password is mendel
Tip: You can instead open a shell using MDT.

Once logged in, be sure to download other software updates with the following commands (be sure your board is online first):

sudo apt-get update

sudo apt-get dist-upgrade