🛠 Flasher Armbian et premier boot du BPI-M2 Zero
Objectives
The BPI-M2 Zero is a compact 65 × 30 mm SBC (Raspberry Pi Zero W form factor) based on an Allwinner H2+ or H3 (4× Cortex-A7, 512 MB DDR3, Mali-400MP2). Unlike its neighbor the BPI-P2 Zero, it has neither eMMC nor Ethernet: the microSD card is the ONLY boot path (no USB boot possible). You will flash the community Armbian image (bananapim2zero), understand the difference between the two micro-USB ports, and get a first console.
Hardware
- Banana Pi BPI-M2 Zero (H2+ or H3, the same images run on both)
- microSD card 4 to 64 GB (the wiki caps at 64 GB), preferably new and branded
- 5 V / 2 A power supply on the "power only" micro-USB port
- USB-to-serial adapter for the CON3 bridge (UART0, 115200 8N1) or a PC for serial gadget mode (see OTG tutorial)
- microSD card reader
Complete code
# 1) Sur le PC : télécharger l'image Armbian community « bananapim2zero »
# (depuis armbian.com, pas le miroir vendor épinglé comme défaillant)
sudo apt install -y pixz
xzcat Armbian_*_BananaPiM2Zero_*.img.xz | sudo dd of=/dev/sdX bs=4M status=progress conv=fsync
# 2) Câblage : microSD au dos ; adaptateur USB-série sur CON3 :
# CON3-TXD -> RX de l'adaptateur, CON3-RXD -> TX, GND -> GND (115200 8N1)
# 3) Alimenter en branchant le chargeur sur le port micro-USB « Power only »
sudo apt install -y picocom
picocom -b 115200 /dev/ttyUSB0 # sur le PC : la console de la carte apparaît
# 4) Sur la carte : créer l'utilisateur, puis monter le Wi-Fi
armbian-config # Network > Wi-Fi (clé WPA)
ip -br addr && uname -a && nproc
Expected verification
The U-Boot boot message followed by the Armbian login on the serial console; after armbian-config, ip -br addr displays an address on wlan0; uname -a announces a sun8i 6.x kernel; nproc returns 4 and free -h shows approximately 480 MB of RAM.
Common errors
- Plugging the power supply into the OTG port hoping to charge devices at the same time: the two ports share the Vbus line (device tree comment) and a wrong combination causes power backfeed.
- Looking for an Ethernet port or USB SSD boot: the M2 Zero cannot do either (microSD only).
- Using the Armbian image mirrored by the vendor wiki: the forum reports malformed block configuration — take the image from armbian.com.
- "No card inserted" with a card actually present: presence detection polarity changed between manufacturing batches (active high on production series).
- Forgetting the antenna on the RF connector: see the Wi-Fi tutorial, the board is nearly blind without it.
Other tutorials for this board
- LED et bouton avec libgpiod sur le port 40 broches
- Wi-Fi AP6212 : le piège de l'antenne U.FL non fournie
- Console série sur USB-OTG : dépanner sans réseau ni câble UART
- Activer le bus SPI0 et piloter un petit écran TFT
- Survivre avec 512 Mo : zram, swap compressé et services légers
- Câbler l'Ethernet 10/100 EMAC avec le carrier Zero-EPHY
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash