Skip to content

Commit 681207f

Browse files
Flash the bootloader on GIGA R1 WiFi with dfu-util [HC-1222] (#277)
* Added instructions for dfu-util method * Rework the STM32CubeProgrammer section * Update content/Hardware Support/GIGA R1/Burn-the-bootloader-on-GIGA-R1-WiFi.md Co-authored-by: Renat0Ribeir0 <[email protected]> * Update content/Hardware Support/GIGA R1/Burn-the-bootloader-on-GIGA-R1-WiFi.md Co-authored-by: Renat0Ribeir0 <[email protected]> * Update content/Hardware Support/GIGA R1/Burn-the-bootloader-on-GIGA-R1-WiFi.md Co-authored-by: Renat0Ribeir0 <[email protected]> * Update content/Hardware Support/GIGA R1/Burn-the-bootloader-on-GIGA-R1-WiFi.md Co-authored-by: Renat0Ribeir0 <[email protected]> * Improve troubleshooting section * Add Troubleshooting section to TOC --------- Co-authored-by: Renat0Ribeir0 <[email protected]>
1 parent beda85e commit 681207f

File tree

4 files changed

+133
-26
lines changed

4 files changed

+133
-26
lines changed

content/Hardware Support/GIGA R1/Burn-the-bootloader-on-GIGA-R1-WiFi.md

Lines changed: 133 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,63 +3,170 @@ title: "Burn the bootloader on GIGA R1 WiFi"
33
id: 7991505977116
44
---
55

6-
## Before you begin
6+
Learn how to burn (flash) the bootloader on GIGA R1 WiFi.
77

8-
* Add the **Arduino Mbed OS Giga Boards** to Arduino IDE using the [Boards Manager](https://support.arduino.cc/hc/en-us/articles/360016119519-Add-boards-to-Arduino-IDE).
9-
* [Download and install the STM32CubeProgrammer from STMicroelectronics](https://www.st.com/en/development-tools/stm32cubeprog.html#st-get-software).
10-
* You will be required to provide and validate an email address to get a download link.
11-
* On macOS, you may need to run the executable directly: Right-click the `.app` container and select **Show package contents**, then navigate into `Contents/MacOs`. Double-click the file `SetupSTM32CubeProgrammer-X_Y_Z_macos` executable.
8+
In this article:
129

13-
## 1. Connect the board in bootloader mode
10+
* [Prepare your GIGA R1 WiFi for bootloader flashing](#prepare)
11+
* [Flash the bootloader with dfu-util (recommended)](#dfu-util)
12+
* [Flash the bootloader with STM32CubeProgrammer](#stm32cubeprogrammer)
13+
* [Troubleshooting](#troubleshooting)
1414

15-
1. With the board unplugged, press the button **BOOT0** and continue to press it.
15+
---
16+
17+
<a id="prepare"></a>
18+
19+
## Prepare your GIGA R1 WiFi for bootloader flashing
20+
21+
To burn the bootloader on GIGA R1 WiFi, it needs to be connected in DFU mode:
22+
23+
1. Connect your GIGA R1 WiFi to your computer using a USB cable.
24+
25+
1. Find the two push buttons labeled **BOOT0** and **RST** on the board:
26+
27+
1. Press and hold **BOOT0** button.
28+
29+
![The BOOT0 button on Giga R1 WiFi.](img/GIGA-R1-button-BOOT0.png)
30+
31+
1. Keep the **BOOT0** button pressed down, and press the **RST** button once.
32+
33+
![The RST button on Giga R1 WiFi.](img/GIGA-R1-button-RST.png)
34+
35+
1. Release both buttons. GIGA R1 WiFi will briefly disconnect and reconnect to your computer.
36+
37+
---
38+
39+
<a id="dfu-util"></a>
40+
41+
## Flash the bootloader with dfu-util (recommended)
42+
43+
If you've installed the **Arduino Mbed OS Giga Boards** package on your computer using the [Boards Manager in Arduino IDE](https://support.arduino.cc/hc/en-us/articles/360016119519-Add-boards-to-Arduino-IDE) or Arduino CLI, you can use the included **dfu-util** tool to flash the bootloader on your GIGA R1 WiFi board.
44+
45+
### Windows
46+
47+
1. [Prepare your GIGA R1 WiFI for bootloader flashing](#prepare).
48+
49+
1. Open **Command Prompt** by right-clicking in the bottom-left corner of the screen and selecting Command Prompt, or by searching for "cmd" in the taskbar.
50+
51+
1. Copy this command:
52+
53+
`"%LOCALAPPDATA%\Arduino15\packages\arduino\tools\dfu-util\0.11.0-arduino5\dfu-util" --device ,0x0483:0xdf11 -D "%LOCALAPPDATA%\Arduino15\packages\arduino\hardware\mbed_giga\4.0.6\bootloaders\GIGA\bootloader.bin" -a0 --dfuse-address=0x8000000`
54+
55+
1. If neccessary, modify the package version number (4.0.6) to whichever is installed.
56+
57+
1. Right-click inside the Command Prompt window to paste the command, then press <kbd>Enter</kbd> to begin flashing the bootloader.
58+
59+
> **Note:** To use Powershell instead of Command Prompt, copy this command instead:
60+
>
61+
> `&"$Env:LOCALAPPDATA\Arduino15\packages\arduino\tools\dfu-util\0.11.0-arduino5\dfu-util" --device ,0x0483:0xdf11 -D "$Env:LOCALAPPDATA\Arduino15\packages\arduino\hardware\mbed_giga\4.0.6\bootloaders\GIGA\bootloader.bin" -a0 --dfuse-address=0x8000000`
62+
63+
### macOS
64+
65+
1. [Prepare your GIGA R1 WiFI for bootloader flashing](#prepare).
1666

17-
![The BOOT0 button on Giga R1 WiFi.](img/giga-boot0-button.png)
67+
1. Open **Terminal**. You can find it with Spotlight by pressing <kbd>⌘</kbd> + <kbd>Space</kbd> and typing "Terminal".
1868

19-
2. Keep holding the **BOOT0** button as you connect the Giga R1 WiFi to your computer using a USB C cable.
69+
1. Copy this command:
2070

21-
3. When the ON LED is lit, release the **BOOT0** button.
71+
`~/Library/Arduino15/packages/arduino/tools/dfu-util/0.11.0-arduino5/dfu-util --device ,0x0483:0xdf11 -D ~/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.0.6/bootloaders/GIGA/bootloader.bin -a0 --dfuse-address=0x8000000`
2272

23-
<!-- If the board ON LED has lit up then release the BOO0 button. Now keep the board powered on with the USB C cable and continue this procedure -->
73+
1. If neccessary, modify the package version number (4.0.6) to whichever is installed.
2474

25-
## 2. Burn the bootloader using STM32CubeProgrammer
75+
1. Select the Terminal window and press <kbd>⌘</kbd> + <kbd>V</kbd> to paste the command, then press <kbd>Enter</kbd> to begin flashing the bootloader.
2676

27-
1. **[Download the bootloader file](https://github.com/arduino/ArduinoCore-mbed/raw/main/bootloaders/GIGA/bootloader.elf)**[^1].
77+
### Linux
2878

29-
2. Open STM32CubeProgrammer.
79+
1. [Prepare your GIGA R1 WiFI for bootloader flashing](#prepare).
3080

31-
3. Click on the **Open file** tab.
81+
1. Open your computer's command line application (often referred to as shell, terminal, console, prompt or various other names). Look for it in your launcher, or try the <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>T</kbd> keyboard shortcut (available on most Linux systems).
3282

33-
<!-- This won't upload to Zendesk for some reason: <img src="img/stm32cube-open-file.png" width=800px> -->
83+
1. Copy this command:
84+
85+
`~/.arduino15/packages/arduino/tools/dfu-util/0.11.0-arduino5/dfu-util --device ,0x0483:0xdf11 -D ~/.arduino15/packages/arduino/hardware/mbed_giga/4.0.6/bootloaders/GIGA/bootloader.bin -a0 --dfuse-address=0x8000000`
86+
87+
1. If neccessary, modify the package version number (4.0.6) to whichever is installed.
88+
89+
1. Select the Terminal window and press <kbd>Ctrl</kbd> + <kbd>⇧Shift</kbd> + <kbd>V</kbd> to paste the command, then press <kbd>Enter</kbd> to begin flashing the bootloader.
90+
91+
---
92+
93+
<a id="stm32cubeprogrammer"></a>
94+
95+
## Flash the bootloader with STM32CubeProgrammer
96+
97+
If you prefer to use a graphical interface, you can use <a class="link-external" href="https://www.st.com/en/development-tools/stm32cubeprog.html">STM32CubeProgrammer</a>.
98+
99+
> **Note:** To use STM32CubeProgrammer on macOS, you may need to run the executable directly: Right-click the `.app` container and select **Show package contents**, then navigate into `Contents/MacOs`. Double-click the file `SetupSTM32CubeProgrammer-X_Y_Z_macos` executable.
100+
101+
1. [Prepare your GIGA R1 WiFI for bootloader flashing](#prepare).
102+
103+
1. Open STM32CubeProgrammer and click on **Open file**.
34104

35105
<img src="https://content.arduino.cc/assets/stm32cube-open-file.png" width=800px>
36106

37-
4. Navigate to the [Arduino 15 folder](https://support.arduino.cc/hc/en-us/articles/360018448279-Open-the-Arduino15-folder), then select this file:
107+
1. Select the bootloader from one of the following locations:
108+
109+
* <a class="link-download" href="https://github.com/arduino/ArduinoCore-mbed/raw/main/bootloaders/GIGA/bootloader.elf">Download the bootloader file</a> and select it from your default download location.
110+
111+
* If you've installed the Arduino Mbed OS Giga Boards package, you can also find it inside your [Arduino15 folder](https://support.arduino.cc/hc/en-us/articles/360018448279-Open-the-Arduino15-folder).
38112

39-
`packages/arduino/hardware/mbed_giga/3.9.9/bootloaders/GIGA/bootloader.elf`
113+
* **Windows:** `C:\Users\{username}\AppData\Local\Arduino15\packages/arduino/hardware/mbed_giga/4.0.6/bootloaders/GIGA/bootloader.elf`
40114

41-
5. If you get a "Warning: File corrupted. Two or more segments defines the same memory zone" message, ignore it.
115+
* **macOS:** `~/Library/Arduino15/packages/arduino/hardware/mbed_giga/4.0.6/bootloaders/GIGA/bootloader.elf`
42116

43-
6. Set the programmer selection (default: ST-LINK) to **USB**.
117+
* **Linux:** `~/.arduino15/Arduino15/packages/arduino/hardware/mbed_giga/4.0.6/bootloaders/GIGA/bootloader.elf`
118+
119+
1. If you get a "Warning: File corrupted. Two or more segments defines the same memory zone" message, ignore it.
120+
121+
1. Set the programmer selection (default: ST-LINK) to **USB**.
44122

45123
<img src="img/stm32cube-usb-mode.png" width=800px>
46124

47-
7. For the **Port** selection, select your board. To refresh the list, click the update button.
125+
1. For the **Port** selection, select your board. To refresh the list, click the update button.
48126

49127
<img src="img/stm32cube-port-selection.png" width=800px>
50128

51-
8. Click on **Connect** button. The connection status should change from "Not connected" to "Connected".
129+
1. Click on **Connect** button. The connection status should change from "Not connected" to "Connected".
52130

53131
<img src="img/stm32cube-connect.png" width=800px>
54132

55-
9. Click on the **Download** button. If you get another warning message, close it by selecting OK.
133+
1. Click on the **Download** button. If you get another warning message, close it by selecting OK.
56134

57135
> **Note:** Click on the left part of the button where it says "Download" (not the arrow, which opens a context menu)
58136
59137
<img src="img/stm32cube-download.png" width=800px>
60138

61-
10. The message "File download complete" will appear as a pop-up notification when the download is complete.
139+
1. The message "File download complete" will appear as a pop-up notification when the download is complete.
140+
141+
1. Disconnect and reconnect GIGA R1 WiFi to your computer.
142+
143+
---
144+
145+
<a id="troubleshooting"></a>
146+
147+
## Troubleshooting
148+
149+
### `dfu-util: No DFU capable USB device available`
150+
151+
If you see this error, make sure you've followed the steps in [Prepare your GIGA R1 WiFI for bootloader flashing](#prepare).
152+
153+
### `Cannot open DFU device 0483:df11 found on devnum 2 (LIBUSB_ERROR_NOT_SUPPORTED)`
154+
155+
If you see this error on Windows, you may be missing the correct driver.
156+
157+
Follow these steps:
158+
159+
1. Open Device Manager and locate the **DFU in FS Mode** device under **Other devices**.
160+
* If you can't find it, try selecting **View > Show hidden devices**.
161+
* If a different device appears, such as STM device in DFU Mode (under Universal Serial Bus controller), right-click and select **Uninstall device**.
62162

63-
11. Disconnect the board from the USB-C cable and connect it again.
163+
![Device Manager.](img/device-manger-dfu-in-fs-mode.png)
164+
1. Right-click on the DFU in FS Mode device and select **Update driver… / Update driver software...** from the context menu.
165+
1. In the wizard, select **Browse my computer for driver software**.
166+
1. Select **Let me pick from a list of device drivers on my computer**.
167+
1. From the list of device classes, select **Universal Serial Bus devices**. If you don’t see it, untick **Show compatible hardware**.
168+
1. Select **WinUsb Device > WinUsb Device**.
169+
1. Click **Next**.
170+
1. Confirm that you want to install the driver.
64171

65-
[^1]: If you've installed the **Arduino Mbed OS Giga Boards** package, you can also find it inside your [Arduino15 folder](https://support.arduino.cc/hc/en-us/articles/360018448279-Open-the-Arduino15-folder). The path is `Arduino15/packages/arduino/hardware/mbed_giga/3.9.12/bootloaders/GIGA/bootloader.elf`.
172+
After installing the driver, try flashing the bootloader with dfu-util again.
118 KB
Loading
117 KB
Loading
45.3 KB
Loading

0 commit comments

Comments
 (0)