🛠 Mesurer le stockage du BPI-CM4 : eMMC, microSD et le palier NVMe
Objectives
The BPI-CM4 offers three very different storage paths: the module's 16 GB eMMC (8-bit bus, mmc-hs200, 200 MHz), the carrier's microSD (4 bits, 50 MHz), and PCIe Gen2 x1 routed to the carrier's mini-PCIe port. You will measure each path using fio and hdparm and compare the results to published references: eMMC ≈ 233 MB/s in 1 M sequential read (fio) or 148.8 MB/s (hdparm), NVMe SSD (Samsung 970 EVO Plus via mini-PCIe adapter) ≈ 351 MB/s and 101 k IOPS in 4 k random — approximately 100× the microSD in 4 k access.
Hardware
- BPI-CM4 + BPI-CM4IO carrier running Armbian
- Test microSD card (Class 10 minimum)
- Optional: Standard M-key NVMe SSD mounted on a mini-PCIe adapter (the carrier does NOT have an M.2 connector)
- Stable 5 V / 3 A power supply
Complete code
sudo apt update && sudo apt install -y fio hdparm
# Lecture séquentielle 1 M sur le rootfs (adapter le périphérique)
sudo fio --name=seqread --rw=read --bs=1M --size=256M --runtime=30 \
--iodepth=32 --ioengine=libaio --direct=1 --filename=/root/testfile
sudo rm -f /root/testfile
# Repère hdparm (comparable aux chiffres du wiki vendor)
sudo hdparm -Tt /dev/mmcblk0 # eMMC du module
sudo hdparm -Tt /dev/mmcblk1 # microSD du carrier
# Score de stockage standardisé (procédure du wiki Banana Pi)
curl -fsSL https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh | sudo bash
Expected verification
eMMC sequential read in the range of 150 to 230 MB/s depending on the batch (eMMC chips are second-sourced: Samsung HS200 or Rayson, figures vary from one card to another); microSD significantly behind, especially in 4 k random; if an NVMe SSD is mounted, the PiBenchmarks score jumps (the wiki cites 24550 versus 5446 for eMMC).
Common errors
- Benchmarking the wrong device: check with lsblk which mmcblk0/mmcblk1 is the eMMC and which is the SD.
- Concluding there is a failure because your figures differ from the wiki: the eMMC component depends on the manufacturing batch.
- Full or nearly full SD card: throughput collapses, test on a card with little data.
- Combining SD UHS + occupied mini-PCIe port and experiencing crashes: the vendor documents pci=pcie_bus_safe disableuhs in /boot/env.txt (see the NVMe tutorial).
- Writing the test file to /root mounted read-only or full: fio fails without a clear message.
Other tutorials for this board
- Monter le module BPI-CM4 sur son carrier et réussir le premier boot
- Apprivoiser les LED et la touche ADC du carrier CM4IO
- Activer I2C, SPI et UART sur le BPI-CM4 : env.txt ou armbianEnv.txt
- Brancher un capteur BME280 sur l'I2C1 du carrier (GPIOX_17/18)
- Déplacer le rootfs sur un SSD NVMe via le port mini-PCIe
- Exploiter le NPU 5 TOPS de l'A311D pour l'inférence embarquée
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash