PI AI MIC DFU rescue for Windows
================================

Use this package when Chrome/WebUSB can see the board but cannot flash it.

Target recovery case:
- Current bad firmware PID: 20B1:4FBA, "PI AI MIC Assistant Shortcut"
- Recovery firmware: USB 2ch 48 kHz Assistant Square, PID 20B1:4FB9

Steps:
1. Close Chrome, Audacity, Teams, Zoom, Windows sound settings and any app that may use the PI AI MIC.
2. Unplug the PI AI MIC USB cable.
3. Replug the PI AI MIC USB cable.
4. Double-click rescue-4fba-to-assistant-square.cmd.
5. The script tries several safe DFU upgrade sequences on alt 1 only.
6. Wait until dfu-util reports completion, then unplug/replug the board.

If dfu-util reports LIBUSB_ERROR_ACCESS or cannot open the DFU device, Windows
is blocking access to the XMOS DFU interface. In that case use another Windows
machine, a Raspberry Pi I2C/SPI update path, or XTAG.

If dfu-util reports "No DFU capable USB device available":
1. The board is still alive if Chrome showed "PI AI MIC Assistant Shortcut
   [20b1:4fba]"; this means Windows can enumerate the USB device.
2. dfu-util cannot see the DFU interface because Windows has not bound a
   WinUSB/libusb-compatible driver to the DFU interface.
3. Download Zadig from the official site:
   https://zadig.akeo.ie/
4. Run Zadig as administrator.
5. Open Options -> List All Devices.
6. Select the PI AI MIC/XMOS DFU interface only. It should look like one of:
   - XMOS DFU Upgrade
   - PI AI MIC Assistant Shortcut (Interface 4)
   - USB\VID_20B1&PID_4FBA&MI_04
7. Select WinUSB, then click Install Driver or Replace Driver.
8. Unplug/replug the board and run rescue-4fba-to-assistant-square.cmd again.

Important: do not replace the driver for the audio speaker, audio microphone,
HID, or the whole composite device. Use only the DFU interface 4 / MI_04.
Do not write the upgrade image to alt 0; alt 0 is the XMOS factory slot, while
the public `*_dfu_upgrade.bin` images are for alt 1.

If you are not sure which Zadig entry is the DFU interface, run:

```text
diagnose-pi-ai-mic-usb.cmd
```

Select the entry whose InstanceId contains `MI_04`.

Included tool:
- dfu-util 0.11 Windows static binary
- dfu-util license files are included in this folder.
