Flashing The Raspberry Pi Compute Module

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 mainly follows the procedure from the Raspberry Pi website guide here :

Raspberry Pi Compute Module Documentation

First of all download the windows USB boot installer, this will install a program we'll use later called RPi-Boot (New Version for CM1 & CM3 August 2017) :

Windows Raspberry Pi Compute Module Boot Loader

With the board powered off set USB Boot jumper link to Enable

Connect the mini USB connector by the HDMI connector to the PC using a USB A to micro B data cable.

Power up the board

Windows will then show the following stages as it locates and installs a driver :

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming Step 1

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming  Step 2

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming Step 3

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.

Making sure you have the unit powered off start up RPi Boot, which you installed via CM-Boot-Installer.exe and can access via the Windows start menu, be sure to do a right click 'Run as administrator' on this program :

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming RPI Boot Step 1

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

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming RPI Boot Step 2

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 :

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming RPI Boot Step 3

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, this is what the compute module will do if it's blank :

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming Step 5

Click cancel to close this Windows Format dialog box 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 (e.g. dt-blob.bin or config.txt) and needs recovery actions to be performed.

There are a few ways we can load on the OS, but for simplicity we’ll use the recommended OS writing software and process from the main Raspberry Pi website here :

https://www.raspberrypi.org/documentation/installation/installing-images/windows.md

This process writes a disk image, containing the partition table and both FAT boot partition and Linux ext partitions, over the entire disk, the basic sequence we're following here is

  1. Download the Win32DiskImager utility from the Sourceforge Project page
  2. Note : For Windows 8/10 we would recommend using Etcher instead of Win32DiskImager -
  3. Install and run the Win32DiskImager utility. You will need to run the utility as administrator, right-click on the shortcut (or exe file) and select Run as administrator.
  4. Select the Raspbian image file you wish to write
  5. Select the drive letter of the compute module in the device box (in our case F:) - Again note that the disk image is a 1:1 of the entire disk (containing the partition table, FAT & EXT partitions) We are writing the image to the entire disk, and not a partition.
    Be careful to select the correct drive; if you get the wrong one you can destroy your data on the computer's hard disk!
  6. Click Write and 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 :

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming Step 7

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming Step 8

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming Step 9

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming Step 10

MyPi Industrial Raspberry Pi 3G 4G Compute Module Programming Step 11

Once complete power off the unit and set the USB Boot jumper link back to Disabled, and finally remove the USB cable. - Failing to do this 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 back on the unit and the board 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 4GB 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.org/downloads/raspbian/

The NoX/Lite image sizes work out to be approx 760MB in size

 

The MyPi default images can be downloaded here :

Integrator Card

MyPi-Issue2.2-Wheezy.zip

MyPi-Issue2.3-Jessie_4.4.50.img For CM1 (v31/May/2017)

MyPi-Iss2.2-Jessie_4.4.43.img For CM3 (v25/Jan/2017)

MyPi-Iss2.3-Jessie_4.9.36.img For CM3 (v11/June/2017)

MyPi-Iss2.4-Jessie_4.9.80.img For CM3 (v10/April/2018)

MyPi-Iss2.4-Stretch_4.9.80.img For CM3 (v11/June/2018)

Edge Gateway

MyPi-EdgeGateway-Jessie_4.9.67.img (CM3) (v11/Dec/2017)

MyPi-EdgeGateway-Stretch_4.9.80.img (CM3) (v1/Jun/2018)

 

NOTE : We do not currently recommend using Kernel 4.14.x. for production use

 

NOTE : The default MyPi root password is "root" please change this asap.

Contact us now to discuss your project

Ready to order, contact us today for pricing or samples

Contact Us