0% found this document useful (0 votes)
32 views

Flashing The Compute Module CM4

Uploaded by

austin gutierrez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Flashing The Compute Module CM4

Uploaded by

austin gutierrez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Flashing The Compute Module - MyPi Industrial Raspberry Pi https://www.embeddedpi.com/documentation/installing-linux-os/mypi-...

Knowledge Base Flashing The Raspberry Pi Compute Module

MyPi Integrator Board (/documentation/


Programming Sequence
baseboard-documentation)
Whilst development kits come with the Demo OS pre-installed, this section describes how to write a new disk image to the Compute Module. This section
MyPi Edge Gateway (/documentation/mypi-iot- mainly follows the procedure from the Raspberry Pi website guide here :
edge-gateway)

Installing Linux OS (/documentation/installing-


Raspberry Pi Compute Module Documentation (https://www.raspberrypi.com/documentation/computers/compute-module.html#steps-to-flash-the-emm

linux-os)

First of all download the windows USB boot installer, this will install a program we'll use later called RPi-Boot :
Modems (/documentation/3g-4g-modems)

WiFi Con�guration (/documentation/wi�- Windows Raspberry Pi Compute Module Boot Loader (https://github.com/raspberrypi/usbboot/raw/master/win32/rpiboot_setup.exe)
con�guration)

SD Card Interface (/documentation/sd-card-


interface)

Serial Console (/documentation/serial-console)

Power Information (/documentation/power-


consumption)

I/O PCB Design (/documentation/mypi-io-card-


pcb-template)

ISO I/O Combo Board (/documentation/


isolated-io-board)

ISO-485 (/documentation/isolated-rs485)

ISO-485-DUO (/documentation/ISO-485-DUO)

ISO-CANBUS (/documentation/isolated-canbus)

ISO-CANDUO (/documentation/iso-can-duo)

ISO-CAN-DUO-FD (/documentation/iso-can-duo-
fd)

ISO-MBUS (/documentation/isolated-mbus)

ISO-1Wire (/documentation/isolated-1wire)

ISO-ADC (/documentation/isolated-adc-
analogue-4-20ma-sensor-reading)

ISO-DIGOUT (/documentation/isolated-digital-
output)

UPS-XBEE (/documentation/ups-xbee)

ISO-SENSOR-KIT (/documentation/iso-sensor-
kit-1wire-adc-rs485)

ISO-RF (/documentation/rf-zigbee-card)

ISO-BLE (/documentation/iso-ble)

ISO-LoRa (/documentation/microchip-lora-
RN2483-RN2903)

Power-Timer Board (/documentation/power-


timer-Board)

LoRa-Concentrator (/documentation/LoRa-
Concentrator)

Multi UART (/documentation/multi-uart-serial-


board)

Multi-485 (/documentation/multi-rs485)

Demo Applications (/documentation/demo-


applications)

RF-COM (/documentation/din-xbee-com)

1 of 8 8/18/2024, 4:06 AM
Flashing The Compute Module - MyPi Industrial Raspberry Pi https://www.embeddedpi.com/documentation/installing-linux-os/mypi-...

mPCIe-ZigBee (/documentation/mpcie-zigbee-
telegesis-etrx357hr-lrs)

mPCIe-XBEE (/documentation/mpcie-xbee-rf)

mPCIe-LoRa (/documentation/mpcie-lora-
RN2483-RN2903)

mPCIe-TCM310 (/documentation/mpcie-
tcm310)

mPCIe-BLE (/documentation/mpcie-bluegiga-
ble112)

mPCIe-BT5 (/documentation/miniPCIe-
Bluetooth-5-Lair-BLE652)

FCC/CE Compliance Docs (/documentation/ce-


fcc-compliance-docs)

With the board powered off fit USB Boot/programming jumper link to Enable (to allow programming)

Connect the mini USB connector by the HDMI connector to the PC using a USB A to micro B data cable then power up the board

Depending on the Compute Module type Windows may produce additional dialogues as it detects the device

Once that sequence has finished Windows has now installed the required drivers and you can power off the unit for a moment whilst we get the PC side
ready for the next step.

When the RPi-Boot starts up it’ll sit and wait for the attached board to boot up :

2 of 8 8/18/2024, 4:06 AM
Flashing The Compute Module - MyPi Industrial Raspberry Pi https://www.embeddedpi.com/documentation/installing-linux-os/mypi-...

RPi-Boot essentially catches the board at power up and sends a series of commands to re-configure the compute module into mass-storage device mode,
doing so allows Windows to recognise it as a new drive and we can then write the main OS image onto it.

So leave RPi-Boot running and waiting as shown above and power up the unit again.

If all goes well RPi-Boot will detect the attached board as it powers up, do it’s work and exit quickly, disappearing from the screen.

Here’s a grab of it in action :

Note : Sometimes RPi-Boot doesn’t correctly catch the board as it boots and as a result the re-config sequence doesn’t complete correctly. In this case the
simplest thing to do is to switch the board off, close then restart RPi-Boot and then power the board back on to try again.

When done the compute module will alternate into mass storage mode (so behaving just as though it's a USB memory stick) and Windows will then
recognise the module as an external drive.

Windows will then assign drive letters to the detected partitions on the device, and then bug you about formatting them. If the module already contains an
OS image it will show multiple drives as it assigns them to partitions, if the device is blank only one partition will be detected and a single letter assigned.

Click cancel to close this Windows Format dialog box(s) and we’ll load the OS next using another utility.

If the compute module has already been programmed Windows will recognise the FAT partition and assign that (at least) a drive letter, this is useful in the
event that a config error with the boot files is made and needs recovery actions to be performed (e.g. dt-blob.bin or config.txt).

There are a few ways we can load on the OS, but for simplicity we’ll use one of the recommended OS writing software for writing the OS image.

3 of 8 8/18/2024, 4:06 AM
Flashing The Compute Module - MyPi Industrial Raspberry Pi https://www.embeddedpi.com/documentation/installing-linux-os/mypi-...

The process below writes a disk image containing the partition table and both FAT boot partition and Linux ext partitions over the entire disk using a third
party software tool :

1. Download the Win32DiskImager utility from the Sourceforge Project page (http://sourceforge.net/projects/win32diskimager/)
2. Install and then run the Win32DiskImager utility.
3. Select the OS image file you wish to write
4. Select the drive letter of the compute module in the device box (in our case E:) - if the module contains an OS image you will get multiple drive letters,
e.g. E: & F: use the first one assigned (E:).
5. Click Write and confirm that you wish to overwrite the disk wait for the write to complete.

Take care during this process not to dislodge any cabling as this will cause the program to error out and you’ll need to power off/on and start again from the
RPI-Boot point.

Here's some grabs of this sequence :

4 of 8 8/18/2024, 4:06 AM
Flashing The Compute Module - MyPi Industrial Raspberry Pi https://www.embeddedpi.com/documentation/installing-linux-os/mypi-...

IMPORTANT : Once complete power off the unit and set the USB Boot jumper link back to Disabled, and remove the USB programming cable.

Failing to do both these steps will prevent the units onboard USB peripherals from working due to CM's USB master being still switched over to the
programming socket and not the internal bus.

Power the board back on and it should now boot into the OS.

The same utility can also create snapshot images of the current image config to save time, although note this is a straight binary dump of the entire 8+GB
disk not just the parts with files in so the image files end up quite big and take a long time to read/write.

Note that the official Raspbian images can be found here :

https://www.raspberrypi.com/software/operating-systems/ (https://www.raspberrypi.com/software/operating-systems/)

The Lite image version are the headless operating version without the GUI Interface installed.

Mass Programming PCBs


We have created some PCBs for fast flashing multiple Compute Modules using externally powered USB hubs, these data files are provided free of charge
and include all the files needed to order from JLC PCB (https://jlcpcb.com) including the assembly and component data.

Compute Module 3/3+/4S Compute Module 4

Download PCB Files (https://github.com/mypiandrew/PiProg) Download PCB FIles (https://github.com/mypiandrew/Pi-Prog-CM4)

Mass Programming Software


With some care and additional hardware Balena Etcher can be configured to create a low cost mass programming station.

You will need the below parts

- Version 1.14.3 (https://github.com/balena-io/etcher/releases/tag/v1.14.3)of the Linux OS app (Windows version not recommended as it has issues with
reliably detecting multiple CMs)
- Set of Mass Programming PCBs (see above)
- Multiport Powered USB Hub
(https://www.amazon.co.uk/dp/B00RXKBX74)
- USB to Micro USB cables
(https://www.amazon.co.uk/dp/B0711PVX6Z)
- A cheap laptop that can be re-purposed to have Linux Installed (we recommend Debian 12 (https://cdimage.debian.org/debian-cd/current-live/amd64/
iso-hybrid/))

Install Linux on the Laptop, install the etcher app from the balena-etcher_1.14.3_amd64.deb (https://github.com/balena-io/etcher/releases/download/
v1.14.3/balena-etcher_1.14.3_amd64.deb) file

Note that Etcher will not detect the Compute Module unless it is run as root user

5 of 8 8/18/2024, 4:06 AM
Flashing The Compute Module - MyPi Industrial Raspberry Pi https://www.embeddedpi.com/documentation/installing-linux-os/mypi-...

To configure the system to auto select all compute modules as targets, we need to make a change to the configuration file as shown below

Add the config line at the bottom as shown

6 of 8 8/18/2024, 4:06 AM
Flashing The Compute Module - MyPi Industrial Raspberry Pi https://www.embeddedpi.com/documentation/installing-linux-os/mypi-...

Image Downloads
The default images for the different products can be downloaded here :

Integrator Board NT (CM3+/CM4S)

Bullseye OS 5.10.92 For Integrator Board NT (CM3+/CM4S) Iss 20230714 (https://drive.google.com/file/d/1Baxe9g1FJqKNDc_5NbxBdS6GFwIA5Fhx)

Integrator Board XT (CM4)

Bullseye OS 5.10.92 For Integrator Board XT (CM4) Iss 20240712.img (https://drive.google.com/file/d/1OImZqykCqGw1cqhvQ3F2-lhfNPtWYj1Z/view?usp=drive_link)

Edge Gateway

EdgeGateway-v1.44-Stretch_4.14.94-inc_SparkLAN_WiFi (CM3/CM3+) (v31/Jul/2019) (https://drive.google.com/open?id=12aR0uP8IAIqwaivY6H8zH023EpEYYfG0)

EdgeGateway-v1.5-Buster_4.19.118-inc_SparkLAN_WiFi (CM3/CM3+) (v14/Aug/2020) (https://drive.google.com/file/d/1Yvsbo2vDOvGBLr39h1LdA5gVsRHSPeH6)

EdgeGateway-v1.5-Buster_4.19.118-inc_SparkLAN_WiFi (CM3/CM3+) (v20/April/2022) (https://drive.google.com/file/d/1tp8HlS5KLhZhpqR5f5A-sXSLUUXSJoNc)

7 of 8 8/18/2024, 4:06 AM

You might also like