• sales

    +86-0755-88291180

Raspberry Pi CM4-IO-BASE-C User Guide

Overview

This is the basic IO board of the 4th generation of Raspberry Pi Compute Module. CM4-IO-BASE-C is a carrier board that can be used with Raspberry Pi Compute Module 4. With a dedicated 40PIN LCD Connector, it also is easier and faster to be integrated into applications.

Note

1. Do not unplug any devices except USB and HDMI when powering on.
2. Only support fans with 5V, and 12V is not supported. Please check the voltage of the fan before connecting.
3. Only support LCD direct connection as there is not a DSI interface.
4. Type C interface can be used as the power supply or the USB SLAVE for programming images.
5. In order to ensure the power supply of the CM4, please do not connect to other devices when programming the images with the TypeC interface.
6. When using CM4, you must provide 5V 2A for it, otherwise, it may shut down, lower frequency or etc.
7. Please use the matching screws when using the M.2 interface as CM4 may be damaged if you use other screws.
8. The module does not have any protection, please do not short-circuit the power supply.
9. USB2.0 is closed by default, and you need to add "dtoverlay=dwc2,dr_mode=host" in "config.txt" when using.
10. This expansion board does not support POE function.

Onboard Resources


NumberNameDescription
1CM4 SocketFor all variants of Compute Module 4
2Power Supply/Programming Interface5V/2.5A power supply, or used as the eMMC programming interface
3LCD Interface40PIN LCD display port, for direct connection to 70H-1024600 series display
4FAN headerFor connecting to the cooling fan with 5V, support speed adjustment and measurement
5CAM InterfaceDual-channel MIPI CSI
6HDMI0 InterfaceHDMI interface, for supporting 4K 30fps output
7USB 2.0 Interface2-ch USB2.0 and support all kinds of USB devices
8Gigabit Ethernet portRJ45 Gigabit Ethernet port, support 10 / 100 / 1000M network access
9M.2 Interface IndicatorIndicating the working status
10PWR IndicatorIndicating the Raspberry Pi power status
11Status IndicatorsIndicating the working status of the Raspberry Pi
12BOOTJumper cap connected: CM4 Type C booting guide
Jumper cap not connected: eMMc or SD card booting guide
1340PIN GPIO HeaderFor connecting all kinds of HAT
14Micro SD Card InterfaceFor connecting to a Micro SD card with the system, only for the Lite version
15FE1.1SUSB HUB chip, expand USB interface to 4
16M.2 InterfaceFor NVIE SSD, or support PCIE M.2 communication module
17RTC ChipPCF85063 chip, can be used for RTC wake-up, shutdown, restart, or other functions
18RTC Interrupt SelectionPI-RUN:RTC triggers interrupt CM4 restarts
GN-EN:RTC trigger interrupt CM4 shutdown
D4:RTC trigger interrupt D4 pin trigger
19RTC Battery Connection SocketFor connecting to CR1220 button cells

Note

Do not plug and unplug any devices when powering on.

Image Programming

USB2.0

The USB port is disabled by default on the CM4 to save power. If you need to start, you need to add the following to the config.txt file:

 dtoverlay=dwc2,dr_mode=host

After restarting

If you use the latest Raspberry Pi OS (image after October 30, 2021) USB2.0 is OTG mode by default, CM4 will report an error:

 config failed, hub doesn't have any ports! (err -19)

However, USB can still be used. If you want to remove this error, remove otg_mode=1 in [cm4] of config.txt, and add dtoverlay=dwc2, dr_mode=host (USB cannot be recognized without adding it).


M.2

The M.2 interface type is M KEY, which only supports PCIE channel devices (including NVME solid state, etc.), and does not support SATA hard disks.

Some adapter cards are supported, and the PCIE channel is used. Some devices cannot be driven by the official Raspberry Pi image, and the kernel needs to be recompiled.

RTC FAN

RTC

