Update or flash the Dev Board

Periodically, we'll release system and software updates for the Dev Board. If you've already set up your board with the Mendel system image (from the Get Started guide), you can update your board with apt-get.

If you instead want to wipe the whole system and start over from scratch, you can reflash the system image. Or if you need to recover a board that can't boot up on eMMC at all, see how to flash from U-Boot on an SD card.

Update your Dev Board with apt-get

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.

To install Mendel system updates and other software updates, simply log in to the board's terminal and run the following commands (first, make sure your board is online):

sudo apt-get update

sudo apt-get dist-upgrade

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

You can check your Mendel system version as follows:

cat /etc/os-release

Flash a new system image

Flashing is supported using Linux or Mac.

Note: These instructions assume you already have a system image on the board. If you don't, instead flash your board for the first time by following 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-C data 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 and connect.

    If it's not already booted, plug in the board and then connect to the board via SSH or serial console.

  4. Reboot the board into fastboot mode.

    Run the following command in the Dev Board's shell:

    sudo reboot-bootloader
    

    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
    

    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 4 and you started fastboot mode from step 4. If so, try installing a more recent version of fastboot from Android SDK Platform-tools. (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-chef-13.zip
    unzip mendel-enterprise-chef-13.zip \ && cd mendel-enterprise-chef-13
    bash flash.sh

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

    It takes about 5 minutes to complete. If you're connected with the serial console, you can see the flashing progress in that terminal.

When flashing is complete, your board will reboot.

If you're connected with the serial console, the console prompts you to login. The login and password are reset to the defaults:

Login is mendel
Password is mendel

Or instead connect to the board's shell without the serial console, using MDT.

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).

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-chef-13.zip
    
    unzip mendel-enterprise-chef-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-chef-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

You may want to instead open a shell using MDT.