From Waveshare Wiki
Revision as of 14:56, 31 August 2023 by Waveshare-admin (talk | contribs) (Text replacement - "" to "")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search






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.


  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.


Compute_Module 4 Core board
Compute Module 4 IO Board 5.png

Onboard Resources


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)



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

Writing Image


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:


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



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


  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.


Official Manual


3D document



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 PM GMT+8 (Monday to Friday)