🛠 Activer une console série sur l'UART du CM3+
Objectives
Set up a serial console access on the CM3+: essential for industrial batch production, when the HDMI screen and network are not available. The BCM2837B0 exposes two full UARTs on the SODIMM connector (2× UART per datasheet RP-008163-DS §2.2); here we use the UART0 PL011 on GPIO14/15, exposed on the GPIO connector of the CMIO3. You will enable the serial port via config.txt and raspi-config, then connect from a host PC.
Hardware
- CM3+ on CMIO3, Raspberry Pi OS booted
- USB to TTL 3.3 V adapter (never direct 5 V TTL: the CMIO3 GPIO bank is 3.3 V)
- 3 wires: GPIO14 (TXD0) to the adapter's RX, GPIO15 (RXD0) to TX, GND to GND
- On a custom board, check the VREF rail of the relevant bank (1.8 to 3.3 V possible)
Complete code
# 1. Activer le port série de login sur la console série
sudo raspi-config # Interface Interfacing Options > Serial > Login shell activé
# (ou à la main dans /boot/firmware/config.txt : enable_uart=1)
sudo sed -i 's/^#*enable_uart=.*/enable_uart=1/' /boot/firmware/config.txt
grep enable_uart /boot/firmware/config.txt
sudo reboot
# 2. Côté CM3+ : vérifier le port
ls /dev/serial*
dmesg | grep -i pl011
# 3. Côté PC hôte Linux : se connecter
sudo apt install -y minicom
sudo minicom -D /dev/ttyUSB0 -b 115200
Expected verification
The minicom terminal displays the CM3+ login message; entering the password gives a full shell. Conversely, echo test > /dev/ttyS0 on the CM3+ side (with the login shell disabled to avoid echo) scrolls text on the PC. The console works even without network or screen.
Common errors
- TX/RX not crossed: connect the CM3+'s TXD to the adapter's RX, not TXD to TXD — no characters appear otherwise.
- Forgetting the common ground: without a common GND, the signal is unusable and may damage the pins.
- 5 V TTL adapter on a 3.3 V bank (or worse, 1.8 V on a custom board): respect the voltage of the bank's VREF rail, otherwise you risk burning the pin.
- Missing
enable_uart=1: on recent images, UART0 disables itself automatically (Bluetooth does not exist on the CM3+, but the default dtparam varies depending on overlays) — the login message never appears. - Wrong baud rate: 115200 8N1 by default; an inconsistent baud rate produces unreadable characters.
Other tutorials for this board
Code examples for this board
clignotante.pyPythonbouton-gpio.pyPythoncapteur-i2c.shBashsurveillance-temperature.shBashcapteur-dht11.pyPythonservo-pwm-sysfs.shBash