diff --git a/content/Hardware Support/UNO/Restore-the-USB-connectivity-firmware-on-UNO-R4-WiFi-with-espflash.md b/content/Hardware Support/UNO/Restore-the-USB-connectivity-firmware-on-UNO-R4-WiFi-with-espflash.md new file mode 100644 index 00000000..3f5d9fcd --- /dev/null +++ b/content/Hardware Support/UNO/Restore-the-USB-connectivity-firmware-on-UNO-R4-WiFi-with-espflash.md @@ -0,0 +1,70 @@ +--- +title: "Restore the USB connectivity firmware on UNO R4 WiFi with espflash" +id: 16379769332892 +--- + +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**. + +You may want to use this procedure if: + +* Your UNO R4 WiFi is detected as a generic ESP32 board by Arduino IDE or Arduino Cloud. +* 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. + +--- + +Follow these steps: + +1. Unplug UNO R4 WiFi and any non-essential USB devices from your computer. +1. On the board, find the **GND** and **Download** pins on the 6-pin header next to the USB-C connector: + + ![The GND and Download ESP32 pins.](img/esp32-data-pins.png) +1. Connect the board to your computer while shorting the GND and Download pins. + + * This can easily be done by connecting a female-to-female jumper wire between the two pins. + * 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. +1. The ESP32 should now be in Download mode, which allows firmware to be flashed. + + * You may get a system message about a new device being connected. If prompted, allow it to connect. +1. Download and extract the .ZIP file for your system: + * [unor4wifi-update-windows.zip](https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/latest/download/unor4wifi-update-windows.zip){.link-download} + * [unor4wifi-update-macos.zip](https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/latest/download/unor4wifi-update-macos.zip){.link-download} + * [unor4wifi-update-linux.zip](https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/latest/download/unor4wifi-update-linux.zip){.link-download} +1. Open your system's command line application inside the extracted folder. + * **Windows:** Hold ⇧Shift and right-click any blank space inside the extracted folder. In the context menu, select **Open command window here / Open PowerShell window here**. + * **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. + * **Linux:** Open [a command line terminal](https://ubuntu.com/tutorials/command-line-for-beginners) in the extracted folder. +1. Run the command: + * **Windows:** `bin\espflash write-bin -b 115200 0x0 (Get-Item .\firmware\UNOR4-WIFI-S3-*.bin).FullName` + * **macOS/Linux:** `./bin/espflash write-bin -b 115200 0x0 firmware/UNOR4-WIFI-S3-*.bin` + > [!NOTE] + > 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. + +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 **Enter** key. + * **Windows:** The board will have a name like "USB Serial Device". + * **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*`. + * If you can't find it, try following steps 1–3 again. + +1. The terminal window may show the following prompt: + + ```text + ? Remember this serial port for future use? (y/n) › + ``` + + Press the **N** key on your keyboard. +1. The flashing process should now start. Wait for it to finish, as indicated by output that looks something like this: + + ```text + [2023-07-11T08:59:44Z INFO ] Connecting... + [2023-07-11T08:59:45Z INFO ] Using flash stub + Chip type: esp32s3 (revision v0.1) + Crystal frequency: 40MHz + Flash size: 8MB + Features: WiFi, BLE + MAC address: dc:54:75:c4:c6:54 + [00:00:14] [========================================] 689/689 0x0 + ``` + +1. Close the terminal window. +1. Disconnect the USB cable of the **UNO R4 WiFi** board from your computer. +1. Ensure that the Download pin is no longer shorted. +1. Connect the **UNO R4 WiFi** board to your computer with the USB cable again. diff --git a/content/Hardware Support/UNO/Update-the-connectivity-module-firmware-on-UNO-R4-WiFi.md b/content/Hardware Support/UNO/Update-the-connectivity-module-firmware-on-UNO-R4-WiFi.md index 093022fa..175ea06b 100644 --- a/content/Hardware Support/UNO/Update-the-connectivity-module-firmware-on-UNO-R4-WiFi.md +++ b/content/Hardware Support/UNO/Update-the-connectivity-module-firmware-on-UNO-R4-WiFi.md @@ -3,22 +3,18 @@ title: Update the connectivity module firmware on UNO R4 WiFi id: 9670986058780 --- -Learn how to update the firmware of the ESP32-S3 connectivity module on the UNO R4 WiFi. - -Updating the firmware is required to use UNO R4 WiFi with Arduino Cloud, and can resolve issues with UNO R4 WiFi not being detected by Arduino IDE and other development tools. +Learn how to update the firmware of the ESP32-S3 connectivity module on the UNO R4 WiFi. This firmware is required to use your board with Arduino Cloud and for the board to be correctly detected on a USB port by Arduino development tools. In this article: * [Use the Firmware Updater in Arduino IDE](#ide) -* [Use Arduino Cloud to update the firmware](#iot) -* [Use the updater script](#unor4wifi-updater) -* [Run espflash directly](#espflash) +* [Use Arduino Cloud to update the firmware](#cloud) +* [Use the Arduino Firmware Uploader CLI utility](#cli) +* [If you can't update the firmware](#if-you-cant-update-the-firmware) --- - - -## Use the Firmware Updater in Arduino IDE +## Use the Firmware Updater in Arduino IDE {#ide} Updating the connectivity firmware is easy when using the Firmware Updater in Arduino IDE 2.2.1 or later. @@ -36,9 +32,9 @@ Follow these steps: ![Firmware Updater window displaying the board selection menu and the "check updates" button](img/firmware-updater-arduino-ide-2-check-updates.png) - > If your UNO R4 WiFi doesn't appear in the list, make sure it's securely connected with a working data USB cable, and try pressing the RST button on the board. If it still doesn't appear, it may be missing the USB bridge firmware. Follow the steps in [Run espflash directly](#espflash) to resolve the issue. + > If your UNO R4 WiFi doesn't appear in the list, make sure it's securely connected with a working data USB cable, and try pressing the RST button on the board. If it still doesn't appear, it may be missing the USB bridge firmware. Follow [these instructions](https://support.arduino.cc/hc/en-us/articles/16379769332892) to resolve the issue. -5. Select the latest firmware version on the drop-down menu and click **Install** +5. Select the latest firmware version on the drop-down menu and click **Install**. > [!NOTE] > Installation will overwrite any existing sketch on your board. @@ -59,269 +55,27 @@ Follow these steps: --- - - -## Use Arduino Cloud to update the firmware +## Use Arduino Cloud to update the firmware {#cloud} When you add a new device to Arduino Cloud, the connectivity module firmware is automatically updated. -Learn more +[Update connectivity module firmware with Arduino Cloud](https://support.arduino.cc/hc/en-us/articles/10501616961564-Update-connectivity-module-firmware-with-IoT-Cloud){.link-chevron-right} --- - - -## Use the updater script - -The code repository for the firmware provides an [updater script](https://github.com/arduino/uno-r4-wifi-usb-bridge/tree/main/unor4wifi-updater) that can be used as an alternative to the above options. - - +## Use the Arduino Firmware Uploader CLI utility {#unor4wifi-updater} -### Windows - -1. Unplug any non-essential USB devices from your computer. -1. Connect the UNO R4 WiFi board to your computer with the USB cable. -1. Download unor4wifi-update-windows.zip -1. [Unzip](https://support.microsoft.com/windows/f6dde0a7-0fec-8294-e1d3-703ed85e7ebc) the downloaded file. -1. Double-click on the `update.bat` file that is in the unzipped folder. - > [!NOTE] - > Depending on your Windows security settings, a **Windows protected your PC** dialog may open with this message: - > - > _Microsoft Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk._ - > - > Click the **More info** link in the dialog and then click the **Run anyway** button to continue. -1. A terminal window will open. The terminal window might now show a list of the serial ports present on your computer. - - For example: - - ```text - Start flashing firmware - [2023-07-11T06:39:09Z INFO ] Detected 2 serial ports - [2023-07-11T06:39:09Z INFO ] Ports which match a known common dev board are highlighted - [2023-07-11T06:39:09Z INFO ] Please select a port - ❯ COM1 - COM43 - USB Serial Device (COM43) - ``` - - If so, use the **↓** key on your keyboard to select the port of the **UNO R4 WiFi** board from the list, and then press the **Enter** key. -1. The terminal window will now show the following prompt: - - ```text - ? Remember this serial port for future use? (y/n) › - ``` - - Press the **N** key on your keyboard. -1. The flashing process should now start. Wait for it to finish, as indicated by output that looks something like this: - - ```text - Chip type: esp32s3 (revision v0.1) - Crystal frequency: 40MHz - Flash size: 8MB - Features: WiFi, BLE - MAC address: dc:54:75:c4:c6:54 - [00:00:15] [========================================] 689/689 0x0 - Press any key to continue . . . - ``` - -1. Press any key on your keyboard to close the terminal window. -1. Disconnect the USB cable of the **UNO R4 WiFi** board from your computer. -1. Connect the **UNO R4 WiFi** board to your computer with the USB cable again. - -**Troubleshooting for Windows:** - -If you get a `VCRUNTIME140.dII was not found` error, download and install the Microsoft Visual C++ Redistributable package from Microsoft. - -### macOS - -1. Unplug any non-essential USB devices from your computer. -1. Connect the UNO R4 WiFi board to your computer with the USB cable. -1. Download unor4wifi-update-macos.zip -1. [Unzip](https://support.apple.com/en-ca/guide/mac-help/mchlp2528/mac) the downloaded file. -1. Control-click on the unzipped `unor4wifi-update-macos` folder and select "**New Terminal at Folder**" from the context menu. A terminal window will open. -1. Type the following command in the **Terminal** window: - - ```text - chmod a+x update.command && sudo xattr -d com.apple.quarantine bin/espflash && sudo xattr -d com.apple.quarantine bin/unor4wifi-reboot-macos - ``` - -1. Press the **Enter** key. -1. Type your macOS user password in the "Password" prompt and press the **Enter** key again. -1. Type the following command in the **Terminal** window: - - ```text - ./update.command - ``` - -1. Press the **Enter** key. -1. The terminal window might now show a list of the serial ports present on your computer. - - For example: - - ```text - Start flashing firmware - [2023-07-11T08:55:51Z INFO ] Detected 6 serial ports - [2023-07-11T08:55:51Z INFO ] Ports which match a known common dev board are highlighted - [2023-07-11T08:55:51Z INFO ] Please select a port - ❯ /dev/cu.wlan-debug - /dev/tty.wlan-debug - /dev/cu.Bluetooth-Incoming-Port - /dev/tty.Bluetooth-Incoming-Port - /dev/cu.usbmodem2214101 - USB JTAG_serial debug unit - /dev/tty.usbmodem2214101 - USB JTAG_serial debug unit - ``` - - If so, use the **↓** key on your keyboard to select the `dev/cu.usbmodem*` port for **USB JTAG_serial debug unit** and then press the **Enter** key. - -1. The terminal window will now show the following prompt: - - ```text - ? Remember this serial port for future use? (y/n) › - ``` - - Press the **N** key on your keyboard. -1. The flashing process should now start. Wait for it to finish, as indicated by output that looks something like this: - - ```text - [2023-07-11T08:59:44Z INFO ] Serial port: '/dev/cu.usbmodem2214101' - [2023-07-11T08:59:44Z INFO ] Connecting... - [2023-07-11T08:59:45Z INFO ] Using flash stub - Chip type: esp32s3 (revision v0.1) - Crystal frequency: 40MHz - Flash size: 8MB - Features: WiFi, BLE - MAC address: dc:54:75:c4:c6:54 - [00:00:14] [========================================] 689/689 0x0 - ``` - -1. Close the **Terminal** window. -1. Disconnect the USB cable of the **UNO R4 WiFi** board from your computer. -1. Connect the **UNO R4 WiFi** board to your computer with the USB cable again. - -**Troubleshooting for macOS:** - -* If you get a `Cannot put the board in ESP mode. (via 'unor4wifi-reboot')` error: disconnect and reconnect the board, then run the command again. -* If you get an `xattr: bin/espflash: No such xattr: com.apple.quarantine` or `xattr: bin/espflash: No such xattr: com.apple.quarantine` error, it means that the command has already been run, or is otherwise not needed. Proceed with the next step. - - - -## Linux - -1. Unplug any non-essential USB devices from your computer. -1. Connect the UNO R4 WiFi board to your computer with the USB cable. -1. Download unor4wifi-update-linux.zip -1. Extract the downloaded ZIP file. -1. Open [a command line terminal](https://ubuntu.com/tutorials/command-line-for-beginners) in the extracted folder. -1. Type the following command: - - ```text - ./update.sh - ``` - -1. Press the **Enter** key. -1. The terminal window might now show a list of the serial ports present on your computer. - - For example: - - ```text - Start flashing firmware - [2023-07-12T15:02:36Z INFO ] Detected 3 serial ports - [2023-07-12T15:02:36Z INFO ] Ports which match a known common dev board are highlighted - [2023-07-12T15:02:36Z INFO ] Please select a port - ❯ /dev/ttyACM0 - 7 Series/C210 Series Chipset Family USB xHCI Host Controller - /dev/ttyS4 - /dev/ttyS0 - ``` - - If so, use the **↓** key on your keyboard to select the port of the **UNO R4 WiFi** board from the list, and then press the **Enter** key. -1. The terminal window will now show the following prompt: - - ```text - ? Remember this serial port for future use? (y/n) › - ``` - - Press the **N** key on your keyboard. -1. The flashing process should now start. Wait for it to finish, as indicated by output that looks something like this: - - ```text - [2023-07-12T15:04:46Z INFO ] Serial port: '/dev/ttyACM0' - [2023-07-12T15:04:46Z INFO ] Connecting... - [2023-07-12T15:04:46Z INFO ] Using flash stub - Chip type: esp32s3 (revision v0.1) - Crystal frequency: 40MHz - Flash size: 8MB - Features: WiFi, BLE - MAC address: dc:54:75:c4:c6:54 - [00:00:14] [========================================] 689/689 0x0 - ``` - -1. Close the terminal window. -1. Disconnect the USB cable of the **UNO R4 WiFi** board from your computer. -1. Connect the **UNO R4 WiFi** board to your computer with the USB cable again. +Arduino IDE and Arduino Cloud both employ the **Arduino Firmware Uploader** tool. If you prefer, you can use it directly as a command-line application. You can find the [user documenation here](https://arduino.github.io/arduino-fwuploader/2.4/). --- - - -## Run espflash directly - -The above methods will not work if the board cannot be identified as a UNO R4 WiFi. This can happen if the custom firmware for the ESP32-S3 connectivity module is missing completely, or is not functioning correctly. However, the board can still be restored by [running espflash directly](https://github.com/arduino/uno-r4-wifi-usb-bridge/tree/main/unor4wifi-updater#option-2). - -Follow these steps: - -1. Unplug any non-essential USB devices from your computer. -1. Short the pins highlighted in the image using a jumper wire: - - ![The GND and Download ESP32 pins.](img/esp32-data-pins.png) -1. Connect the UNO R4 WiFi board to your computer with the USB cable. -1. Download and extract the .ZIP file for your system: - * unor4wifi-update-windows.zip - * unor4wifi-update-macos.zip - * unor4wifi-update-linux.zip -1. Open your system's command line application inside the extracted folder. - * **Windows:** Hold ⇧Shift and right-click any blank space inside the extracted folder. In the context menu, select **Open command window here / Open PowerShell window here**. - * **macOS:** Control-click on the unzipped `unor4wifi-update-macos` folder and select "**New Terminal at Folder**" from the context menu. A terminal window will open. - * **Linux:** Open [a command line terminal](https://ubuntu.com/tutorials/command-line-for-beginners) in the extracted folder. -1. Run the command: - * **Windows:** `bin\espflash write-bin -b 115200 0x0 (Get-Item .\firmware\UNOR4-WIFI-S3-*.bin).FullName` - * **macOS/Linux:** `./bin/espflash write-bin -b 115200 0x0 firmware/UNOR4-WIFI-S3-*.bin` - - -### Linux +## If you can't update the firmware {#if-you-cant-update-the-firmware} -1. Open the `unor4wifi-update-linux` in Terminal. +> [!NOTE] +> This section was previously titled **Run espflash directly**. -2. Run the following command: `./bin/espflash write-bin -b 115200 0x0 firmware/UNOR4-WIFI-S3-*.bin` +The above methods will not work if the board cannot be identified as a UNO R4 WiFi. This can happen if the custom firmware for the ESP32-S3 connectivity module is missing completely, or is not functioning correctly. However, the board can still be restored using the **espflash** utility: ---> +[Restore the USB connectivity firmware on UNO R4 WiFi with espflash](https://support.arduino.cc/hc/en-us/articles/16379769332892){.link-chevron-right}