Skip to main content

Description

The Luckfox CM5 IO Board is a baseboard released by Luckfox that can be used with the Raspberry Pi Compute Module 5. It can serve as a development system for the Compute Module 5 or be integrated into embedded systems for end products. Additionally, it can quickly create systems using existing components (such as Raspberry Pi expansion boards and M.2 SSDs). The main interfaces are located on the same side for ease of use, making the enclosure design simpler.

Features and Notes

  • Do not plug or unplug any devices except USB and HDMI when the power is on.
  • Type-C is used for both programming and power supply.
  • Two USB 3.2 Gen1 interfaces onboard.
  • Supports four-screen display. By adding the MIPI DSI driver, the system will default to connecting screens for split-screen display (this depends on the system version).
  • Do not connect other devices when using Type-C for programming to avoid insufficient power causing the device not to be recognized.

Product Dimensions

Core Board Dimensions

Baseboard Dimensions

Image Flashing Guide

How to Enter Programming Mode

Usage Instructions

POE

  • The board does not come with a POE module but has POE pins, which are compatible with the PI5 POE module.

MicroSnow POE

NVME

Mounting

  • Enable PCIe interface
    Add the following to `/boot/firmware/config.txt`: ```bash dtparam=pciex1 ```
  • PCIe is by default gen2. To enable PCIe gen3, add the following to /boot/firmware/config.txt:
    dtparam=pciex1_gen=3
  • After modification, restart PI5, and the device should be recognized.
    For example, the SM2263 is my SSD, and the other PI5 is the RPI chip.
  • Partition: If the device has been partitioned and formatted on another platform, skip this step (this will delete all SSD data, proceed with caution).
    lsblk   # View disk (to see more details, use sudo fdisk -l)
    as follows:
    Partitioning
    sudo fdisk /dev/nvme0n1  # Use the device name, not p1 (which is just a partition) 
    Using fdisk
    n   # Create a new partition
    q # Quit without saving
    p # Print partition table
    m # Show menu
    d # Delete partition
    w # Write and exit
    # To add partitions, use n and then w to save and exit
  • Formatting:
    sudo mkfs.    
    • Press tab to view available formats
    • To format as ext4:sudo mkfs.ext4 /dev/nvme0n1p1
    • Wait for "done" to appear, indicating formatting is complete.
  • Mounting:
    sudo mkdir toshiba                      # Create mount directory
    sudo mount /dev/nvme0n1p1 ./toshiba # Mount the device
    df -h # Check disk status

Read/Write Test

  • Note: Performance varies with different cards and environments. To test accurately, use a PC instead of the Raspberry Pi.
    cd toshiba                                                  # Go to the mounted directory
    sudo sh -c "sync && echo 3 > /proc/sys/vm/drop_caches" # Free memory
    sudo dd if=/dev/zero of=./test_write count=2000 bs=1024k # Write from memory to disk
    sudo dd if=./test_write of=/dev/null count=2000 bs=1024k # Read from disk to memory

Auto-mounting

  • If the test is successful and the device will not be used as the system disk, but just for storage, configure auto-mount:
    sudo nano /etc/fstab 
    • Edit fstab file
      /dev/nvme0n1p1  /home/pi/toshiba  ext4  defaults  0  0  # Add line for auto-mount
      sudo mount -a # Apply changes
      # Reboot, check the device with lsblk to ensure it mounts properly

NVMe SSD Boot

  • First, boot from an SD card or EMMC, test mounting to ensure the hardware works.
  • Two options for setting boot from NVMe:

Method 1

  • Configure settings:
    sudo raspi-config       # Enter settings
    Set as shown:
  • Reboot the Raspberry Pi. If configuration fails multiple times, connect to the network or set the correct time before trying again.
  • Flash the system to the NVMe, then connect the NVMe to the expansion board, remove the SD card, and power up again.

Method 2

  • Edit the bootloader configuration:
    sudo rpi-eeprom-config --edit 
  • Change the BOOT_ORDER=0xf41 to BOOT_ORDER=0xf416
  • More content can be referred to BOOT_ORDER
  • Reboot the Raspberry Pi. If modification fails, check network settings or adjust the time before editing files.
  • Flash the system to the NVMe, then connect it to the expansion board, remove the SD card, and power up again.

Fan Control

  • The PI5 fan is set to start at 50°C by default. To change the temperature, add the following to /boot/firmware/config.txt:
    dtparam=fan_temp0=36000,fan_temp0_hyst=2000,fan_temp0_speed=90
    dtparam=fan_temp1=40000,fan_temp1_hyst=3000,fan_temp1_speed=150
    dtparam=fan_temp2=52000,fan_temp2_hyst=4000,fan_temp2_speed=200
    dtparam=fan_temp3=58000,fan_temp3_hyst=5000,fan_temp3_speed=255
  • Explanation of parameters:
    fan_temp0/1/2/3             # Temperature (36000 means 36°C)
    fan_temp0/1/2/3_speed # Corresponding fan speed (max 255)
    fan_temp0/1/2/3_hyst # Hysteresis temperature
    More details: related documentation

