Raspberry Pi CM5 IoT In C - Setting Up the CM5
Written by Harry Fairhead   
Monday, 14 April 2025
Article Index
Raspberry Pi CM5 IoT In C - Setting Up the CM5
Installing Pi OS
Boot EPROM
Booting From NVMe

The CM5 with the CM5IO development board is slightly more complicated to set up than other members of the Pi family - find out more. This is an extract from the newly-published Raspberry Pi Compute Module 5 IoT In C

Raspberry Pi Compute Module 5
IoT In C
Using Linux
Drivers and Gpio5

By Harry Fairhead

CIoTCM5360
Buy from Amazon.

Contents

  1. The CM5 For The IoT
  2. Setting Up the CM5 ***NEW!!
  3. C and Visual Studio Code
  4. Drivers: A First Program
  5. The GPIO Character Drive
  6. GPIO Using I/O Control
  7. GPIO Events
  8. GPIO Hardware With Gpio5 
  9. Some Electronics
  10. The Device Tree
  11. Pulse Width Modulation
  12. SPI Devices
  13. I2C Driver and Gpio5
  14. Sensor Drivers – Linux IIO & hwmon
  15. 1-Wire Bus
  16. The PIO
  17. Going Further With Drivers
  18. Almost Real-Time Linux
  19. Appendix I Gpio5

 <ASIN:1871962951>

 

Setting Up the CM5

The CM5 is a little different to the other members of the Pi family and setting it up before you get started on software development is a little more complicated. In particular, you need to put a CM5 and a CM5IO together. If you haven’t bought a CM5 Lite then you have to find a way of installing the OS into the eMMC and there is the problem of how to deal with the boot loader stored in EPROM.

The CM5IO

Although you can use a CM4IO board with the CM5, new projects should always select the CM5IO board. It’s specification is given as:

  • HAT footprint with 40-pin GPIO connector

  • PoE header

  • 2× HDMI ports

  • 2× USB 3.0 ports

  • Gigabit Ethernet RJ45 with PoE support

  • M.2 M key PCIe socket compatible with the 2230, 2242, 2260, and 2280 form factors

  • MicroSD card slot (only for use with Lite variants with no eMMC; other variants ignore the slot)

  • 2× MIPI DSI/CSI-2 combined display/camera FPC connectors (22-pin 0.5 mm pitch cable)

  • Real-time clock with battery socket

  • 4-pin JST-SH PWM fan connector

  • USB-C power using the same standard as Raspberry Pi 5 (5V, 5A (25W) or 5V, 3A (15W) with a 600mA peripheral limit)

  • Jumpers to disable features such as eMMC boot, EEPROM write, and the USB OTG connection

cm6io
You can see the connectors and jumpers in the image above. They are mostly self explanatory, but there are a few things to note:

  • CAM/DISP 0 at the left is always ready to be used but CAM/DISP 1 needs two jumpers to be fitted to J6.

  • The GPIO connector, labeled Raspberry PI HAT on the board, can be used to fit a standard Pi 40-way HAT and there are four mounting holes to let you position the expansion cards.

  • You can select 1.8V or the standard 3.3V GPIO lines by moving the resistor at R5 to R4 – as this is a surface mount resistor it requires a soldering iron and skill.

  • The RTC battery holder takes a CR2032 battery and if fitted it supplies power to the onboard RTC.

  • The PoE Power over Ethernet connector J9 supplies the raw PoE signals and needs to be connected to a PoE hat to make use of it.

  • If the board has eMMC Flash installed then the SD card reader is ignored.

  • J2 at the top left of the board sets a number of useful defaults using jumpers:

 

 

 

Pin

Function

 

1-2

nRPIBOOT

If fitted, disables eMMC Boot

3-4

EEPROM_nWP

If fitted, write-protects the EEPROM

5-6

USB_OTG

If fitted, enables OTG mode

8

SYNC_OUT

IEEE1588 timing pin - can be configured as input

12

PMIC_ENABLE

Enable power control

13-14

Wake up

Connects a push button to wake up or shut down CM5

 



Last Updated ( Monday, 14 April 2025 )