commit e80f4d72c5268b470815a23943cee54e0facbc0a Author: Dr Jones Date: Sun May 3 23:18:34 2026 -0700 Initial commit: project docs and ignore rules diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..239beea --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +*.swp +*~ diff --git a/FLASH_INSTRUCTIONS.md b/FLASH_INSTRUCTIONS.md new file mode 100644 index 0000000..cbbf3f6 --- /dev/null +++ b/FLASH_INSTRUCTIONS.md @@ -0,0 +1,58 @@ +# ESP32-C6 Flashing Instructions + +## Quick Flash (Once Device is Detected) + +Run the automated script: +```bash +./flash_esp32c6.sh +``` + +Or manually specify the port: +```bash +./flash_esp32c6.sh /dev/cu.usbserial-XXXX +``` + +## Manual Flash Command + +If you know the serial port, use this one-liner: + +```bash +cd /Users/indianaholmessr/Documents/iamDEV/ai && \ +/opt/homebrew/bin/esptool --chip esp32c6 --port /dev/cu.YOUR_PORT_HERE \ + erase-flash && \ +/opt/homebrew/bin/esptool --chip esp32c6 --port /dev/cu.YOUR_PORT_HERE \ + write-flash 0x0 bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin +``` + +## Steps to Flash + +1. **Connect ESP32-C6 via USB** to your Mac + +2. **Put device in download mode:** + - Hold the **BOOT** button + - Press and release the **RESET** button + - Release the **BOOT** button + +3. **Find the serial port:** + ```bash + ls -1 /dev/cu.* | grep -v Bluetooth + ``` + Look for ports like `/dev/cu.usbserial-XXXX` or `/dev/cu.wchusbserialXXXX` + +4. **Run the flash script:** + ```bash + ./flash_esp32c6.sh + ``` + +## Memory Layout + +- Bootloader: `0x0` +- Partition Table: `0x8000` +- Firmware: `0x10000` + +## Troubleshooting + +- **Device not detected**: Make sure it's in download mode (BOOT button sequence) +- **Port busy**: Close any serial monitor or other programs using the port +- **Permission denied**: You may need to add your user to the `dialout` group or use `sudo` (not recommended) + diff --git a/README.md b/README.md new file mode 100644 index 0000000..9a25b03 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# AI (ESP32-C6 firmware artifacts) + +This folder holds **prebuilt ESP32-C6 images** and a small flash helper — useful for recovery or flashing without rebuilding from source. + +| File | Role | +|------|------| +| `bootloader.bin` | Bootloader | +| `partitions.bin` | Partition table | +| `firmware.bin` | Application image | +| `flash_esp32c6.sh` | Convenience flash script | +| `FLASH_INSTRUCTIONS.md` | Step-by-step flashing | + +## Flash + +See `FLASH_INSTRUCTIONS.md`. Typical: + +```bash +./flash_esp32c6.sh +# or pass serial port: ./flash_esp32c6.sh /dev/cu.usbserial-XXXX +``` + +Paths inside `FLASH_INSTRUCTIONS.md` may reference an old machine location; edit the script for your environment. + +## Note + +If you need reproducible builds, prefer checking in **source** from the corresponding xiaozhi / project tree elsewhere in this workspace and CI-building artifacts, rather than relying on blobs alone. diff --git a/bootloader.bin b/bootloader.bin new file mode 100644 index 0000000..7f4e7fa Binary files /dev/null and b/bootloader.bin differ diff --git a/firmware.bin b/firmware.bin new file mode 100644 index 0000000..37fd0cc Binary files /dev/null and b/firmware.bin differ diff --git a/flash_esp32c6.sh b/flash_esp32c6.sh new file mode 100755 index 0000000..1fffe97 --- /dev/null +++ b/flash_esp32c6.sh @@ -0,0 +1,86 @@ +#!/bin/bash +# Flash script for ESP32-C6 +# Usage: ./flash_esp32c6.sh [PORT] + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "$SCRIPT_DIR" + +# ESP32-C6 flash addresses +BOOTLOADER_ADDR=0x0 +PARTITIONS_ADDR=0x8000 +FIRMWARE_ADDR=0x10000 + +# Detect port if not provided +if [ -z "$1" ]; then + echo "Detecting ESP32-C6 serial port..." + # Try to detect by attempting chip-id on all available ports + for port in /dev/cu.* /dev/tty.*; do + [ -e "$port" ] || continue + # Skip Bluetooth and debug ports + echo "$port" | grep -qE "(Bluetooth|debug-console)" && continue + + # Try to connect to this port + if /opt/homebrew/bin/esptool --chip esp32c6 --port "$port" chip-id >/dev/null 2>&1; then + PORT="$port" + break + fi + done + + if [ -z "$PORT" ]; then + echo "ERROR: Could not auto-detect ESP32-C6 serial port." + echo "" + echo "Please:" + echo "1. Ensure the ESP32-C6 is plugged in via USB" + echo "2. Put the device in download mode:" + echo " - Hold BOOT button, press and release RESET, then release BOOT" + echo "3. Run this script with the port: ./flash_esp32c6.sh /dev/cu.usbserial-XXXX" + echo "" + echo "Available serial ports:" + ls -1 /dev/cu.* /dev/tty.* 2>/dev/null | grep -vE "(Bluetooth|debug-console)" || echo " (none found)" + exit 1 + fi + echo "Detected port: $PORT" +else + PORT="$1" +fi + +# Verify files exist +if [ ! -f "bootloader.bin" ] || [ ! -f "partitions.bin" ] || [ ! -f "firmware.bin" ]; then + echo "ERROR: Required firmware files not found!" + echo "Expected: bootloader.bin, partitions.bin, firmware.bin" + exit 1 +fi + +echo "" +echo "Flashing ESP32-C6 on $PORT..." +echo "==================================" +echo "" + +# Erase flash +echo "Step 1: Erasing flash..." +/opt/homebrew/bin/esptool --chip esp32c6 --port "$PORT" erase-flash + +# Flash bootloader +echo "" +echo "Step 2: Flashing bootloader..." +/opt/homebrew/bin/esptool --chip esp32c6 --port "$PORT" write-flash --force $BOOTLOADER_ADDR bootloader.bin + +# Flash partitions +echo "" +echo "Step 3: Flashing partition table..." +/opt/homebrew/bin/esptool --chip esp32c6 --port "$PORT" write-flash --force $PARTITIONS_ADDR partitions.bin + +# Flash firmware +echo "" +echo "Step 4: Flashing firmware..." +/opt/homebrew/bin/esptool --chip esp32c6 --port "$PORT" write-flash --force $FIRMWARE_ADDR firmware.bin + +echo "" +echo "==================================" +echo "Flash completed successfully!" +echo "" +echo "The device will now boot with the new firmware." +echo "Press RESET button if needed." + diff --git a/partitions.bin b/partitions.bin new file mode 100644 index 0000000..951265f Binary files /dev/null and b/partitions.bin differ