MIPI

  • Supports dual MIPI, users can choose between CSI or DSI connections.
  • Cables for DSI and CSI are not interchangeable. For more details, refer to CSI camera cable and DSI display cable.
  • The default DSI screen resolution is 800x480. For other resolutions, refer to the corresponding WIKI.
  • Note: If using the MIPI1 interface, connect the jumper cap.

DSI

  • Add the following in config.txt to enable DSI:
    sudo nano /boot/firmware/config.txt     # Edit file
    dtoverlay=vc4-kms-dsi-7inch,dsi0 # Enable DSI1
    dtoverlay=vc4-kms-dsi-7inch,dsi1 # Enable DSI0

CSI

  • Add the following in config.txt to enable CSI:
    sudo nano /boot/firmware/config.txt
    ModelCAM0 SettingCAM1 Setting
    OV9281dtoverlay=ov9281,cam0dtoverlay=ov9281,cam1
    IMX290/IMX327dtoverlay=imx290,
    clock-frequency=37125000,cam0
    dtoverlay=imx290,
    clock-frequency=37125000,cam1
    IMX378dtoverlay=imx378,cam0dtoverlay=imx378,cam1
    IMX219dtoverlay=imx219,cam0dtoverlay=imx219,cam1
    IMX477dtoverlay=imx477,cam0dtoverlay=imx477,cam1
    IMX708dtoverlay=imx708,cam0dtoverlay=imx708,cam1
  • You can connect one DSI and one CSI device. For example, use IMX219 for MIPI1.
  • Example: Connect DSI display to MIPI0 in config.txt:
    dtoverlay=imx219,cam1
    dtoverlay=vc4-kms-dsi-7inch,dsi0
    • Save the file with Ctrl+O and exit with Ctrl+X. Then reboot the device:
    • Then restart the device.
      sudo reboot

Test Camera

  • To check if the camera is detected, use:
    libcamera-hello --list-cameras
    For example:
    libcamera-hello -t 0                    # Show live camera feed
    libcamera-jpeg -o test.jpg              # Capture an image
    libcamera-vid -t 10000 -o test.h264     # Record a 10s video
  • Other commands:
    libcamera-hello --list-cameras          # List cameras
    libcamera-hello  --camera 1             # Use camera 1
    libcamera-hello --camera 0 # Use camera 0
    libcamera-jpeg -o test.jpg              # Capture image (can specify camera with --camera)

Real-Time Clock (RTC)

Note: The device does not come with a battery by default, and an additional RTC battery needs to be connected.

Software Debugging

  • The default device is /dev/rtc0.

  • To check the time, you can enter date in the command line. If connected to the network, the Raspberry Pi system will automatically synchronize the time with the network. If the default RTC device is connected and working correctly, the RTC time will be updated after the automatic network time synchronization.

    sudo hwclock -r                         # Read RTC time. If there are multiple RTC devices, you can use -f to select the corresponding device (e.g., sudo hwclock -f /dev/rtc1 -r)

Basic Usage of Hwclock

  • Relevant commands:

    sudo hwclock -w                                 # Synchronize system clock -> hardware clock (RTC)
    sudo hwclock -s                                 # Synchronize hardware clock (RTC) -> system clock. This requires disabling the network or network time synchronization, otherwise, it will be overwritten.
    sudo hwclock --set --date="9/8/2023 16:45:05"   # Set the hardware clock time (RTC)
    sudo hwclock -r                                 # Check the hardware clock (RTC)
    sudo hwclock --verbose                          # Display version information

Automatic Wake-up

  • To support wake-up alarms in low power modes, add the following configuration:

    sudo -E rpi-eeprom-config --edit
  • Add the following two lines:

    POWER_OFF_ON_HALT=1     
    WAKE_ON_GPIO=0
  • After adding these, reboot the device (you can check the serial log to see updated logs).

    sudo reboot
  • You can test the wake-up function by setting an alarm for 10 minutes later to wake up and restart the system:

    echo +600 | sudo tee /sys/class/rtc/rtc0/wakealarm
    sudo halt
  • Or use the following method to test the function, which will wake up and restart after 10 minutes:

    echo +600 | sudo tee /sys/class/rtc/rtc0/wakealarm
    sudo poweroff

RTC Battery Charging

  • Note: Before adding this, make sure your RTC battery is capable of charging and check the maximum allowable voltage.

  • Enter the configuration file:

    sudo nano /boot/firmware/config.txt
  • Add the following line:

    dtparam=rtc_bbat_vchg=3000000       # Add this line at the bottom of the file to enable RTC battery charging
    # 3000000 means the maximum voltage, charging will stop once it reaches 3V, and trickle charging will start if the voltage drops below 3V

Documentation

Manuals & Schematics

2D/3D Drawings