Difference between revisions of "CM4-NANO-B"

From Waveshare Wiki
Jump to: navigation, search
 
(39 intermediate revisions by 3 users not shown)
Line 26: Line 26:
 
===Precautions===
 
===Precautions===
 
1.<font color="#ff0000"> DO NOT hot-plug any devices except the USB and HDMI.</font><br/>
 
1.<font color="#ff0000"> DO NOT hot-plug any devices except the USB and HDMI.</font><br/>
2. As the module does not have any protection, please do not short-circuit the power supply.<br/>
+
2. As the module does not have any protection, <font color="#ff0000">please do not short-circuit the power supply.</font><br/>
 
3. The USB Type-C interface can be used as a power supply or as a USB SLAVE interface to program the image.<br/>
 
3. The USB Type-C interface can be used as a power supply or as a USB SLAVE interface to program the image.<br/>
 
4. In order to ensure the normal power supply of the CM4, please do not connect other devices when using the USB Type-C interface to program the image.<br/>
 
4. In order to ensure the normal power supply of the CM4, please do not connect other devices when using the USB Type-C interface to program the image.<br/>
5. Providing 5V 2A for CM4 to ensure that it is in normal use. Otherwise, there may be problems such as automatic shutdown, frequency reduction and so on.<br/>
+
5. Providing 5V 2A for CM4 to ensure that it is in normal use. Otherwise, there may be problems such as automatic shutdown, frequency reduction, and so on.<br/>
6. <font color="#ff0000">The USB2.0, CSI, DSI and Audio interfaces are disabled by default and need to be enabled by the user. </font><br/>
+
6. The [[#USB2.0|USB2.0]], [[#CSI and DSI|CSI and DSI]] and [[#Audio Interface|Audio interface]] are <font color="#ff0000">disabled</font> by default and need to be enabled by the user. </font><br/>
 
7. The user key is connected to GPIO21 and pulled up to GPIO_VREF by R16 (10K). When the key is not pressed, GPIO21 is pulled high by default; when the key is pressed, the level of GPIO21 will be pulled down.
 
7. The user key is connected to GPIO21 and pulled up to GPIO_VREF by R16 (10K). When the key is not pressed, GPIO21 is pulled high by default; when the key is pressed, the level of GPIO21 will be pulled down.
  
Line 45: Line 45:
 
|-style="background:#00eecc; color:blue;" align="center"
 
|-style="background:#00eecc; color:blue;" align="center"
 
|-align="center"
 
|-align="center"
|1||CM4 socket||suitable for all variants of Compute Module 4
+
|1||CM4 Socket||suitable for all variants of Compute Module 4
 
|-align="center"
 
|-align="center"
|style="width:66px"|2||Micro SD card interface||For inserting a Micro SD card with the system, only for Lite version
+
|style="width:66px"|2||Micro SD Card Slot||For inserting a Micro SD card with the system, only for the Lite version
 
|-align="center"
 
|-align="center"
|3||40PIN GPIO interface||Easy access to various HAT modules
+
|3||40PIN GPIO header||Easy access to various HAT modules
 
|-align="center"
 
|-align="center"
|4||Ethernet port||RJ45 Gigabit Ethernet port, support 10 / 100 / 1000M network access
+
|4||Ethernet Port||RJ45 Gigabit Ethernet port, support 10 / 100 / 1000M network access
 
|-align="center"
 
|-align="center"
|5||Power supply/burning interface||5V/2A power supply, can also be used as eMMC programming interface
+
|5||Power Supply/Burning Interface||5V/2A power supply, can also be used as an eMMC programming interface
 
|-align="center"
 
|-align="center"
 
|6||Audio Interface||3.5mm audio interface
 
|6||Audio Interface||3.5mm audio interface
 
|-align="center"
 
|-align="center"
|7||User button||User can program key function, connect to GPIO21  
+
|7||User Button||User can program key function, connect to GPIO21  
 
|-align="center"
 
|-align="center"
 
|8||USB2.0||Indicates the working status of the Raspberry Pi
 
|8||USB2.0||Indicates the working status of the Raspberry Pi
 
|-align="center"
 
|-align="center"
|9||CAM interface||MIPI CSI camera interface, connect with CM4 CSI0 interface
+
|9||CAM Interface||MIPI CSI camera interface, connect with CM4 CSI0 interface
 
|-align="center"
 
|-align="center"
 
|10||DSI||MIPI DSI display interface, connect with CM4 DSI1 interface
 
|10||DSI||MIPI DSI display interface, connect with CM4 DSI1 interface
 
|-align="center"
 
|-align="center"
|11||DC buck circuit||DC buck circuit to power 3.3V for DSI, CSI and GPIO
+
|11||DC Buck Circuit||DC buck circuit to power 3.3V for DSI, CSI and GPIO
 
|-align="center"
 
|-align="center"
 
|12||MINI HDMI||HDMI interface, support 4K 30fps output
 
|12||MINI HDMI||HDMI interface, support 4K 30fps output
Line 74: Line 74:
  
 
= Usage Introduction =
 
= Usage Introduction =
===Writing Image===
+
==Writing Image==
 
*According to the version of CM4 you are using, the image programming can be divided into two versions: EMMC and LITE. Please choose the version below according to your CM4 to watch.
 
*According to the version of CM4 you are using, the image programming can be divided into two versions: EMMC and LITE. Please choose the version below according to your CM4 to watch.
*[[Write Image for Compute Module Boards eMMC version]]
+
*[[Write Image for Compute Module Boards eMMC version]].
*[[Wrote Image for Compute Module Boards Lite version |Write Image for Compute Module Boards Lite version]]
+
*[[Wrote Image for Compute Module Boards Lite version |Write Image for Compute Module Boards Lite version]].
  
===USB2.0===
+
==USB2.0==
====USB enable configuration====
+
===USB enable configuration===
*The USB port is disabled by default on the CM4 to save power.
+
*The USB port is <font color="#FF0000">disabled</font> by default on the CM4 to save power.
 
*It is recommended to directly open the config.txt file in the boot drive letter after the programming is completed, and add the following content:
 
*It is recommended to directly open the config.txt file in the boot drive letter after the programming is completed, and add the following content:
 
  dtoverlay=dwc2,dr_mode=host
 
  dtoverlay=dwc2,dr_mode=host
 
*After saving the file, start the machine according to the normal process
 
*After saving the file, start the machine according to the normal process
====USB-OTG Mode====
+
 
*If you use the latest Raspberry Pi OS (image after October 30, 2021) and USB2.0 is in OTG mode by default, CM4 will report an error.
+
===USB-OTG Mode===
 +
*''' If you use the latest Raspberry Pi OS (image after October 30, 2021) and USB2.0 is in OTG mode by default, CM4 will report an error.'''
 
  config failed, hub doesn't have any ports! (err -19)
 
  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).
+
*''' 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).'''
 
[[File:usbotg.png]]
 
[[File:usbotg.png]]
  
===CSI and DSI===
+
==CSI and DSI==
====Configuration====
+
===Configuration===
*Due to CSI and DSI are disabled by default, we need to load the device tree to enable, and I2C-10, I2C-11, and I2C-0, will be occupied when using the CSI camera and DSI screen.<br/>
+
*Due to CSI and DSI being disabled by default, we need to load the device tree to enable, I2C-10, I2C-11, and I2C-0 will be occupied when using the CSI camera and DSI screen.<br/>
 
*Enter the following command:<br/>
 
*Enter the following command:<br/>
 
<pre>
 
<pre>
sudo apt-get install p7zip-full
+
sudo apt-get install p7zip-full -y
wget https://www.waveshare.com/w/upload/4/41/CM4_dt_blob.7z
+
wget https://files.waveshare.com/upload/4/41/CM4_dt_blob.7z
 
7z x CM4_dt_blob.7z -O./CM4_dt_blob
 
7z x CM4_dt_blob.7z -O./CM4_dt_blob
 
sudo chmod 777 -R CM4_dt_blob
 
sudo chmod 777 -R CM4_dt_blob
 
cd CM4_dt_blob/
 
cd CM4_dt_blob/
# if using two cameras and DSI1, execute
+
# If using two cameras and DSI1, execute
sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp1-double_cam.dts
+
sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp1-double_cam.dts
 
#When using any DSI, HDMI1 has no image output, even if you do not connect the DSI screen, as long as the corresponding file is compiled, then HDMI1 will not output.
 
#When using any DSI, HDMI1 has no image output, even if you do not connect the DSI screen, as long as the corresponding file is compiled, then HDMI1 will not output.
 
#If you need to restore, delete the corresponding dt-blob.bin: sudo rm -rf /boot/dt-blob.bin
 
#If you need to restore, delete the corresponding dt-blob.bin: sudo rm -rf /boot/dt-blob.bin
Line 108: Line 109:
 
</pre>
 
</pre>
  
====Enable CSI Camera====
+
==New Version System (Bullseye)==
 +
===Camera Config===
 +
<ol>
 +
<li>Execute the following commands to edit the "/boot/config.txt" file.</li>
 +
<pre>sudo nano /boot/config.txt</pre>
 +
<li>Block or delete the camera auto-detect sentence.</li>
 +
[[File:CM4-NANO-B02.png]]<br/>
 +
<li>Add the driver of the camera you used. Here I take IMX219 as an example, connect to CAM0, and attach the adapter.</li>
 +
[[File:CM4-NANO-B03.png]]<br/>
 +
{|border=1; style="width:600px;"
 +
|-style="background:green; color:white;" align="center"
 +
! Model !! CAM0 Setting Sentence !! CAM1 Setting Sentence
 +
|-
 +
| OV9281 || dtoverlay=ov9281,cam0 || dtoverlay=ov9281,cam1
 +
|-
 +
| IMX290/IMX327 || dtoverlay=imx290,clock-frequency=37125000,cam0 || dtoverlay=imx290,clock-frequency=37125000,cam1
 +
|-
 +
| IMX378 || dtoverlay=imx378,cam0 || dtoverlay=imx378,cam1
 +
|-
 +
| IMX219 || dtoverlay=imx219,cam0 || dtoverlay=imx219,cam1
 +
|-
 +
| IMX477 || dtoverlay=imx477,cam0 || dtoverlay=imx477,cam1
 +
|}
 +
*If the camera you are using is the official Raspberry Pi camera and there only is one camera connected, you do not need to set up the config file.
 +
*CM4-NANO only uses CAM0, so you only need to add "dtoverlay=imx219,cam0".
 +
<li>Ctrl+o to save the file and press Enter.</li>
 +
[[File:CM4-NANO-B04.png]]<br/>
 +
<li>Ctrl+x to exit the editer.</li>
 +
<li>Reboot CM4.</li>
 +
<pre>sudo reboot</pre>
 +
</ol>
 +
 
 +
===Test Camera===
 +
<ol>
 +
<li>Input the camera detecting commands, and you can see the camera is detected.</li><pre>libcamera-hello --list-cameras</pre>
 +
[[File:CM4-NANO-B05.png]]<br/>
 +
<li>Display the camera pictures on the desktop:</li>
 +
<pre>libcamera-hello -t</pre>
 +
<li>Take a photo:</li>
 +
<pre>libcamera-vid -t 10000 -o test.h264</pre>
 +
<li>Record a 10s video:</li>
 +
<pre>libcamera-vid -t 10000 -o test.h264</pre>
 +
</ol>
 +
 
 +
==Old Version (Buster)==
 +
===Configure Camera===
 +
<!--
 
*Make sure to connect the CSI camera and DSI screen in a power-off state, <font color="#FF0000">otherwise the equipment may be damaged.</font>
 
*Make sure to connect the CSI camera and DSI screen in a power-off state, <font color="#FF0000">otherwise the equipment may be damaged.</font>
 
*In addition to modifying the device tree, the CSI camera also needs to be set to enable the camera function.
 
*In addition to modifying the device tree, the CSI camera also needs to be set to enable the camera function.
'''Old version (buster)'''<br/>
+
-->
1. Execute the following command to enter the Raspberry Pi configuration.<br/>
+
<ol>
sudo raspi-config
+
<li>Execute the following command to enter the Raspberry Pi configuration.</li>
2. Choose Interfacing Options and enter.<br/>
+
<pre>sudo raspi-config</pre>
 +
<li>Choose Interfacing Options and enter.</li>
 
[[File:interface.png|650px]]<br/>
 
[[File:interface.png|650px]]<br/>
3.Choose Camera<br/>
+
<li>Choose Camera:</li>
 
[[File:camera.png|650px]]<br/>
 
[[File:camera.png|650px]]<br/>
4.Choose to open the camera interface.<br/>
+
<li>Choose to open the camera interface.</li>
 
[[File:camera2.png|650px]]<br/>
 
[[File:camera2.png|650px]]<br/>
5.The system prompts as follows:<br/>
+
<li>The system prompts as follows:</li>
 
[[File:Prompt.png|650px]]<br/>
 
[[File:Prompt.png|650px]]<br/>
6.Back to the main interface, select Finish.<br/>
+
<li>Back to the main interface, select Finish.</li>
 
[[File:Finish.png|650px]]<br/>
 
[[File:Finish.png|650px]]<br/>
7.Reboot the system<br/>
+
<li>Reboot the system.</li>
 
[[File:Finish2.png|650px]]<br/>
 
[[File:Finish2.png|650px]]<br/>
*Test the camera function:
+
 
 +
===Camera Test===
 +
*Take a photo:
 
<pre>
 
<pre>
raspistill -o image.jpg
+
raspistill -o image.jpg
 
</pre>
 
</pre>
 
*Test the recording function:
 
*Test the recording function:
 
<pre>
 
<pre>
  raspivid -o video.h264 -t 10000
+
raspivid -o video.h264 -t 10000
 
</pre>
 
</pre>
 
**Where -t 10000 means recording for 10 seconds, users can adjust according to their own needs.
 
**Where -t 10000 means recording for 10 seconds, users can adjust according to their own needs.
 
**Please refer to [https://www.raspberrypi.com/documentation/computers/compute-module.html CSI].<br/>
 
**Please refer to [https://www.raspberrypi.com/documentation/computers/compute-module.html CSI].<br/>
 +
<!--
 
'''New version (bullseye)'''<br/>
 
'''New version (bullseye)'''<br/>
 
1. Execute the following command to enter the Raspberry Pi configuration.<br/>
 
1. Execute the following command to enter the Raspberry Pi configuration.<br/>
Line 141: Line 192:
 
2. Block or delete the automatic camera detection sentence.<br/>
 
2. Block or delete the automatic camera detection sentence.<br/>
 
[[File:CM4-NANO-B002.png|650px]]<br/>
 
[[File:CM4-NANO-B002.png|650px]]<br/>
3. Add the driver of the camera you use, here I take IMX219 as an example, and connect it to CAM0, and attach the adapter.<br/>
+
3. Add the driver of the camera you use, here I take IMX219 as an example, connect it to CAM0, and attach the adapter.<br/>
 
[[File:CM4-NANO-B003.png|650px]]<br/>
 
[[File:CM4-NANO-B003.png|650px]]<br/>
  
Line 159: Line 210:
 
|}
 
|}
 
*CM4-NANO- only uses CAM0, so just add a sentence "dtoverlay=imx219,cam0".
 
*CM4-NANO- only uses CAM0, so just add a sentence "dtoverlay=imx219,cam0".
4. Ctrl+o to save the file and press Enter<br/>
+
4. Ctrl+o to save the file and press Enter.<br/>
 
[[File:CM4-NANO-B004.png|650px]]<br/>
 
[[File:CM4-NANO-B004.png|650px]]<br/>
 
5. Ctrl+x to exit the editor.<br/>
 
5. Ctrl+x to exit the editor.<br/>
Line 172: Line 223:
  
 
[[File:CM4-NANO-B005.png|650px]]<br/>
 
[[File:CM4-NANO-B005.png|650px]]<br/>
8. Display the camera screen to the desktop.
+
8. Display the camera screen on the desktop.
 
<pre>
 
<pre>
 
libcamera-hello -t
 
libcamera-hello -t
Line 184: Line 235:
 
libcamera-vid -t 10000 -o test.h264
 
libcamera-vid -t 10000 -o test.h264
 
</pre>
 
</pre>
 +
-->
  
===Audio Interface===
+
==Audio Jack==
*The Audio of this device uses GPIO. If you use GPIO18 and GPIO19, you need to enable via the configuration file.<br/>
+
*The Audio of this device uses GPIO. If you use GPIO18 and GPIO19, you need to enable it via the configuration file.<br/>
 
1. Edit config.txt.<br/>
 
1. Edit config.txt.<br/>
 
  sudo nano /boot/config.txt
 
  sudo nano /boot/config.txt
2.Add the following content at the bottom.<br/>
+
2. Add the following content at the bottom.<br/>
 
  dtparam=audio=on
 
  dtparam=audio=on
 
  dtoverlay=audremap,pins_18_19
 
  dtoverlay=audremap,pins_18_19
3.Reboot the CM4
+
3. Reboot the CM4.
 
  sudo reboot
 
  sudo reboot
4.Enter to the graphical interface, right-click the volume icon, and select AV Jack.<br/>
+
4. Enter the graphical interface, right-click the volume icon, and select AV Jack.<br/>
 
[[File:avjack.png]]
 
[[File:avjack.png]]
**PS: When switching to Audio interface, the audio output of HDMI will stop.
+
*PS: When switching to the Audio interface, the audio output of HDMI will stop.
 +
</ol>
  
 
= Resources =
 
= Resources =
===Datasheet===
+
==Datasheet==
*[https://datasheets.raspberrypi.org/cm4/cm4-datasheet.pdf CM4 Datasheet]<br>
+
*[https://files.waveshare.com/upload/f/f5/CM4-NANO-B-SCH.pdf CM4 Datasheet]<br>
  
===Schematic===
+
==Schematic==
*[https://www.waveshare.net/w/upload/f/f5/CM4-NANO-B-SCH.pdf CM4-NANO-B]<br>
+
*[https://files.waveshare.com/upload/f/f5/CM4-NANO-B-SCH.pdf CM4-NANO-B]<br>
 +
 +
==3D Graphics==
 +
*[https://files.waveshare.com/upload/2/23/CM4-NANO-B-STEP.zip CM4-NANO-B STEP]<br>
 +
<!--*[https://www.printables.com/model/212502-modular-enclosure-compatible-w-cm4-nano-b-base-boa STL for 3D print case (shared by Markus)]
 +
*[https://www.printables.com/de/model/325480-case-for-raspberry-pi-cm4-on-waveshare-nanobase-b 3D pint case (shared by Stefan)]
 +
-->
  
===3D Graphics===
+
==Software==
*[https://www.waveshare.net/w/upload/2/23/CM4-NANO-B-STEP.zip CM4-NANO-B STEP]<br>
+
*[https://files.waveshare.com/upload/d/d7/Panasonic_SDFormatter.zip Panasonic_SDFormatter-Formatting SD card]
*[https://www.printables.com/model/212502-modular-enclosure-compatible-w-cm4-nano-b-base-boa STL for 3D print case (shared by Markus)]
+
*[https://files.waveshare.com/upload/7/76/Win32DiskImager.zip Win32DiskImager]
 +
*[https://files.waveshare.com/upload/5/56/Putty.zip Putty]
 +
*[https://files.waveshare.com/upload/f/f3/Rpiboot_setup.zip RPiboot_Setup]
 +
=FAQ=
 +
{{FAQ|On the CM4-NANO-B, are Ethernet_SYNC_IN and/or Ethernet_SYNC_OUT available?
 +
|
 +
No, Didn't connect out Ethernet_SYNC_OUT on CM4-NANO-B.
 +
||}}
  
===Software===
+
=Support=
*[https://{{SERVERNAME}}/w/upload/f/f3/Rpiboot_setup.zip RPiboot_Setup]<br>
+
{{Servicebox1}}
*[https://{{SERVERNAME}}/w/upload/d/d7/Panasonic_SDFormatter.zip Panasonic_SDFormatter]
 
*[https://{{SERVERNAME}}/w/upload/7/76/Win32DiskImager.zip Win32DiskImager]
 
*[https://{{SERVERNAME}}/w/upload/5/56/Putty.zip putty]
 
{{service00}}
 

Latest revision as of 09:34, 25 January 2024

CM4-NANO-B
CM4-NANO-B.png
Compute-Module-4.png

{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Overview

Introduction

CM4-NANO-B (Raspberry Pi CM4 Ultra Mini Expansion Board Type B) is a baseboard that can be used with Raspberry Pi Compute Module 4. Although it is tiny, it can bring out the interface of Raspberry Pi Compute Module 4.

Precautions

1. DO NOT hot-plug any devices except the USB and HDMI.
2. As the module does not have any protection, please do not short-circuit the power supply.
3. The USB Type-C interface can be used as a power supply or as a USB SLAVE interface to program the image.
4. In order to ensure the normal power supply of the CM4, please do not connect other devices when using the USB Type-C interface to program the image.
5. Providing 5V 2A for CM4 to ensure that it is in normal use. Otherwise, there may be problems such as automatic shutdown, frequency reduction, and so on.
6. The USB2.0, CSI and DSI and Audio interface are disabled by default and need to be enabled by the user.
7. The user key is connected to GPIO21 and pulled up to GPIO_VREF by R16 (10K). When the key is not pressed, GPIO21 is pulled high by default; when the key is pressed, the level of GPIO21 will be pulled down.

Dimension

CM4-NANO-B

Cm4nanob.png

Compute_Module 4

Cm4module.png

Onboard Resources

Onboar.png

Label Name Description
1 CM4 Socket suitable for all variants of Compute Module 4
2 Micro SD Card Slot For inserting a Micro SD card with the system, only for the Lite version
3 40PIN GPIO header Easy access to various HAT modules
4 Ethernet Port RJ45 Gigabit Ethernet port, support 10 / 100 / 1000M network access
5 Power Supply/Burning Interface 5V/2A power supply, can also be used as an eMMC programming interface
6 Audio Interface 3.5mm audio interface
7 User Button User can program key function, connect to GPIO21
8 USB2.0 Indicates the working status of the Raspberry Pi
9 CAM Interface MIPI CSI camera interface, connect with CM4 CSI0 interface
10 DSI MIPI DSI display interface, connect with CM4 DSI1 interface
11 DC Buck Circuit DC buck circuit to power 3.3V for DSI, CSI and GPIO
12 MINI HDMI HDMI interface, support 4K 30fps output
13 BOOT ON: Switch the USB to type C interface, and enter the download mode when powered on (configured as a large-capacity disk through rpi boot)

OFF: Switch the USB to TYPE A interface, it will not enter the download when powered on (start from eMMC or SD card)

Usage Introduction

Writing Image

USB2.0

USB enable configuration

  • The USB port is disabled by default on the CM4 to save power.
  • It is recommended to directly open the config.txt file in the boot drive letter after the programming is completed, and add the following content:
dtoverlay=dwc2,dr_mode=host
  • After saving the file, start the machine according to the normal process

USB-OTG Mode

  • If you use the latest Raspberry Pi OS (image after October 30, 2021) and USB2.0 is in 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).

Usbotg.png

CSI and DSI

Configuration

  • Due to CSI and DSI being disabled by default, we need to load the device tree to enable, I2C-10, I2C-11, and I2C-0 will be occupied when using the CSI camera and DSI screen.
  • Enter the following command:
sudo apt-get install p7zip-full -y
wget https://files.waveshare.com/upload/4/41/CM4_dt_blob.7z
7z x CM4_dt_blob.7z -O./CM4_dt_blob
sudo chmod 777 -R CM4_dt_blob
cd CM4_dt_blob/
# If using two cameras and DSI1, execute
sudo  dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp1-double_cam.dts
#When using any DSI, HDMI1 has no image output, even if you do not connect the DSI screen, as long as the corresponding file is compiled, then HDMI1 will not output.
#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.

New Version System (Bullseye)

Camera Config

  1. Execute the following commands to edit the "/boot/config.txt" file.
  2. sudo nano /boot/config.txt
  3. Block or delete the camera auto-detect sentence.
  4. CM4-NANO-B02.png
  5. Add the driver of the camera you used. Here I take IMX219 as an example, connect to CAM0, and attach the adapter.
  6. CM4-NANO-B03.png
    Model CAM0 Setting Sentence CAM1 Setting Sentence
    OV9281 dtoverlay=ov9281,cam0 dtoverlay=ov9281,cam1
    IMX290/IMX327 dtoverlay=imx290,clock-frequency=37125000,cam0 dtoverlay=imx290,clock-frequency=37125000,cam1
    IMX378 dtoverlay=imx378,cam0 dtoverlay=imx378,cam1
    IMX219 dtoverlay=imx219,cam0 dtoverlay=imx219,cam1
    IMX477 dtoverlay=imx477,cam0 dtoverlay=imx477,cam1
    • If the camera you are using is the official Raspberry Pi camera and there only is one camera connected, you do not need to set up the config file.
    • CM4-NANO only uses CAM0, so you only need to add "dtoverlay=imx219,cam0".
  7. Ctrl+o to save the file and press Enter.
  8. CM4-NANO-B04.png
  9. Ctrl+x to exit the editer.
  10. Reboot CM4.
  11. sudo reboot

Test Camera

  1. Input the camera detecting commands, and you can see the camera is detected.
  2. libcamera-hello --list-cameras

    CM4-NANO-B05.png

  3. Display the camera pictures on the desktop:
  4. libcamera-hello -t
  5. Take a photo:
  6. libcamera-vid -t 10000 -o test.h264
  7. Record a 10s video:
  8. libcamera-vid -t 10000 -o test.h264

Old Version (Buster)

Configure Camera

  1. Execute the following command to enter the Raspberry Pi configuration.
  2. sudo raspi-config
  3. Choose Interfacing Options and enter.
  4. Interface.png
  5. Choose Camera:
  6. Camera.png
  7. Choose to open the camera interface.
  8. Camera2.png
  9. The system prompts as follows:
  10. Prompt.png
  11. Back to the main interface, select Finish.
  12. Finish.png
  13. Reboot the system.
  14. Finish2.png

    Camera Test

    • Take a photo:
    raspistill -o image.jpg
    
    • Test the recording function:
    raspivid -o video.h264 -t 10000
    
      • Where -t 10000 means recording for 10 seconds, users can adjust according to their own needs.
      • Please refer to CSI.

    Audio Jack

    • The Audio of this device uses GPIO. If you use GPIO18 and GPIO19, you need to enable it via the configuration file.

    1. Edit config.txt.

    sudo nano /boot/config.txt
    

    2. Add the following content at the bottom.

    dtparam=audio=on
    dtoverlay=audremap,pins_18_19
    

    3. Reboot the CM4.

    sudo reboot
    

    4. Enter the graphical interface, right-click the volume icon, and select AV Jack.
    Avjack.png

    • PS: When switching to the Audio interface, the audio output of HDMI will stop.

Resources

Datasheet

Schematic

3D Graphics

Software

FAQ

 Answer:

No, Didn't connect out Ethernet_SYNC_OUT on CM4-NANO-B.

{{{5}}}


Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 AM GMT+8 (Monday to Friday)