Skip to content

Commit 87086cd

Browse files
committed
Add "restore default firmware" section
1 parent 2730ecb commit 87086cd

File tree

1 file changed

+72
-5
lines changed
  • content/hardware/02.hero/boards/uno-r4-wifi/tutorials/esp32-upload

1 file changed

+72
-5
lines changed

content/hardware/02.hero/boards/uno-r4-wifi/tutorials/esp32-upload/esp32-upload.md

Lines changed: 72 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ author: Hannes Siebeneicher
55
tags: [ESP32, esptool, Flash]
66
---
77

8+
***This article is not suitable for beginners as it easily breaks your board especially when the serial bridge is not properly implemented.***
9+
810
The [Arduino UNO R4 WiFi](/hardware/uno-r4-wifi) has two different microcontrollers onboard, the Renesas RA4M1 and the ESP32-S3.
911

1012
By default, the ESP32-S3 module acts as a serial bridge, handling the connection to your computer. It also handles the rebooting of the main MCU, the Renesas RA4M1 when it is needed, for example when receiving a new sketch and resetting.
@@ -19,10 +21,12 @@ The UNO R4 WiFi also exposes the ESP32's data lines, so that you can program the
1921

2022
- [Arduino UNO R4 WiFi](/hardware/uno-r4-wifi)
2123
- [Python®](https://www.python.org/downloads/)
22-
- esptool
24+
- [esptool](https://docs.espressif.com/projects/esptool/en/latest/esp32/)
2325

2426
## Step 1: ESP32 Download Mode
2527

28+
***We don't provide any custom firmware in this tutorial. If you flash a firmware that doesn't enable a serial-usb-bridge between two microcontrollers you will lose most of the board's functionality!***
29+
2630
In order to flash custom firmware to the ESP32-S3 we need to put the chip in download mode by shorting the **download pin** and **GND**. The download pin can be found on the 3x2 header at the top of the board or on the downside using the exposed pads.
2731

2832
![ESP32-S3 download pin](./assets/esp32-data-pins.png)
@@ -31,13 +35,15 @@ The easiest way is to use a female-to-female cable and short the pins at the top
3135

3236
## Step 2: Flash Firmware
3337

34-
Once the chip is set to the right mode we use esptool to flash custom firmware to the board. For this to work you will need to download and install Python, which you can then use to install esptool using a simple command. Verify that python is installed by opening your terminal and write ``pip3``. Once you have confirmed that it's installed properly install esptool by typing:
38+
Once the chip is set to the right mode we use esptool to flash custom firmware to the board. For this to work you will need to download and install Python, which you can then use to install esptool using a simple command. Verify that python is installed by opening your terminal and write ``pip3``. You should see a list of commands shown in the terminal. Once you have confirmed that it's installed properly install esptool by typing:
3539

3640
```
3741
pip3 install esptool
3842
```
3943

40-
Next, `esptool.py` should be added to your path so you can run it from anywhere, instead of navigating to the installation folder each time. Once everything is working it's just a matter of running the following two commands:
44+
Next, `esptool.py` should be added to your **PATH** so you can run it from anywhere, instead of navigating to the installation folder each time. The PATH variable allows you to run commands and programs from any location on your computer without having to specify the full path to the executable file. This is done differently depending on your operating system, you can read more about it [here](https://learn.sparkfun.com/tutorials/configuring-the-path-system-variable/all).
45+
46+
Flashing a new firmware is done in two steps, first erasing the firmware currently on the module and then flashing the new one. Once everything is set up it's just a matter of running the following two commands:
4147

4248
To erase the flash memory run:
4349
```
@@ -51,9 +57,70 @@ esptool.py --chip esp32s3 --port <your port> write_flash -z 0 <yourCustomFirmwar
5157

5258
***Please note that we don't provide any custom firmware in this tutorial. If you flash a firmware that doesn't enable a serial-usb-bridge between two microcontrollers you will lose most of the board's functionality!***
5359

54-
## Restore Default Software
60+
## Restore Default Firmware
61+
62+
Restoring the default firmware varies slightly depending on which operating system you are using.
63+
64+
**Windows**
65+
66+
1. [Download the latest firmware](https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/download/0.2.0/unor4wifi-update-windows.zip) and unzip it.
67+
68+
2. Unplug all the USB devices except for your **UNO R4 WiFi**.
69+
70+
3. Open the **update.bat** file - if a warning dialog appears, click on "More info" and then "Run anyway".
71+
72+
4. Follow the steps inside the terminal and select your board from the device list (if you still see more than one device after unplugging everything apart from the board, check under Windows' Device Manager)
73+
74+
5. Once done, unplug the board, connect it again and you should have the default firmware installed again.
75+
76+
**MacOS**
77+
78+
1. [Download the latest firmware](https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/download/0.2.0/unor4wifi-update-macos.zip) and unzip it.
79+
80+
2. Unplug all the USB devices except for your **UNO R4 WiFi**.
81+
82+
3. Right-click on the folder, select "New terminal at folder" (you might find it under "Services"), and launch the following commands:
83+
84+
``
85+
chmod a+x update.command
86+
``
87+
88+
``
89+
sudo xattr -d com.apple.quarantine bin/espflash
90+
``
91+
92+
``
93+
sudo xattr -d com.apple.quarantine bin/unor4wifi-reboot-macos
94+
``
95+
96+
4. Launch this command in your terminal:
97+
98+
``
99+
./update.command
100+
``
101+
102+
5. Follow the steps inside the terminal and select your board from the device list, it is listed as
103+
/dev/tty.usbmodem141301 - USB JTAG_serial debug unit.
104+
105+
6. Once done, unplug the board, connect it again and you should have the default firmware installed again.
106+
107+
**Linux**
108+
109+
1. [Download the latest firmware](https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/download/0.2.0/unor4wifi-update-linux.zip) and unzip it.
110+
111+
2. Unplug all the USB devices except for your **UNO R4 WiFi**.
112+
113+
3. Right-click on the folder, select "Open in Terminal" and launch the following command:
114+
115+
``
116+
sudo ./update.sh
117+
``
118+
119+
4. Follow the steps inside the terminal and answer yes to the first question, no to the second.
120+
121+
5. Once done, unplug the board, connect it again and you should have the default firmware installed again.
55122

56-
If you want to return to the default firmware simply download the zip file found [here](https://github.com/arduino/uno-r4-wifi-usb-bridge/releases/download/0.2.0/unor4wifi-update-windows.zip). It contains two folders and one `.bat` file, that when executed flashes the default firmware to your board. It's configured in a way so that it takes care of everything and you **don't** need to short the **download** pin and **GND**. If for some reason the script doesn't execute properly or is unable to set your board into download mode you can instead repeat the manual steps of shorting the download pin and GND, and then flash the firmware manually using the `.bin` found in the firmware folder and the esptool.
123+
Alternatively you can also repeat **Step 1** and **Step 2** using the ``.bin`` file found inside the ``.zip`` file using the esptool.
57124

58125
## Conclusion
59126

0 commit comments

Comments
 (0)