This document shows how to flash the onboard eMMC memory on a compute module that has a built-in eMMC.
Preparing the Controller for mounting eMMC #
To flash the eMMC, connect the Raspberry HMI’s main board. Raspberry HMI has a USB host port and can disable eMMC boot and boot the Pi via RPI boot over USB.
On the main board, a jumper should be placed on the first and second pins of P2. NRPI Boot PIN should be connected to the GROUND PIN. There are 4 screws on the back has to be unscrewed to do this.
Here’s how to put a Jumper Disable eMMC boot. So the Pi doesn’t boot normally but instead boots into RPI boot mode using a micro USB cable.
Then, plug a USB cable from the computer (a Windows, Mac, or Linux computer) into the ‘USB HOST’ port on the MAIN Board, and plug in power.
The board will power on, and the eMMC module should be ready for the next steps.
Using USB boot to mount the eMMC storage #
The next step is to download the Raspberry Pi USB boot repository, install a required USB library on the computer, and build the RPI boot executable, which will be used to mount the storage on the computer.
First, make sure to have the libusb library installed:
If on a Mac or Linux computer, need to install a USB library first. If on Raspberry Pi OS Debian or Ubuntu Linux, the command to install it is sudo apt install libusb 1.0-0-dev. On a Mac, install it with homebrew using brew install pkgconfig libusb.
Second, clone the USB boot repository to the computer. Download the Raspberry Pi USB boot project from GitHub.
Here’s the USB boot download link: https://github.com/raspberrypi/usbboot
Third, cd into the USB boot directory and build RPI boot:
For the Windows PC install the required drivers and boot tool using the Windows installer inside the win32 directory. That installer is called rpibootsetup.exe.
Run it and after it completes a reboot.exe application will appear. Open that with the compute module plugged in and powered up and it can see the eMMC popup in Windows as a USB mass storage device.
At this point, the eMMC storage behaves just like a micro SD card or USB drive that is plugged into the computer. Use an application like the Raspberry Pi Imager to flash Raspberry Pi OS (or any OS of choosing) to the eMMC:
At this time, if there is no change to the contents of the boot volume, it can disconnect the main board USB HOST port connection, turn off the power, and then remove the eMMC Boot disable jumper on P2.
Then plug power back in, and the CM4 should now boot off its eMMC storage.