Firmware update crash

I have been trying for days to get stable or consistent I2C communication on a R4Wifi (MPU6050 communication) and have pretty well given up. Everything works fine on an R3, Mega, Nano and Nano33 but on the R4 I am seeing erratic behavior, periodic freezing and inconsistency from one power up to the next.

Anyway, I thought I should do a firmware update to see if that made any difference. The update (using IDE 2.3.3) failed. Oh well, nothing lost, but here's the thing. Before the attempted update this is what the board was reporting :-
NewR4info

After the failed update this is what I am seeing
CookedR4
Can't upload to the board, communicate via serial or do anything at all.

Powered down. Powered up the next day to double check. Now it reports this
CookedR4again

Is this board cooked?

Hi @kusana. There is an essential final step after updating the firmware on the UNO R4 WiFi: this is to power cycle the board by unplugging the USB cable and then plugging the cable back in again. If you don't do that, and then upload a sketch to the board, the firmware will be replaced by the sketch you uploaded.

It is possible to recover the board from this state by performing a special procedure. I am happy to provide instructions for doing this, but I will first need to know which operating system you are using (e.g., "Windows") so that I can provide the appropriate instructions.

Wow, that was quick. Thank you.

Yes Windows. Specifically Win10.

The board can be recovered by flashing the standard firmware to the bridge module. The tools we normally use for updating the firmware can't be used when the board is in this state, so it is necessary to use a command line procedure.

I'll provide instructions you can follow to do that:

  1. Disconnect the USB cable of the UNO R4 WiFi board from your computer.
  2. Use a jumper wire to connect these two pins ("DOWNLOAD" and "GND") on the 2x3 male header that is near the USB socket on the UNO R4 WiFi board:
    📷

    Arduino - CC BY-SA 4.0 (cropped)

  3. Connect the UNO R4 WiFi board to your computer with a USB cable.
  4. Open the release page for the latest version of the firmware in your web browser:
    https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/latest
  5. Click the "unor4wifi-update-windows.zip" download link under the "Assets" section of the release page:
  6. Wait for the download to finish.
  7. Extract the downloaded file.
  8. Start Windows "File Explorer".
  9. Open the unor4wifi-update-windows folder that was created when you extracted the downloaded unor4wifi-update-windows.zip file at the previous step in the instructions.
  10. In the folder listing of the unor4wifi-update-windows folder, hold the Shift key while clicking the right hand button on the mouse.
    A context menu will open.
  11. Select "Open PowerShell window here" from the menu.
    Windows PowerShell will now open.
  12. Type the following command at the Windows PowerShell window command prompt:
    bin\espflash write-bin -b 115200 0x0 (Get-Item .\firmware\UNOR4-WIFI-S3-*.bin).FullName
    
  13. Press the Enter key.
  14. The PowerShell window might now show a list of the serial ports present on your computer.
    For example:
    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
      COM42- USB Serial Device (COM42)
    
    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.
  15. The terminal window will now show the following prompt:
    ? Remember this serial port for future use? (y/n) ›
    
    Press the N key on your keyboard.
  16. The flashing process should now start. Wait for it to finish, as indicated by output that looks something like this:
    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] [========================================]      826/826     0x0
    
  17. Disconnect the USB cable of the UNO R4 WiFi board from your computer.
    :exclamation: It is essential to perform this step.
  18. Disconnect the jumper wire you added at step (2) of the instructions.
  19. Connect the UNO R4 WiFi board to your computer with the USB cable again.

The board should now be recognized correctly in Arduino IDE once again.


Please let me know if you have any questions or problems while following those instructions.

1 Like

I will give it a go and advise.

Worked like a charm. Thanks again. I am duly relieved.

Now to see whether there is any change to the wire.h or I2C behavior.

You are welcome. I'm glad the board is correctly identified now.

Regards, Per