Raspberry Pi Compute Module 4 vs Compute Module 3

Raspberry Pi launched Compute Module 4, as a successor to Compute Module 3B+. The Compute Module 4 (CM4) is a so-called System on Module (SoM), which contains core parts which make up a Raspberry Pi 4, for example, and in addition to that eMMC Flash in different sizes (ranging from none for the Lite module version to 32 GB).

The CM4 allows designers to integrate a powerful computing solution into their embedded products, without having to sign NDAs with Broadcom, commit to high SoC purchase volumes. They also benefit of the design experience of the Raspberry Pi hardware and software design team, and of course of the Raspberry Pi community and broad range of software support for the Raspberry Pi platform.

A compute module 4

Top differences in the new Compute module generation

new form factor

Instead of being DDR2-SODIMM mechanically compatible, such as all previous Compute Modules (1, 3, 3+), the new CM4 connects to your compute module carrier board using two 100-pin high density Hirose connectors.

This allows it to have a smaller footprint (55 mm x 40 mm x 4.7 mm, with 4 x M2.5 mounting holes), and provide new high-speed interfaces. (Raspberry Pi would otherwise have run out of pins with the DDR2-SODIMM approach!)

new capabilities and interfaces

The new CM4 has additional interfaces:

  • an additional HDMI port; both HDMI ports are capable of 4K output, and support HDMI 2.0
  • PCI Express Interface ( Gen 2 x1 = single lane)
  • GBit Ethernet interface (Broadcom BCM54210PE PHY is included on-board of the Compute Module) – all you need to add in your design is a MagJack!
  • on-board WLAN support (in WiFi versions), with PCB trace antenna and optional external antenna!
The image shows the external antenna (a Raspberry Pi supplied option, pre-certified!)

significantly simplified power supply design

You’ll be shocked how simple it is to design for the new Raspberry Pi compute module: one single +5V supply is all that is needed, and it will even supply up to 600 mA at 3.3V and 1.8V to peripherals for you.

No more adding different power rails & carefully sequencing them – this will greatly simplify your own carrier board design.

Raspberry Pi’s own CM4IO board will help you to get started quickly with the CM4

Pinout differences between Compute Module 4 and Compute Module 3

There are different groups of pins on the Compute modules, we’ll look at each of them and their differences between the versions in turn.

GPIO pin differences between the compute modules

In the table below, I’ve listed the available GPIO pins on compute module 4 (CM4), on compute module 3 (cm3), and on the Raspberry Pi 4, with their respective pin numbers.

GPIO pins are divided by GPIO banks, on the Raspberry Pi SoC, pins GPIO0 – GPIO27 are in GPIO Bank 1, whereas pins GPIO28 to GPIO45 are on GPIO Bank 2. The GPIO banks, on CM3, can be driven with independent voltages (GPIO0-27_VREF and GPIO28-45_VREF).

On CM4 and Pi 4 only the first GPIO bank (GPIO0 – GPIO27) are exposed. In addition to that, CM4 exposes GPIO44 and GPIO45, which are usually used for driving the official Raspberry Pi camera(s) and 7” display. The CM4 therefore lacks 16 GPIO pins in comparison to the CM3!

GPIO BCM IDCM4 Pin#CM3 Pin#Pi 4 Pin#Note
GPIO036 (ID_SD)327ID_SD = SDA0
GPIO135 (ID_SC)528ID_SC = SCL0
GPIO25893SDA1
GPIO356115SCL1
GPIO454157GPCLK0
GPIO5341729GPCLK1
GPIO6302131GPCLK2
GPIO7372326SPI0_CE1_N
GPIO8392724SPI0_CE0_N
GPIO9402921SPI0_MISO
GPIO10443319SPI0_MOSI
GPIO11383523SPI0_SCLK
GPIO12314532PWM0
GPIO13284733PWM1
GPIO1455518TXD0 / TXD1
GPIO15515310RXD0 / RXD1
GPIO16295736
GPIO17505911
GPIO18496312PCM_CLK
GPIO19266535PCM_FS
GPIO20276938PCM_DIN
GPIO21257140PCM_DOUT
GPIO22467515
GPIO23477716
GPIO24458118
GPIO25418322
GPIO26248737
GPIO27488913
GPIO2828SDA0
GPIO2930SCL0
GPIO3034
GPIO3136
GPIO3246GPCLK0
TXD0 / TXD1
GPIO3348RXD0 / RXD1
GPIO3452GPCLK0
GPIO3554SPI0_CE1_N
GPIO3658SPI0_CE0_N
TXD0
GPIO3760SPI0_MISO
RXD0
GPIO3864SPI0_MOSI
GPIO3966SPI0_SCLK
GPIO4070PWM0 / TXD1
SPI2_MISO
GPIO4172PWM1 / RXD1
SPI2_MOSI
GPIO4276GPCLK1
SPI2_SCLK
GPIO4378GPCLK2
SPI2_CE0_N
GPIO4482 (SDA0)82cam / disp
SDA0 / SDA1
GPCLK1
SPI2_CE1_N
GPIO4580 (SCL0)84cam / disp
SCL0 / SCL1
SPI2_CE2_N
GPIO pinout compared between CM4, CM3, Raspbery Pi 4

There are two special I2C buses – one on GPIO0 and GPIO1, which is used for HAT EEPROMs (ID_SD / ID_SC), and one on GPIO44 and GPIO45, which is typically used to connect the camera and display.

Note also, that on CM4 you have the capability to set the GPIO output voltage, using GPIO_VREF – this can be connected to +1.8V or +3.3V for 1.8V or 3.3V signalling respectively. From the datasheet, it is unclear, however how this will affect GPIO44 and GPIO45, as they are in the GPIO Bank 1!

On CM4, GPIO2 and GPIO3 (used for I2C) have 1.8K pull up resistors.

Compute Module 3+ allows access to the SPI2 bus, which is not exposed anywhere else – on CM4, you will only have access to SPI0 and SPI1.

CM4 will not allow simultaneous access to UART0 (TXD0, RXD0) and the miniUART, UART1 (TXD1, RXD1). Here both are exposed on GPIO14 and GPIO15 as alternatives.

CM4, however, like the Raspberry Pi 4, includes additional UARTs (up to 6 UARTs in total), SPI ports (up to 6 SPI ports in total, five of which are exposed on Pi 4 and CM4) and I2C ports (up to 6 x I2C). These are available as additional pin mux options on the GPIO Bank 0.

Further reading