You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Carrier or shield compatible with the Portenta H7 with an SD card slot (if using SD card method)
@@ -101,15 +101,15 @@ void loop()
101
101
}
102
102
```
103
103
104
-
This script will light up the RGB LED with 3 different colors in sequence. This code will need to be uploaded to the Arduino Portenta H7 first. This is to verify whether the sketch compiles and works correctly. After verifying this, in the Arduino IDE, you will search for **Sketch > Export Compiled Binary**.
104
+
This script will light up the RGB LED with 3 different colors in sequence. This code will need to be uploaded to the Arduino Portenta H7 first. This is to verify whether the sketch compiles and works correctly. After verifying this, in the Arduino IDE, navigate to **Sketch > Export Compiled Binary** (or use the keyboard shortcut **Alt+Ctrl+S**).
105
105
106
106

107
107
108
108
With the binary file ready, you can now create the OTA file needed to enable the Over-The-Air process.
109
109
110
110
### Creating the OTA File
111
111
112
-
To create the OTA file, you will need a macOS, Linux, or Windows environment with Python 3 installed.
112
+
To create the OTA file, you will need a macOS, Linux, or Windows environment with Python® 3 installed.
113
113
114
114
Once you have a compatible environment, you will need the tools which can be found at the following link:
115
115
@@ -146,24 +146,24 @@ Convert your encoded file into `.ota` format
146
146
147
147
You can use `OTA_Usage_Portenta.ino.PORTENTA_H7_M7` as a sketch name for easier identification of the file. After this, you will have the `.ota` file of the sketch that you will use with the OTA process.
148
148
149
-
### Installing Python 3 On Linux
149
+
### Installing Python® 3 On Linux
150
150
151
-
If you are using Linux and cannot run the **`bin2ota.py`** script, you may need to install [Python 3](https://www.python.org/) and the necessary modules. To do this, execute the following command on your **Linux terminal**:
151
+
If you are using Linux and cannot run the **`bin2ota.py`** script, you may need to install [Python® 3](https://www.python.org/) and the necessary modules. To do this, execute the following command on your **Linux terminal**:
152
152
153
153
```bash
154
154
sudo apt install python-is-python3
155
155
```
156
156
157
-
You will also need to install the **`crccheck`** module for Python by following these instructions:
157
+
You will also need to install the **`crccheck`** module for Python® by following these instructions:
158
158
159
-
Installing pip on python:
159
+
Installing pip on Python®:
160
160
161
161
```bash
162
162
//Necessary to install python modules:
163
163
sudo apt install python3-pip
164
164
```
165
165
166
-
Installing the `crccheck` necessary module on python:
166
+
Installing the `crccheck` necessary module on Python®:
167
167
168
168
```bash
169
169
//Necessary to run the script:
@@ -206,17 +206,24 @@ If you are going to use the example OTA file provided in this tutorial, you don'
206
206
207
207
#### Setting Up
208
208
209
-
To use the internal **QSPI** storage for downloading the binary file via OTA (Over-The-Air), you will only need the Arduino Portenta H7 board connected to the computer with the [Arduino IDE](https://www.arduino.cc/en/software). You will need to select the **Arduino Portenta H7 (M7 Core)** with the Flash split of **1 MB M7 + 1 MB M4** for the purpose of this tutorial and the corresponding port.
209
+
To use the internal **QSPI** storage for downloading the binary file via OTA (Over-The-Air), you will only need the Arduino Portenta H7 board connected to the computer with the [Arduino IDE](https://www.arduino.cc/en/software).
210
+
211
+
Before uploading the OTA sketch, configure the following settings in the Arduino IDE via the **Tools** menu:
212
+
213
+
-**Board**: Select `Arduino Portenta H7`
214
+
-**Flash split**: Select `1MB M7 + 1MB M4`
215
+
-**Target core**: Select `Main Core` (M7 core)
216
+
-**Port**: Select the appropriate COM port for your Portenta H7
To proceed with OTA using the QSPI flash, you can open the sketch from **Examples > Arduino_Portenta_OTA > OTA_Qspi_Flash**.
216
223
217
-
***Do not forget to fill in your Wi-Fi AP SSID and password in the `arduino_secrets.h` tab.***
224
+
***Do not forget to fill in your Wi-Fi® AP SSID and password in the `arduino_secrets.h` tab.***
218
225
219
-
This sketch will connect to your Wi-Fi, verify whether the OTA feature is available by checking the installed firmware on your Portenta.
226
+
This sketch will connect to your Wi-Fi®, verify whether the OTA feature is available by checking the installed firmware on your Portenta.
220
227
221
228
Then prepare the OTA storage, download the .ota file from the internet, decompress it, reset the board so that after the reboot, it will apply the new firmware
222
229
@@ -228,15 +235,20 @@ To use the **SD card** as the preferred OTA (Over-The-Air) storage device, you c
228
235
229
236

230
237
231
-
You will need to select the **Arduino Portenta H7 (M7 Core)** with the Flash split of **1 MB M7 + 1 MB M4** for the purpose of this tutorial and the corresponding port.
238
+
Before uploading the OTA sketch, configure the following settings in the Arduino IDE via the **Tools** menu:
239
+
240
+
-**Board**: Select `Arduino Portenta H7`
241
+
-**Flash split**: Select `1MB M7 + 1MB M4`
242
+
-**Target core**: Select `Main Core` (M7 core)
243
+
-**Port**: Select the appropriate COM port for your Portenta H7
232
244
233
245
#### Writing the Script
234
246
235
247
Similar to the QSPI storage mode, to proceed with OTA using the SD Card, you can open the sketch from **Examples > Arduino_Portenta_OTA > OTA_SD_Portenta**.
236
248
237
-
***Do not forget to fill in your Wi-Fi AP SSID and password in the `arduino_secrets.h` tab.***
249
+
***Do not forget to fill in your Wi-Fi® AP SSID and password in the `arduino_secrets.h` tab.***
238
250
239
-
This sketch will connect to your Wi-Fi, verify whether the OTA feature is available by checking the installed firmware on your Portenta.
251
+
This sketch will connect to your Wi-Fi®, verify whether the OTA feature is available by checking the installed firmware on your Portenta.
240
252
241
253
Then prepare the OTA storage, download the .ota file from the internet, decompress it, reset the board so that after the reboot, it will apply the new firmware
242
254
@@ -537,9 +549,213 @@ void loop()
537
549
}
538
550
```
539
551
552
+
## Understanding LZSS Compression and Decompression
553
+
554
+
For those interested in the underlying compression mechanism or optimizing download performance, you can explore different decompression methods.
555
+
556
+
The standard OTA examples use a two-step process:
557
+
558
+
1. Download the compressed `.ota` file to storage
559
+
2. Decompress the file before firmware update
560
+
561
+
However, the `Arduino_Portenta_OTA` library also supports **on-the-fly decompression**, where the file is decompressed as it's being downloaded, which can be more efficient for certain use cases.
562
+
563
+
The following example shows both methods and allows you to compare their performance:
564
+
565
+
```cpp
566
+
/*
567
+
* This example demonstrates how to download a lzss file and decompress it in two ways:
568
+
* -1 download the file on the filesystem and then decompress the downloaded file on the filesystem
569
+
* -2 download and decompress the file on the fly
570
+
* this sketch also provides a comparison in terms of speed and execution time
For troubleshooting issues that might have arisen while following the tutorial, you can use the following tips to solve the issue.
543
759
544
-
- If there has been an issue with the Wi-Fi module, it means the device may have lost the Wi-Fi firmware partition. To solve this, you will have to use the **WiFiFirmwareUpdater** sketch found in the Arduino IDE examples to fix the issue.
760
+
- If there has been an issue with the Wi-Fi® module, it means the device may have lost the Wi-Fi® firmware partition. To solve this, you will have to use the **WiFiFirmwareUpdater** sketch found in the Arduino IDE examples to fix the issue.
545
761
- QSPI storage may throw error -3 while running the Portenta H7 OTA QSPI example. To fix this, you can use the guide on [Reading and Writing Flash Memory](https://docs.arduino.cc/tutorials/portenta-h7/reading-writing-flash-memory) in the section **Programming the QSPI Flash**. At this point, run the example again, and the error -3 (OTA Storage initialization error) should be resolved.
0 commit comments