Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
Onboard 4-ch USB ports, Gigabit Ethernet port, headphone jack and PoE pin, Raspberry Pi CM4 To 3B Adapter is an alternative solution for Raspberry Pi 3 Model B/B+.
CM4-IO-BASE-B
Label | Name | Description | |
1 | micro USB | 5V/2.5A power supply, can also be used as eMMC programming interface. | |
2 | HDMI0 port | HDMI port, supports 4K 30fps output. | |
3 | CAM Interface | MIPI CSI Camera Interface. | |
4 | Audio Interface | 3.5mm Headphone Audio Interface, USB Audio Solution. | |
5 | Gigabit Ethernet port | RJ45 Gigabit Ethernet port, support 10 / 100 / 1000M network access. | |
6 | FAN port | Connect to a cooling fan, does not support speed regulation and speed measurement, only supports 5V fans. | |
7 | USB 2.0 interface | 4-way USB 2.0 interface, support various USB device insertion. | |
8 | POE | Support POE HAT access. | |
9 | 40PIN GPIO interface | Easy to connect various HAT modules. | |
10 | BOOT | ON: CM4 USB Type C boot boot OFF: eMMC or SD card boot. | |
11 | DISP1 interface | MIPI DSI display interface, DISP1 interface. | |
12 | LED Indicator | Indicates the working status of the Raspberry Pi. | |
13 | System function switch | BT_DIS: Bluetooth disabled, only for CM4 version with antenna WiFi_DIS: WiFi disabled, only for CM4 version with antenna WP_DIS: EEPROM write protection. | |
14 | IO-VREF selection | CM4 IO logic voltage switch 3.3V or 1.8V. | |
15 | Functional pin | RUN: CM4 running status pin GL-EN: Power supply enable pin. | |
16 | CM4 Connector | Applies to all versions of Compute Module 4. | |
17 | Micro SD card interface | For inserting Micro SD card with system, only for Lite version. |
Do not plug or unplug any device while it is powered on.
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).
NOTE DSI and CSI are prohibited when using RTC.
I2C-10 is used by default.
RTC (PCF85063a) on i2c-10, address is 0x51 (7-bit address)
sudo nano /boot/config.txt
#Add at the end
dtparam=i2c_vc=on
dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi
#Add # before dtparam=audio=on
#dtparam=audio=on
#Save and exit, restart
sudo reboot
Synchronize System Clock -> Hardware Clock
sudo hwclock -w
Synchronize hardware clock -> system clock
sudo hwclock -s
#Need to close the network, or disable the network to check the time, 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
The fan uses the GPIO18 (BCM) pin to control the switch
CSI and DSI is close by default. When using the camera and DSI, I2C-10, I2C-11 and I2C-0 are occupied. Execute the following commands after starting.
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-disp1-double_cam.dts #If you need to restore, delete the corresponding dt-blob.bin: sudo rm -rf /boot/dt-blob.bin # After execution, turn off the power and restart the CM4.
Then connect the camera and DSI screen:
1: Please connect them when power off.
2: Connect to the power.
3: Wait a few seconds for the screen to start up.
4: If it fails to start, check whether /boot/dt-blob.bin exists, and restart it if it exists.
The camera needs to run raspi-config, select Interfacing Options->Camera->Yes->Finish-Yes, reboot the system, open the enable camera, and then restart to save the changes.
Testing the Raspberry Pi Camera
View the camera image:
sudo raspivid -t 0 -cs 0
If using the latest Raspberry Pi OS (Bullseye):
#The new system uses dual cameras
#Remove camera_auto_detect=1 in config.txt
#camera_auto_detect=1
#Add to
dtoverlay=imx219,cam1
dtoverlay=imx219,cam0
#where imx219 is the camera sensor model, and there are other sensors
dtoverlay=ov5647,cam0
dtoverlay=imx219,cam0
dtoverlay=ov9281,cam0
dtoverlay=imx477,cam0
#then restart
reboot
#open camera
libcamera-hello -t 0
or
libcamera-hello
#Other part of the command:
#Check if the camera is detected
libcamera-hello --list-cameras
#Open the corresponding camera
libcamera-hello --camera 1
libcamera-hello --camera 0
#taking photos
libcamera-jpeg -o test.jpg
#You can add --camera to specify the camera
More instructions click me
Reference Raspberry Pi Manual