|
| 1 | +--- |
| 2 | +title: "Restore the USB connectivity firmware on UNO R4 WiFi with espflash" |
| 3 | +id: 16379769332892 |
| 4 | +--- |
| 5 | + |
| 6 | +The UNO R4 WiFi has a ESP32-S3 chip, which handles the USB-to-serial communication. The firmware for this chip can normally be upgraded [using Arduino IDE or Arduino Cloud](https://support.arduino.cc/hc/en-us/articles/9670986058780-Update-the-connectivity-module-firmware-on-UNO-R4-WiFi), but if this is not possible the firmware can be restored using **espflash**. |
| 7 | + |
| 8 | +You may want to use this procedure if: |
| 9 | + |
| 10 | +* Your UNO R4 WiFi is detected as a generic ESP32 board by Arduino IDE or Arduino Cloud. |
| 11 | +* Your UNO R4 WiFi isn't detected as any board by Arduino IDE or Arduino Cloud, despite being connected to your computer with a working data USB cable. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +Follow these steps: |
| 16 | + |
| 17 | +1. Unplug UNO R4 WiFi and any non-essential USB devices from your computer. |
| 18 | +1. On the board, find the **GND** and **Download** pins on the 6-pin header next to the USB-C connector: |
| 19 | + |
| 20 | +  |
| 21 | +1. Connect the board to your computer while shorting the GND and Download pins. |
| 22 | + |
| 23 | + * This can easily be done by connecting a female-to-female jumper wire between the two pins. |
| 24 | + * If you don't have a female-to-female jumper wire, you can use some other pointy, conductive object (such as one end of a male-to-male jumper wire) and position to have contact with both pins. You can release the short after you've connected the board to your computer. |
| 25 | +1. The ESP32 should now be in Download mode, which allows firmware to be flashed. |
| 26 | + |
| 27 | + * You may get a system message about a new device being connected. If prompted, allow it to connect. |
| 28 | +1. Download and extract the .ZIP file for your system: |
| 29 | + * [unor4wifi-update-windows.zip](https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/latest/download/unor4wifi-update-windows.zip){.link-download} |
| 30 | + * [unor4wifi-update-macos.zip](https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/latest/download/unor4wifi-update-macos.zip){.link-download} |
| 31 | + * [unor4wifi-update-linux.zip](https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/latest/download/unor4wifi-update-linux.zip){.link-download} |
| 32 | +1. Open your system's command line application inside the extracted folder. |
| 33 | + * **Windows:** Hold <kbd>⇧Shift</kbd> and right-click any blank space inside the extracted folder. In the context menu, select **Open command window here / Open PowerShell window here**. |
| 34 | + * **macOS:** Control-click on the extracted `unor4wifi-update-macos` folder and select "**New Terminal at Folder**" from the context menu. A terminal window will open. |
| 35 | + * **Linux:** Open [a command line terminal](https://ubuntu.com/tutorials/command-line-for-beginners) in the extracted folder. |
| 36 | +1. Run the command: |
| 37 | + * **Windows:** `bin\espflash write-bin -b 115200 0x0 (Get-Item .\firmware\UNOR4-WIFI-S3-*.bin).FullName` |
| 38 | + * **macOS/Linux:** `./bin/espflash write-bin -b 115200 0x0 firmware/UNOR4-WIFI-S3-*.bin` |
| 39 | + > [!NOTE] |
| 40 | + > You may need to adjust your system's security settings to allow this command if you encounter a warning pop-up. To proceed, go to _System Preferences > Privacy & Security_, and under _Security_, click _Allow Anyway_ to allow espflash to run. |
| 41 | +
|
| 42 | +1. The terminal window might now show a list of the serial ports present on your computer. Use the arrow keys on your keyboard to select the port for the board and then press the <kbd>**Enter**</kbd> key. |
| 43 | + * **Windows:** The board will have a name like "USB Serial Device". |
| 44 | + * **macOS:** The board will be named "USB JTAG_serial debug unit". Two ports with this name will be available, select the port that starts with `/dev/cu.usbmodem*`. <!-- TODO: Same for Linux, probably. Confirm this. --> |
| 45 | + * If you can't find it, try following steps 1–3 again. |
| 46 | + |
| 47 | +1. The terminal window may show the following prompt: |
| 48 | + |
| 49 | + ```text |
| 50 | + ? Remember this serial port for future use? (y/n) › |
| 51 | + ``` |
| 52 | + |
| 53 | + Press the <kbd>**N**</kbd> key on your keyboard. |
| 54 | +1. The flashing process should now start. Wait for it to finish, as indicated by output that looks something like this: |
| 55 | + |
| 56 | + ```text |
| 57 | + [2023-07-11T08:59:44Z INFO ] Connecting... |
| 58 | + [2023-07-11T08:59:45Z INFO ] Using flash stub |
| 59 | + Chip type: esp32s3 (revision v0.1) |
| 60 | + Crystal frequency: 40MHz |
| 61 | + Flash size: 8MB |
| 62 | + Features: WiFi, BLE |
| 63 | + MAC address: dc:54:75:c4:c6:54 |
| 64 | + [00:00:14] [========================================] 689/689 0x0 |
| 65 | + ``` |
| 66 | + |
| 67 | +1. Close the terminal window. |
| 68 | +1. Disconnect the USB cable of the **UNO R4 WiFi** board from your computer. |
| 69 | +1. Ensure that the Download pin is no longer shorted. |
| 70 | +1. Connect the **UNO R4 WiFi** board to your computer with the USB cable again. |
0 commit comments