sudo nano /boot/config.txt
 #Add the following lines at the end
 dtparam=i2c_vc=on
 dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi
 #Add # in front of dtparam=audio=on
 #dtparam=audio=on
 #Save and exit, restart
 sudo reboot

How to use Hwclock

Synchronize system clock to hardware clock

sudo hwclock -w

Synchronize hardware clock to system clock

sudo hwclock -s
 #The network needs to be closed, otherwise, it will be changed back.

Set the hardware clock time:

sudo hwclock --set --date="9/8/2021 16:45:05"

View hardware clock

sudo hwclock -r

Display version information

sudo hwclock --verbose

Fan

The fan PWM pin is connected to GPIO18.

LCD Interface

Interface Connection

  • Screen touch (USB): USB3
  • Backlight Enabled (BL_EN): GPIO17
  • Backlight Adjustment (BL_PWM): GPIO19

Schematic Diagram


CSI

CM4-IO-Base-C only has CSI but not DSI.

Configuration File

CSI and DSI are disabled by default. When using the camera and DSI, it will occupy three I2C devices: I2C-10, I2C-11, and I2C-0.

  • Open a terminal and run the following commands:
wget https://www.waveshare.com/w/upload/7/75/CM4_dt_blob_Source.zip
unzip -o  CM4_dt_blob_Source.zip -d ./CM4_dt_blob_Source
sudo chmod 777 -R CM4_dt_blob_Source
cd CM4_dt_blob_Source/
sudo  dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp0-double_cam.dts
#If you need to restore, please delete the corresponding dt-blob.bin: sudo rm -rf /boot/dt-blob.bin
# After execution, turn off the power and restart the CM4

Connect the cameras:
1: Please power off the IO Board first before your connection.
2: Connect the power adapter after connecting the cameras and DSI display.
3: Wait a few seconds before the screen boot up.
4: If the DSI LCD cannot display, please check if you have added /boot/dt-blob.bin. If there already has the dt-blob.bin, just try to reboot.

Old Version (Buster)

Run the "raspi-config" in the camera, choose Interfacing Options->Camera->Yes->Finish-Yes, reboot the system, open "enable camera", and then reboot to save the change.

  • Test the Cameras:

Test camera0:

sudo raspivid -t 0 -cs 0

Test camera1:

sudo raspivid -t 0 -cs 1

New Version (Bullseye)

If you are using the latest Raspberry Pi OS (Bullseye):

#Use dual cameras in the new system
#Remove "camera_auto_detect=1" in config.txt
#camera_auto_detect=1

#Add
dtoverlay=imx219,cam1
dtoverlay=imx219,cam0

#imx219 is the model of the camera sensor, and it also supports other sensors.
dtoverlay=ov5647,cam0
dtoverlay=imx219,cam0
dtoverlay=ov9281,cam0
dtoverlay=imx477,cam0
dtoverlay=imx519,cam0

#Then reboot
reboot

#Open the camera 
libcamera-hello -t 0
or
libcamera-hello

#Other commands:
#Check whether the camera is detected
libcamera-hello --list-cameras

#Open the corresponding camera for previewing 5 seconds
libcamera-hello  --camera 1
libcamera-hello  --camera 0

#Take a picture
libcamera-jpeg -o test.jpg

#Record a vedio
libcamera-vid -t 10000 -o test.h264

#You can add "--camera" to specify the camera
#-t <duration> allows the user to choose how long the window will be displayed in milliseconds.

More instructions click me

  • HDMI1 is disabled if you use DSI interfaces for displaying, even if you just compile the corresponding files without connecting to the DSI screen, please note it.
  • Any connection of two HDMI ports can output images, not limited to which HDMI port, if two HDMI screens are connected, only HDMI0 has image output.
  • If you want to enable both HDMI, please delete the dt-blob.bin file with the following command:
sudo rm -rf /boot/dt-blob.bin
  • Then reboot

Please refer to Raspberry Pi Manual