72 lines
2.6 KiB
Markdown
72 lines
2.6 KiB
Markdown
# Beacon CM4 — Quick Reference
|
|
|
|
> Full docs: `beacon-buildroot/README.md`
|
|
|
|
## Build
|
|
```bash
|
|
cd ~/repos/buildroot-beacon
|
|
make -C rpi-buildroot-fork O=$(pwd)/output BR2_EXTERNAL=$(pwd)/beacon-buildroot -j$(nproc)
|
|
# outputs: output/images/rootfs.raucb update.raucb sdcard.img.xz
|
|
```
|
|
|
|
## Flash (initial, EMMC_DISABLE jumper bridged)
|
|
```bash
|
|
./beacon-buildroot/scripts/flash-cm4.sh # auto-detect
|
|
./beacon-buildroot/scripts/flash-cm4.sh /dev/sda # explicit device
|
|
```
|
|
|
|
## SSH / find IP
|
|
```bash
|
|
# Non-secure-boot CM4 (MAC e4:5f:01:e9:13:96):
|
|
CM4=$(ip neigh show dev enp0s31f6 | awk '/e4:5f:01:e9:13:96/{print $1}')
|
|
# Secure-boot CM4 (MAC 2c:cf:67:fd:93:1a):
|
|
CM4=$(ip neigh show dev enp0s31f6 | awk '/2c:cf:67:fd:93:1a/{print $1}')
|
|
sshpass -p beacon ssh user@$CM4 # login: user / beacon
|
|
```
|
|
|
|
## OTA Update
|
|
```bash
|
|
# transfer (scp broken on Dropbear — use tee pipe):
|
|
sshpass -p beacon ssh user@$CM4 'sudo tee /upload/rootfs.raucb >/dev/null' \
|
|
< output/images/rootfs.raucb
|
|
# install + reboot:
|
|
sshpass -p beacon ssh -tt user@$CM4 'rauc install /upload/rootfs.raucb && sudo reboot'
|
|
# after reboot — find new IP, then mark-good (REQUIRED on every new boot to confirm slot):
|
|
sshpass -p beacon ssh -tt user@$CM4 'rauc status mark-good && rauc status'
|
|
# NOTE: rauc commands need -tt (PTY) on Dropbear SSH or output is silently dropped
|
|
# NOTE: mark-good MUST be called after each OTA reboot — without it RAUC falls back to previous slot
|
|
```
|
|
|
|
## UART
|
|
```bash
|
|
picocom -b 115200 /dev/ttyUSB1 # interactive (GPIO14/15)
|
|
socat -u /dev/ttyUSB1,b115200,rawer,crnl OPEN:/tmp/uart.log,creat,trunc & # headless capture
|
|
```
|
|
|
|
## Rescue
|
|
Short GPIO4 (pin 7) → GND (pin 9) during power-on → boots `/dev/mmcblk0p2`.
|
|
|
|
## Secure Boot — Unlock as MSD
|
|
```bash
|
|
# Sign the MSD boot image with private.pem (once, or after rpi-eeprom submodule init):
|
|
cd usbboot/secure-boot-msd
|
|
../tools/rpi-eeprom-digest -i boot.img -o boot.sig -k ../../private.pem
|
|
# Expose eMMC as USB mass storage (user must bridge EMMC_DISABLE jumper first):
|
|
sudo ./usbboot/rpiboot -d usbboot/secure-boot-msd
|
|
# Flash:
|
|
sudo bmaptool copy output/images/sdcard.img.xz /dev/sda
|
|
```
|
|
|
|
## UART / Power Cycle
|
|
> **The user handles power cycling and UART logging manually.**
|
|
> Ask user to: remove EMMC_DISABLE jumper → power-cycle → connect picocom.
|
|
```bash
|
|
picocom -b 115200 /dev/ttyUSB1 # user runs this to see boot log
|
|
```
|
|
Expected secure boot log lines: `secure-boot`, `rsa-verify pass (0x0)`, then U-Boot.
|
|
|
|
## Secure Boot — Provision (burn OTP)
|
|
```bash
|
|
update-pieeprom.sh -k private.pem && rpiboot -d secure-boot-recovery
|
|
```
|
|
> Use existing `private.pem` — never regenerate it. |