#!/usr/bin/env bash # Flash PN532 toolkit. Requires ESP-IDF 5.x in PATH (run export.sh first). set -euo pipefail ROOT="$(cd "$(dirname "$0")" && pwd)" PORT="${ESPPORT:-${1:-/dev/cu.usbserial-A5069RR4}}" cd "$ROOT" if ! command -v idf.py >/dev/null 2>&1; then echo "idf.py not found. Source your ESP-IDF export.sh, then re-run:" >&2 echo " ESPPORT=$PORT $0" >&2 exit 1 fi idf.py -p "$PORT" flash