🛠 Interfacing GPIO and Peripherals on CM3588

FriendlyElec CM3588 SOM (Rockchip RK3588) · intermediaire · Apprenez à configurer et utiliser les 81 GPIO du module CM3588 pour connecter capteurs et afficheurs via les connecteurs 100 broches.

Objectives

This tutorial aims to master low-level access to the CM3588 module's input/output interfaces. You will learn to identify available pins on the four 100-pin connectors, configure GPIOs via Linux, and test simple interaction with an external device. Understanding this layer is essential to exploit the 81 GPIOs exposed by the module, distinct from dedicated interfaces like 2.5 GbE Ethernet or USB 3.1 ports.

Required Materials

Steps

  1. Pin Identification : Consult the schematic of your carrier board. The four 100-pin connectors of the CM3588 expose the RK3588 SoC resources. Note that pins are shared with other functions (PCIe, MIPI). For this tutorial, identify a free GPIO not used by the system (e.g., a GPIO associated with an unused port).
  1. Tool Installation : Open a terminal and install GPIO utilities if necessary.
sudo apt update
sudo apt install gpiod-tools
  1. List Available GPIOs : Use gpiodetect to list available GPIO controllers on the system.
gpiodetect

Identify the controller corresponding to your physical pin.

  1. Configure an Output : Suppose you identified GPIO gpiochip0 line 15. Configure it as output to light an LED.
gpioset gpiochip0 15=1
  1. Read an Input : To read the state of a button connected as input, use gpioget.
gpioget gpiochip0 15
  1. Automation Script : Create a simple bash script to blink an LED.
#!/bin/bash
while true; do
  gpioset gpiochip0 15=1
  sleep 1
  gpioset gpiochip0 15=0
  sleep 1
done

Verification

Verify that the LED turns on and off according to the script. If nothing happens, check physical connections and ensure the pin is not reserved by the kernel (check /sys/kernel/debug/gpio). Ensure the module power supply (5-20VDC) is stable and consumption remains below the 20W maximum.

Going Further

Explore the use of MIPI CSI/DSI interfaces via the same connectors to connect high-definition cameras or displays, exploiting the 8K@60Hz capability of HDMI 2.1 outputs. You can also configure PCIe lines (up to 4 lanes) to add NVMe or network extension cards.

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials