Difference between revisions of "CM4-NANO-A"

From Waveshare Wiki
Jump to: navigation, search
m (Text replacement - "https://www.waveshare.com/w/upload/" to "https://files.waveshare.com/upload/")
 
(36 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
<div class="wiki-pages jet-green-color">
 
{{Infobox item
 
{{Infobox item
 
|name = CM4-NANO-A-4
 
|name = CM4-NANO-A-4
|img=[[File:CM4-NANO-A-4.jpg|250px|link=https://www.waveshare.com/cm4-nano-a.htm]]
+
|img=[[File:CM4-NANO-A-4.jpg|250px|{{Amazon_nolink|default={{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}|url=link=https://www.waveshare.com/cm4-nano-a.htm}}]]
 
|platform=Supports various systems
 
|platform=Supports various systems
 
|category=[[:Category:Raspberry Pi|Compute Module]]
 
|category=[[:Category:Raspberry Pi|Compute Module]]
Line 18: Line 19:
 
*[[Compute Module PoE 4G Board]]
 
*[[Compute Module PoE 4G Board]]
 
}}
 
}}
<div class="tabber">
+
= Introduction =
<div class="tabbertab" title="Introduction">
+
==Description==
== Introduction ==
+
CM4-NANO-A is the mini board of Raspberry Pi Compute Module 4, which is a baseboard of Raspberry Pi Compute Module 4 with a 5V/2.5A USB Type C interface.
  
 
+
==Precautions==
===Product description===
+
#<font color="#ff0000">DO NOT plug and unplug any device other than USB while it is powered on.</font>
CM4-NANO-A is a 4th generation mini board of Raspberry Pi Compute Module, which is a baseboard of Raspberry Pi Compute Module 4, 5V/ 2.5A  USB Type C  power supply interface.
 
 
 
===Precautions for use===
 
#<font color="#ff0000">DO NOT plug and unplug any device other than USB while it is powered on</font>
 
 
#The Type C interface can be used as a power supply or as a USB SLAVE interface to burn the image.  
 
#The Type C interface can be used as a power supply or as a USB SLAVE interface to burn the image.  
 
#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.  
 
#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.  
 
#When CM4 is in normal use, it needs to provide 5V 2A power supply for CM4. Otherwise, there may be problems such as shutdown, frequency reduction, and so on.  
 
#When CM4 is in normal use, it needs to provide 5V 2A power supply for CM4. Otherwise, there may be problems such as shutdown, frequency reduction, and so on.  
#Since the module does not have any protection circuit, please do not short-circuit the power supply  
+
#Since the module does not have any protection circuit, please do not short-circuit the power supply.
#<font color="#ff0000">USB2.0 is disabled by default, if you want to open it, you need to add the line ''dtoverlay=dwc2,dr_mode=host'' to the config.txt file</font>
+
#<font color="#ff0000">USB2.0 is disabled by default, if you want to open it, you need to add the line ''dtoverlay=dwc2,dr_mode=host'' to the config.txt file.</font>
  
===Product Size===
+
==Dimension==
 
[[File:CM4-NANO-A-details-intro.jpg|800px]]<br />
 
[[File:CM4-NANO-A-details-intro.jpg|800px]]<br />
 
Compute_Module 4 Core board<br />
 
Compute_Module 4 Core board<br />
 
[[FILE:Compute_Module_4_IO_Board_5.png|700px]]<br />
 
[[FILE:Compute_Module_4_IO_Board_5.png|700px]]<br />
  
===Onboard Resources===
+
==Onboard Resources==
 
 
 
[[File:CM4-NANO-A-details-size.jpg|700px]]<br />
 
[[File:CM4-NANO-A-details-size.jpg|700px]]<br />
 
{|border=2; style="width:850px;"
 
{|border=2; style="width:850px;"
Line 49: Line 45:
 
|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||Power supply/burning interface||5V/2A power supply, can also be used as eMMC burning interface
+
|style="width:66px"|2||Power supply/burning interface||5V/2A power supply, can also be used as an eMMC burning interface
 
|-align="center"
 
|-align="center"
|3||Micro SD card interface||For inserting a Micro SD card with the system, only for Lite version
+
|3||Micro SD card interface||For inserting a Micro SD card with the system, only for the Lite version
 
|-align="center"
 
|-align="center"
 
|4||CSI Interface||Single MIPI CSI Camera Interface
 
|4||CSI Interface||Single MIPI CSI Camera Interface
 
|-align="center"
 
|-align="center"
|5||USB 2.0 interface||USB 2.0 interface, support various USB device insertion
+
|5||USB 2.0 Interface||USB 2.0 interface, support various USB device insertion
 
|-align="center"
 
|-align="center"
|6||40PIN GPIO interface||Easy access to various HAT modules
+
|6||40PIN GPIO Header||Easy access to various HAT modules
 
|-align="center"
 
|-align="center"
|7||PWR indicator||Indicates the power status of the Raspberry Pi
+
|7||PWR Indicator||Indicates the power status of the Raspberry Pi
 
|-align="center"
 
|-align="center"
 
|8||ACT Indicator||Indicates the working status of the Raspberry Pi
 
|8||ACT Indicator||Indicates the working status of the Raspberry Pi
Line 65: Line 61:
 
|9||AMS1117-3.3V||Supply voltage for CSI and 40Pin
 
|9||AMS1117-3.3V||Supply voltage for CSI and 40Pin
 
|-align="center"
 
|-align="center"
|10||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)
+
|10||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)
 
OFF: Switch the USB to TYPE A interface, it will not enter the download when powered on (start from eMMC or SD card)
 
|}
 
|}
 +
=Introduction=
 +
==Precautions==
 +
<font color="#ff0000">Do not plug or unplug any device while it is powered on.</font><br>
  
 
+
==Writing Image==
</div>
 
 
 
<div class="tabbertab" title="User Guides"><br />
 
 
 
==Introduction==
 
===Precautions===
 
<font color="#ff0000">Do not plug or unplug any device while it is powered on</font><br>
 
 
 
===Writing Image===
 
 
*[[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==
 
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:
 
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
 
  dtoverlay=dwc2,dr_mode=host
After restarting
+
After restarting:
  
 
<font color="#ff00ff">
 
<font color="#ff00ff">
Line 95: Line 85:
 
</font>
 
</font>
  
===CSI===
+
==CSI==
CSI are disabled by default. When using the camera, it will occupy three I2C devices: I2C-10, I2C-11, and I2C-0.<br>
+
<!--
Open a terminal and run the following commands:<br>
+
{{CM4-CSI-DSI}}
sudo apt-get install p7zip-full
+
-->
wget https://www.waveshare.com/w/upload/4/41/CM4_dt_blob.7z
+
7z x CM4_dt_blob.7z -O./CM4_dt_blob
+
===Configuration===
sudo chmod 777 -R CM4_dt_blob
+
*Due to CSI and DSI being 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/>
cd CM4_dt_blob/
+
*Enter the following command:<br/>
# If using the camera to execute
+
<pre>
  sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp0-double_cam.dts
+
sudo apt-get install p7zip-full -y
# When using CSI, HDMI1 has no image output, even if you do not connect the DSI screen, as long as you
+
wget https://files.waveshare.com/upload/4/41/CM4_dt_blob.7z
compile the corresponding file, then HDMI1 will not output
+
7z x CM4_dt_blob.7z -O./CM4_dt_blob
# If you need to restore, delete the corresponding dt-blob.bin: sudo rm -rf /boot/dt-blob.bin
+
sudo chmod 777 -R CM4_dt_blob
# After execution, turn off the power and restart the CM4
+
cd CM4_dt_blob/
Reconnect the camera:<br>
+
# If using two cameras and DSI1, execute
1: Make sure the connection is in the power-off state<br>
+
sudo dtc -I dts -O dtb -o /boot/dt-blob.bin dt-blob-disp1-double_cam.dts
2: Connect Power<br>
+
#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.
3: Wait a few seconds for the screen to start<br>
+
#If you need to restore, delete the corresponding dt-blob.bin: sudo rm -rf /boot/dt-blob.bin
4: If it fails to start, check whether /boot/dt-blob.bin exists, and restart it if it exists. <br>
+
# After execution, turn off the power and restart the CM4.
5: 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. <br>
+
</pre>
  
Test photo:
+
==New Version System (Bullseye)==
raspistill -o image.jpg
+
===Camera Config===
Test video:
+
<ol>
raspivid -o video.h264 -t 10000
+
<li>Execute the following commands to edit the "/boot/config.txt" file.</li>
Where -t 10000 means recording for 10 seconds, users can adjust according to their own needs.
+
<pre>sudo nano /boot/config.txt</pre>
 
+
<li>Block or delete the camera auto-detect sentence.</li>
 
+
[[File:CM4-NANO-B02.png]]<br/>
Reference:[https://www.raspberrypi.org/documentation/hardware/computemodule/cmio-camera.md  CSI camera]
+
<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 editor.</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>
 +
*In addition to modifying the device tree, the CSI camera also needs to be set to enable the camera function.
 +
-->
 +
<ol>
 +
<li>Execute the following command to enter the Raspberry Pi configuration.</li>
 +
<pre>sudo raspi-config</pre>
 +
<li>Choose Interfacing Options and enter.</li>
 +
[[File:interface.png|650px]]<br/>
 +
<li>Choose a camera.</li>
 +
[[File:camera.png|650px]]<br/>
 +
<li>Choose to open the camera interface.</li>
 +
[[File:camera2.png|650px]]<br/>
 +
<li>The system prompts as follows:</li>
 +
[[File:Prompt.png|650px]]<br/>
 +
<li>Back to the main interface, select Finish.</li>
 +
[[File:Finish.png|650px]]<br/>
 +
<li>Reboot the system.</li>
 +
[[File:Finish2.png|650px]]<br/>
  
 +
===Camera Test===
 +
*Take a photo:
 +
<pre>
 +
raspistill -o image.jpg
 +
</pre>
 +
*Test the recording function:
 +
<pre>
 +
raspivid -o video.h264 -t 10000
 +
</pre>
 +
*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/>
 +
</ol>
  
</div>
+
=Resources=
<div class="tabbertab" title="Resources">
+
==Official Manual==
 
 
=='''Resources'''==
 
===Official Manual===
 
 
*[https://datasheets.raspberrypi.org/cm4io/cm4io-product-brief.pdf Raspberry Pi Compute Module 4 IO Board Brief]
 
*[https://datasheets.raspberrypi.org/cm4io/cm4io-product-brief.pdf Raspberry Pi Compute Module 4 IO Board Brief]
 
*[https://datasheets.raspberrypi.org/cm4io/cm4io-datasheet.pdf Raspberry Pi Compute Module 4 IO Board Datasheet]
 
*[https://datasheets.raspberrypi.org/cm4io/cm4io-datasheet.pdf Raspberry Pi Compute Module 4 IO Board Datasheet]
 
*[https://www.raspberrypi.org/documentation/hardware/computemodule/cmio-camera.md  CSI Camera Reference]  
 
*[https://www.raspberrypi.org/documentation/hardware/computemodule/cmio-camera.md  CSI Camera Reference]  
===Schematic===
+
==Schematic==
*[https://www.waveshare.net/w/upload/6/68/CM4-NANO-A_SchDoc.pdf Schematic]
+
*[https://files.waveshare.com/upload/6/68/CM4-NANO-A_SchDoc.pdf Schematic]
 
 
=== 3D document ===
 
*[https://www.waveshare.net/w/upload/1/10/CM4-NANO-A-3D.zip 3D Drawing]<br>
 
 
 
=== Software ===
 
*[https://{{SERVERNAME}}/w/upload/f/f3/Rpiboot_setup.zip RPiboot_Setup]<br>
 
*[http://www.waveshare.com/w/upload/d/d7/Panasonic_SDFormatter.zip Panasonic SDFormatter]
 
*[http://www.waveshare.com/w/upload/7/76/Win32DiskImager.zip Win32DiskImager]
 
*[http://www.waveshare.com/w/upload/5/56/Putty.zip PuTTY]
 
 
 
</div>
 
<div class="tabbertab" title="FAQ">
 
  
=='''FAQ'''==
+
== 3D document ==
 +
*[https://files.waveshare.com/upload/1/10/CM4-NANO-A-3D.zip 3D Drawing]<br>
  
== <font color=red>'''Beware of knock-offs'''</font> ==
+
==Software==
{{Beware of knock-offs}}
+
*[https://files.waveshare.com/upload/d/d7/Panasonic_SDFormatter.zip Panasonic_SDFormatter-Formatting SD card]
</div>
+
*[https://files.waveshare.com/upload/7/76/Win32DiskImager.zip Win32DiskImager]
<div class="tabbertab" title="Support">
+
*[https://files.waveshare.com/upload/5/56/Putty.zip Putty]
=='''Support'''==
+
*[https://files.waveshare.com/upload/f/f3/Rpiboot_setup.zip RPiboot_Setup]
{{Service02}}
+
=Support=
 +
{{Servicebox1}}

Latest revision as of 14:56, 31 August 2023

CM4-NANO-A-4
CM4-NANO-A-4.jpg
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Introduction

Description

CM4-NANO-A is the mini board of Raspberry Pi Compute Module 4, which is a baseboard of Raspberry Pi Compute Module 4 with a 5V/2.5A USB Type C interface.

Precautions

  1. DO NOT plug and unplug any device other than USB while it is powered on.
  2. The Type C interface can be used as a power supply or as a USB SLAVE interface to burn the image.
  3. 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.
  4. When CM4 is in normal use, it needs to provide 5V 2A power supply for CM4. Otherwise, there may be problems such as shutdown, frequency reduction, and so on.
  5. Since the module does not have any protection circuit, please do not short-circuit the power supply.
  6. USB2.0 is disabled by default, if you want to open it, you need to add the line dtoverlay=dwc2,dr_mode=host to the config.txt file.

Dimension

CM4-NANO-A-details-intro.jpg
Compute_Module 4 Core board
Compute Module 4 IO Board 5.png

Onboard Resources

CM4-NANO-A-details-size.jpg

Label Name Description
1 CM4 socket suitable for all variants of Compute Module 4
2 Power supply/burning interface 5V/2A power supply, can also be used as an eMMC burning interface
3 Micro SD card interface For inserting a Micro SD card with the system, only for the Lite version
4 CSI Interface Single MIPI CSI Camera Interface
5 USB 2.0 Interface USB 2.0 interface, support various USB device insertion
6 40PIN GPIO Header Easy access to various HAT modules
7 PWR Indicator Indicates the power status of the Raspberry Pi
8 ACT Indicator Indicates the working status of the Raspberry Pi
9 AMS1117-3.3V Supply voltage for CSI and 40Pin
10 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)

Introduction

Precautions

Do not plug or unplug any device while it is powered on.

Writing Image

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

CSI

Configuration

  • Due to CSI and DSI being 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.
  • 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 editor.
  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 a 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.

Resources

Official Manual

Schematic

3D document

Software

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)