Difference between revisions of "CM4-IO-BASE-B"

From Waveshare Wiki
Jump to: navigation, search
Line 119: Line 119:
  
 
===Software===
 
===Software===
*[https://www.waveshare.com/w/upload/5/5b/CM4-IO-BASE_SchDoc.pdf]<br>
 
 
*[https://{{SERVERNAME}}/w/upload/d/d7/Panasonic_SDFormatter.zip Panasonic_SDFormatter-Formatting SD card]
 
*[https://{{SERVERNAME}}/w/upload/d/d7/Panasonic_SDFormatter.zip Panasonic_SDFormatter-Formatting SD card]
 
*[https://{{SERVERNAME}}/w/upload/7/76/Win32DiskImager.zip Win32DiskImager-Writing SD card]
 
*[https://{{SERVERNAME}}/w/upload/7/76/Win32DiskImager.zip Win32DiskImager-Writing SD card]

Revision as of 10:09, 14 August 2021

CM4-IO-BASE-B
Compute Module PoE Board
Compute Module 4


Mini Base Board, Composite Breakout Board for Developing with Raspberry Pi CM4 / CM4L
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Overview

Mini Base Board (B) Designed For Raspberry Pi Compute Module 4

Note

1: This model only support 5V fan and cannot work with the 12V fan. Please confirm the fan voltage before connecting.
2: The DSI Display Port is connecting the DSI0 interface of the CM4, and doesn't use the DSI1 display interface.
3: The Type C interface can be used for power supply or USB SLAVE interface for burning the image.
4: In order to ensure the normal power supply of CM4, please do not connect other devices when using the Type C interface to burn the image.
5: It needs to use a 5V 2A power supply for CM4. Otherwise, problems such as automatic shutdown, frequency reduction, etc. may occur.
6: When using the M.2 interface, please use the matching screws. Using screws of other lengths may cause the CM4 core to be damaged by the screws.
7: The module doesn't have any protection circuit, please do not short-circuit the power supply.
8: USB2.0 is closed by default, if you need to open it, you need to add dtoverlay=dwc2,dr_mode=host in config.txt.
9.HDMI1 uses a flat cable output, if you need to use it, you can purchase an HDMI adapter.
10.This expansion board does not support POE function.

Dimension

CM4-IO-BASE-B
CM4-IO-BASE-B-details-size.jpg
Compute_Module 4 Core board
Compute Module 4 IO Board 5.png

What's on board

CM4-IO-BASE-B-details-intro.jpg


No. Component Description
1 CM4 connector Suitable for all versions of Compute Module 4
2 DC power supply/programming interface 5V/2.5A power supply, also can be used as eMMC programming interface
3 DISP Interface MIPI DSI Display interface
4 FAN Interface For connecting cooling fan, allows speed adjustment and measuremen, only support 5V fan.
5 CAM Interface Dual MIPI CSI camera interface
6 HDMI0 Interface HDMI Interface,Support 4K 30fps output
7 USB 2.0 Interface 2-channel USB 2.0 Interface, for connecting sorts of USB devices
8 Gigabit Ethernet Gigabit Ethernet RJ45 connector, with 10 / 100 / 1000M network support
9 M.2 indicators Indicating the operating status of M.2 interface
10 ACT indicators Raspberry Pi operating status indicator
11 PWR indicators Raspberry Pi power indicator
12 BOOT selection jumper shorted: CM4 would be booted from USB-C interface
jumper opened: CM4 would be booted from eMMC or Micro SD card
13 40PIN GPIO Interface Conveniently connect various HAT modules
14 Micro SD Card interface For connecting a Micro SD card with pre-burnt image (Lite variant ONLY).
15 HDMI1 interface HDMI1 Interface,Support 4K 30fps output
16 USB 2.0 interface Can be connected through an adapter
17 FE1.1S USB HUB chip, expanding one USB port to 4x ports
18 M.2 Interface Supports sorts of NVME SSD, or communication modules with PCIE M.2 KEY-M interface
19 RTC Allows RTC-related functions like wakeup, shutdown, reboot, and more
20 RTC interrupt pin switch PI-RUN: CM4 reboot on RTC interruption
GN-EN: CM4 shutdown on RTC interruption
D4: D4 pin is triggered on RTC interruption
21 EMC2301 Fan controller, for speed adjustment / measurement
22 RTC Battery connector Can be connected to CR1220 button battery



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).
CM4 Burn EMMC 12.png

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.
M2.png
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

  • Note: Please connect the fan before turning on the power of the base board and then complete the test. Please do not connect the fan after the base board is powered on, because the fan control chip has been powered on, otherwise, the chip will be burned!
  • Note: Before connecting, please confirm whether the rated voltage of the fan is consistent with the voltage actually connected to the fan.

Please note that 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)
FAN ( EMC2301 ) on i2c-10, address is 0x2f (7-bit address)

If you need to add it to your program instead of the kernel, you can refer to the C and Python demo reference click here.

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 or the NTP 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

When powered on, the fan will spin for 1 second, then stop for 2 seconds, and then spin again, this is a normal phenomenon.
There is no official configuration method for the fan currently, there is a third-party configuration method: https://github.com/neg2led/cm4io-fan
This method is published by a third party, and we are not responsible for any problems!

sudo apt-get install dkms 
mkdir -p ~/src
cd ~/src
git clone https://github.com/neg2led/cm4io-fan.git
cd cm4io-fan
sudo chmod 777 install.sh
sudo  ./install.sh

#If an error message appears: Your kernel headers for kernel 5.XX.XX-v7l+ cannot be found at
#After rebooting the device, you can execute it

#The following is the description of config.txt
#############################
Name:   cm4io-fan
Info:   Raspberry Pi Compute Module 4 IO Board fan controller
Load:   dtoverlay=cm4io-fan,<param>[=<val>]
Params: minrpm             RPM target for the fan when the SoC is below 
                            mintemp (default 3500)
        maxrpm              RPM target for the fan when the SoC is above
                            maxtemp (default 5500)
        midtemp             Temperature (in millicelcius) at which the fan
                            begins to speed up (default 50000)
        midtemp_hyst        Temperature delta (in millicelcius) below mintemp
                            at which the fan will drop to minrpm (default 2000)
        maxtemp             Temperature (in millicelcius) at which the fan 
                            will be held at maxrpm (default 70000)
        maxtemp_hyst        Temperature delta (in millicelcius) below maxtemp
                            at which the fan begins to slow down (default 2000)
#############################

Or directly refer to the following:

dtoverlay=cm4io-fan,minrpm=500,maxrpm=5000,midtemp=45000,midtemp_hyst=2000,maxtemp=50000,maxtemp_hyst=2000

The fan will start to accelerate when the temperature is higher than 45 degrees Celsius, and will up to the highest speed when higher than 50 degrees Celsius.

CSI DSI

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://files.waveshare.com/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/
 #If you want to use both cameras and DSI0
 sudo  dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp0-double_cam.dts
 #If you want to ue both cameras and DSI1
 sudo  dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp1-double_cam.dts
 #When using any DSI interface, HDMI1 will have no image output, even if you do not connect the DSI screen, as long as you compile the corresponding file, then HDMI1 will not output
  #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

Recording test

And then connect the cameras and DSI display.
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)

The camera needs to be enabled by raspi-config, enter sudo raspi-config on the terminal, choose Interfacing Options -> Camera -> Yes -> Finish -> Yes, and reboot the system.

  • 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 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.





Support

If you require technical support, please go to the Support page and open a ticket.
If it is a technical problem, you can contact me directly:
https://join.skype.com/invite/WI7vBbbvPf98