🛠 Bouton Reset et console série du NanoPi R5S

NanoPi R5S (FriendlyElec) · debutant · Schéma : IMG-nanopi-r5s-debutant-2-nanopir5s-bouton-console.svg — NanoPi R5S avec le bouton Reset (GPIO4_A0), le bouton MASK, l'en-tête UART 3 pins 2,54 mm et le branchement d'un adaptateur USB-UART

Objectives

Learn how to interact with the NanoPi R5S when the network is not working: use the Reset button (registered as gpio-keys, KEY_RESTART key on GPIO4_A0 in the mainline device tree) and the serial console. You will also discover the MASK button, which puts the board into Maskrom mode to reflash the eMMC. By the end, you will know how to read button events and troubleshoot booting via UART.

Hardware

Complete code

# 1) Console série : adapter sur TX/RX/GND, puis
sudo picocom -b 1500000 /dev/ttyUSB0
# (ou: sudo minicom -b 1500000 -D /dev/ttyUSB0)
# Interrompre U-boot pendant les 2 s de délai au boot (image Armbian)

# 2) Lire les événements du bouton Reset (gpio-keys le revendique)
sudo apt install evtest
sudo evtest        # choisir l'événement « NanoPi ... » KEY_RESTART

# 3) Vérifier le mapping du bouton
grep -A4 'gpio-keys' /proc/device-tree/../* 2>/dev/null
sudo dmesg | grep -i 'gpio-keys\|Restart'

# 4) Maskrom : maintenir MASK, alimenter, puis côté PC Linux :
sudo upgrade_tool LD   # liste les appareils en mode RockUSB

Expected verification

On the serial console at 1,500,000 bps, you see U-boot messages scroll by followed by the kernel; evtest displays EV_KEY / KEY_RESTART each time Reset is pressed. dmesg mentions the gpio-keys keyboard. In Maskrom mode, upgrade_tool LD lists the device. If nothing appears on the serial line, check the TX/RX inversion and the adapter's ability to sustain 1.5 Mbaud.

Common errors

Other tutorials for this board

Code examples for this board

← Back to the board 🛠 All tutorials