Flashing Raspberry Pi

A comprehensive guide to flashing the Compute Module 3 eMMC

The Raspberry Pi is a series of compact, affordable single-board computers designed to make computer science accessible to everyone. Although simple at first glance, these devices are incredibly versatile and are used in everything from education and DIY projects to complex industrial systems. In this guide, we dive into the basics of the Raspberry Pi and provide a detailed, step-by-step walkthrough on flashing the Compute Module 3 eMMC—making it easy for beginners and experts alike to get started.

Understanding the Raspberry Pi and its Compute Module

Originally created to promote learning, the Raspberry Pi has evolved into a crucial component in many innovative projects. The Compute Module variant, equipped with on-board eMMC storage, lets you install custom operating systems and software with ease. Flashing this storage device is key to unlocking the full potential of your Compute Module.

Raspberry Pi Compute Module 3

Step-by-step guide: how to flash the Compute Module 3 eMMC

The flashing process is done using a Compute Module IO (CMIO) board. Follow these detailed steps for both Windows and Linux systems:

Required components

Before beginning the flashing process, ensure you have the following components:

For Windows users

  1. Download the Windows Installer
    • Obtain the Windows installer package from the official Raspberry Pi website. This installer automatically sets up the necessary drivers and boot tool.
  2. Set up the hardware
    • Connect your host PC’s USB cable to the CMIO board’s USB SLAVE port.
    • Ensure that the jumper (J4) on the board is set to the «EN» (enable) position.
    • Do not power the board until the cable is connected.
  3. Power up and install drivers
    • Apply power to the CMIO board.
    • Windows should detect the board and install drivers automatically. Monitor the notification area to confirm the installation completes successfully.
  4. Run the boot tool
    • Launch the RPiBoot.exe tool that was installed.
    • The tool will initialize and, after a few seconds, the Compute Module eMMC should appear as a new USB mass storage device.
  5. Flash the OS image
    • Use a tool such as Win32DiskImager to write your desired OS image to the new drive.
    • Once completed, ensure to set J4 back to «disabled» (if required) and disconnect any additional USB devices before rebooting the board.

For Linux users

  1. Prepare Your System
    • Ensure Git and libusb are installed. On a Debian-based system, you can run:
      sudo apt update
      sudo apt install git libusb-1.0-0-dev
  2. Clone the usbboot repository
    • Use the following command to clone the repository:git clone --depth=1 https://github.com/raspberrypi/usbboot
      cd usbboot
  3. Build the boot tool
    • Compile the tool by running:make
  4. Run the usbboot tool
    • Execute the tool with:sudo ./rpiboot
    • The tool will start and wait for a connection.
  5. Connect and flash the Compute Module
    • Plug the USB cable from your host machine into the CMIO board’s USB slave port (J15) and power on the board.
    • The rpiboot tool will detect the Compute Module and transfer the boot code.
    • Once the device appears (often as /dev/sda or /dev/sdb), flash your OS image using a command like:sudo dd if=your_os_image.img of=/dev/sdX bs=4MiB status=progress
      Replace /dev/sdX with the correct device identifier.
  6. Finalizing the process
    • After writing the image, disconnect and reconnect the USB cable.
    • Check that the new partitions (e.g., /dev/sdX1 and /dev/sdX2) appear.
    • Set J4 to the disabled position if needed and power cycle the board to boot from eMMC.

Troubleshooting and tips

  • Driver installation:
    Ensure no other USB devices are interfering during driver installation on Windows.
  • Device identification:
    On Linux, check /dev/ or use lsblk to correctly identify the new device before flashing.
  • Timing issues:
    For Linux, ensure your system clock is set correctly to avoid Git-related errors.

Conclusion

This guide has provided a thorough walkthrough of flashing the Compute Module eMMC—from understanding the basics of the Raspberry Pi to detailed steps for both Windows and Linux systems. Whether you are a newbie or an experienced developer, these instructions are designed to make the process straightforward. If you enjoyed this post, we have an entire series dedicated to Raspberry Pi with DIY projects and tutorials, be sure to follow us and visit our blog regularly. Join our community of tech enthusiasts and keep innovating with blackdevice!