diff --git a/content/hardware/04.pro/boards/portenta-c33/tutorials/user-manual/content.md b/content/hardware/04.pro/boards/portenta-c33/tutorials/user-manual/content.md index b218f134e0..4d7096b6c5 100644 --- a/content/hardware/04.pro/boards/portenta-c33/tutorials/user-manual/content.md +++ b/content/hardware/04.pro/boards/portenta-c33/tutorials/user-manual/content.md @@ -72,7 +72,7 @@ The **Arduino Renesas Boards** core contains the libraries and examples to work The complete pinout is available and downloadable as PDF from the link below: -- [Portenta C33 pinout](https://docs.arduino.cc/static/903c16295f3bf076c2ed23eb1b38791c/ABX00074-full-pinout.pdf) +- [Portenta C33 pinout](https://docs.arduino.cc/resources/pinouts/ABX00074-full-pinout.pdf) ### Datasheet diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/ble-connectivity/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/ble-connectivity/content.md index 61286298ab..5500e8f7ca 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/ble-connectivity/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/ble-connectivity/content.md @@ -50,7 +50,7 @@ To communicate with the Portenta H7 via Bluetooth®, you need to upload a pre-bu ### 1. The Basic Setup -Begin by plugging in your Portenta board to the computer using a USB-C® cable and open the Arduino IDE. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [set up the Portenta H7 for Arduino](setting-up-portenta) before you proceed. +Begin by plugging in your Portenta board to the computer using a USB-C® cable and open the Arduino IDE. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [set up the Portenta H7 for Arduino](https://docs.arduino.cc/tutorials/portenta-h7/setting-up-portenta/) before you proceed. ![The Portenta H7 can be connected to the computer using an appropriate USB-C® cable](assets/por_ard_ble_basic_setup.svg) @@ -184,18 +184,18 @@ On your mobile device install **nRF Connect** or an equivalent app that allows f Once you have downloaded the nRF application on your mobile device, look for your Portenta in the device list. You may filter the list by "Portenta" to easierly find your board in case you are using **nRF Connect**. -- When you found your board in the list tap "Connect". +- When you find your board in the list tap "Connect". - Navigate to the "Services" screen and tap the arrow up button. - Switch to "Bool" type and move the toggle to "True". Confirm the dialog with a tap on "Write" and you should see the built-in LED turned on. If you do the same procedure again but setting the toggle switch to "False", it will turn off the LED. ![In the nRF Connect app use a Bool toggle switch to toggle the built-in LED.](assets/por_ard_ble_nrf_connect.png) ## Conclusion -This tutorial shows how to connect and control the built-in LED using a Bluetooth® Low Energy connection. You have learnt how a simple Bluetooth® Low Energy connection between your Portenta and your cell phone, which has basic communication abilities between the two devices, works. +This tutorial shows how to connect and control the built-in LED using a Bluetooth® Low Energy connection. You have learned how a simple Bluetooth® Low Energy connection between your Portenta and your cell phone, which has basic communication abilities between the two devices, works. ### Next Steps -Now that you learnt how to configure the Portenta as a Bluetooth® Low Energy endpoint, you can try with two Portentas (or other Bluetooth® Low Energy capable Arduino devices), to facilitate bidirectional communication. More information on how to achieve that can be found on the [BLE library reference page](https://www.arduino.cc/en/Reference/ArduinoBLE). +Now that you learned how to configure the Portenta as a Bluetooth® Low Energy endpoint, you can try with two Portentas (or other Bluetooth® Low Energy capable Arduino devices), to facilitate bidirectional communication. More information on how to achieve that can be found on the [BLE library reference page](https://www.arduino.cc/en/Reference/ArduinoBLE). ## Troubleshooting diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/creating-gui-with-lvgl/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/creating-gui-with-lvgl/content.md index 9ebab73243..312212038a 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/creating-gui-with-lvgl/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/creating-gui-with-lvgl/content.md @@ -54,7 +54,7 @@ This tutorial will guide you through building a basic user interface using the L ### 1. The Basic Setup -Begin by plugging your Portenta board into the computer using a USB-C® cable and open the Arduino IDE. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [set up the Portenta H7 for Arduino](setting-up-portenta) before you proceed. +Begin by plugging your Portenta board into the computer using a USB-C® cable and open the Arduino IDE. If this is your first time running Arduino sketch files on the board, we suggest you check out how to [set up the Portenta H7 for Arduino](https://docs.arduino.cc/tutorials/portenta-h7/setting-up-portenta/) before you proceed. ![The Portenta H7 can be connected to the computer using an appropriate USB-C® cable](assets/por_ard_lvgl_basic_setup.svg) diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/dual-core-processing/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/dual-core-processing/content.md index 127d421f71..dd18ec5e25 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/dual-core-processing/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/dual-core-processing/content.md @@ -31,7 +31,7 @@ The Portenta H7 is equipped with a processor that has two processing units calle ### Required Hardware and Software -- [Portenta H7 (ABX00042)](https://store.arduino.cc/portenta-h7) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) +- [Portenta H7 (ABX00042)](https://store.arduino.cc/portenta-h7), [Portenta H7 Lite (ABX00045)](https://store.arduino.cc/products/portenta-h7-lite) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) - USB-C® cable (either USB A to USB-C® or USB-C® to USB-C®) - Arduino IDE 1.8.10+  @@ -192,4 +192,4 @@ This tutorial introduces the idea of dual core processing and illustrates the co ### Next Steps -- Proceed with the next tutorial [Setting Up a Wi-Fi Access Point](wifi-access-point) to learn how to make use of the built-in Wi-Fi module and configure your Portenta H7 as a Wi-Fi access point. +- Proceed with the next tutorial [Setting Up a Wi-Fi Access Point](https://docs.arduino.cc/tutorials/portenta-h7/wifi-access-point/) to learn how to make use of the built-in Wi-Fi module and configure your Portenta H7 as a Wi-Fi access point. diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/flash-optimized-key-value-store/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/flash-optimized-key-value-store/content.md index 7900f0addb..565dbba21f 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/flash-optimized-key-value-store/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/flash-optimized-key-value-store/content.md @@ -30,7 +30,7 @@ In this tutorial you will learn how to use the Mbed OS [TDBStore API](https://os - [Portenta H7 (ABX00042)](https://store.arduino.cc/products/portenta-h7), [Portenta H7 Lite (ABX00045)](https://store.arduino.cc/products/portenta-h7-lite) or [Portenta H7 Lite Connected (ABX00046)](https://store.arduino.cc/products/portenta-h7-lite-connected) - USB-C® cable (either USB-A to USB-C® or USB-C® to USB-C®) -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ or Arduino CLI 0.13.0+ +- [Arduino IDE 2.0+](https://www.arduino.cc/en/software) or [Arduino CLI 0.13.0+](https://www.arduino.cc/pro/software-pro-cli/) ## Instructions diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/getting-started-openmv-micropython/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/getting-started-openmv-micropython/content.md index 304ac0486c..67b040c00e 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/getting-started-openmv-micropython/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/getting-started-openmv-micropython/content.md @@ -162,7 +162,7 @@ In this tutorial you learned how to use the OpenMV IDE with your Portenta board. ### Next Steps - Experiment with MicroPythons capabilities. If you want some examples of what to do, take a look at the examples included in the OpenMV IDE. Go to: **File > Examples > Arduino > Portenta H7** in the OpenMV IDE. -- Take a look at the other Portenta H7 tutorials which showcase its many uses. You can find them [here](https://docs.arduino.cc/hardware/portenta-h7#tutorials). +- Take a look at the other Portenta H7 tutorials which showcase its many uses. You can find them [here](https://docs.arduino.cc/hardware/portenta-h7/#tutorials). ## Troubleshooting diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/openmv-cheat-sheet/openmv-cheat-sheet.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/openmv-cheat-sheet/openmv-cheat-sheet.md index 3726df94ce..4bbf0931f5 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/openmv-cheat-sheet/openmv-cheat-sheet.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/openmv-cheat-sheet/openmv-cheat-sheet.md @@ -1,6 +1,7 @@ --- title: 'Arduino Portenta H7 MicroPython Cheat Sheet' description: 'Learn how to set up the Arduino Portenta H7 for OpenMV. Obtain information regarding pins and how to use OpenMV and MicroPython.' +difficulty: beginner tags: - Installation - MicroPython diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md index 64ee549dd3..fe54aa18c3 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/over-the-air-update/content.md @@ -1,440 +1,441 @@ ---- -title: 'Over-The-Air (OTA) Updates with the Arduino Portenta H7' -description: 'Learn how to perform an OTA update of the firmware on the Arduino Portenta H7' -tags: - - OTA - - Over-The-Air - - Wi-Fi - - Cloud -author: 'Taddy Chung, José Bagur' -libraries: - - name: Arduino IoT Cloud - url: https://www.arduino.cc/reference/en/libraries/arduinoiotcloud/ - - name: Arduino_Portenta_OTA - url: https://github.com/arduino-libraries/Arduino_Portenta_OTA -hardware: - - hardware/04.pro/boards/portenta-h7 - - hardware/04.pro/boards/portenta-h7-lite-connected -software: - - ide-v1 - - ide-v2 - - web-editor - - cli ---- - -## Overview -In this tutorial, you will learn how to use and allow firmware updates via **OTA (Over-The-Air)** feature with the **Arduino Portenta H7**. With this tutorial, you will be able to create a binary file to be used with the OTA feature and use the internal **QSPI** or a external **SD card** to accomplish the OTA (Over-The-Air) process. - -***To proceed with OTA using a SD Card, you will need to use a carrier or shield with a SD card slot, e.g Portenta Breakout, Portenta Max Carrier, Portenta Vision shield.*** - -## Goals -The goals of this tutorial are: -- Create an OTA file required to use the OTA (Over-The-Air) feature. -- Use QSPI or SD card storage to load the firmware downloaded using the OTA feature. - -## Hardware and Software Needed -- [Arduino Portenta H7](https://store.arduino.cc/portenta-h7) -- Operative System: Linux or MacOS system, this procedure is not 100% compatible on Windows. -- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ -- USB-C® type cable (either USB-A to USB-C® or USB-C® to USB-C®) -- Arduino IoT Cloud and Arduino_Portenta_OTA libraries -- SD card (optional, you can use QSPI instead) -- Carrier or shield compatible with the Portenta H7 with a SD Card slot, in case you choose to use the SD Card. - -## What OTA Means -**OTA** (Over-The-Air) is a method of distributing wirelessly to end devices to update their firmware, configuration or security-related protocols. The purpose of this method is to change a device’s behavior or its settings for better performance, for adding new features or to change its targeted usage. - -## Instructions - -We will explain briefly the steps required to be able to use OTA (Over-The-Air) process with Arduino Portenta H7. It will consist of firmware OTA file creation and use of preferred storage mode (QSPI or SD card). - -### Firmware OTA File Creation -You will need to create the binary file required for the OTA (Over-The-Air) process to be able use it with either storage option stated previously. For the purpose of this tutorial, you will have to use the following script to create the binary file. - -```cpp -/* - This sketch can be used to generate an example binary that can be uploaded to Portenta via OTA. - It needs to be used together with - - 'OTA_Qspi_Flash.ino' if you want to use the Qspi Flash as storage system - OR - - 'SD_Qspi_Flash.ino' if you want to use the SD card as storage system - - Steps to test OTA on Portenta: - 1) Upload this sketch or any other sketch (this one lights up the RGB LED with different colours). - 2) In the IDE select: Sketch -> Export compiled Binary - 3) Upload the exported binary to a server - 4) Choose a storage mechanism (SD or QSPI), open the related OTA_*_Portenta.ino sketch, - eventually update the OTA_FILE_LOCATION - 5) Upload the sketch OTA_*_Portenta.ino to perform OTA via SD or QSPI Flash -*/ - -void setLed(int blue, int green, int red) { - digitalWrite(LEDB, blue); - digitalWrite(LEDG, green); - digitalWrite(LEDR, red); -} - - -void setup() -{ - pinMode(LEDB, OUTPUT); - pinMode(LEDG, OUTPUT); - pinMode(LEDR, OUTPUT); -} - -void loop() -{ //led BLUE ON - setLed(1, 0, 0); - delay(1000); - //led GREEN ON - setLed(0, 1, 0); - delay(1000); - //led RED ON - setLed(0, 0, 1); - delay(1000); -} -``` - -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 firsthand. This is to verify whether the sketch compiles and is working correctly. After verifying this, in Arduino IDE, you will search for **Sketch > Export Compiled Binary**. - -![Exporting Binary for the Sketch](assets/binary_export.png) - -With the binary file ready, you can now create the OTA file needed to enable Over-The-Air process. - -To continue, macOS or Linux environment is required. For Windows environment, it is possible to use virtualization software such as [Oracle VM Virtualbox](https://www.virtualbox.org/) using your preferred choice of compatible Linux distribution. If you're not familiar with Linux environments, [Ubuntu](https://ubuntu.com/) is one of many distributions that can help you explore Linux environment with ease of access. - -Once you're comfortable with an environment, you will need a tool which can be found at the following link. - -***Arduino IoT Cloud Library - Over-The-Air Tools: https://github.com/arduino-libraries/ArduinoIoTCloud/tree/master/extras/tools*** - -You will have to extract the library at a preferred location to be able to use the tools. Then, you will need to run on the terminal the following commands in sequence to be able to create the OTA file. - -Copy the binary file into the library tool's folder - -```cpp -// Exported binary format reference: sketch.bin -cp OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin ~/Arduino/libraries/ArduinoIoTCloud/extras/tools/ -``` - -Go inside that directory - -```cpp -cd ~/Arduino/libraries/ArduinoIoTCloud/extras/tools -``` - -Encode your binary file into `OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss` - -```cpp -// Argument format: ./lzss.py --encode sketch.bin sketch.lzss -./lzss.py --encode OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss -``` - -Convert your encoded file into `.ota` format - -```cpp -// Argument format: ./bin2ota.py PORTENTA_H7_M7 sketch.lzss sketch.ota -./bin2ota.py PORTENTA_H7_M7 OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota -``` - -You can use `OTA_Usage_Portenta.ino.PORTENTA_H7_M7` as a sketch name for facilitated identification of the file. After this, you will have the `.ota` file of the sketch that you will use with the OTA process. - -### Installing Python 3 On Linux - -If you are using Linux, maybe you cannot run the **bin2ota.py** script. This may be because you need to install [Python 3](https://www.python.org/) and the necessary modules. To do it execute the next command on your **Linux terminal**: - -```cpp -sudo apt install python-is-python3 -`````` - -You will also need to install the **crccheck** module on python by following the next instructions: - -Installing pip on python: -```cpp -//Necessary to install python modules: -sudo apt install python3-pip -``` -Installing the crccheck necessary module on python: - -```cpp -//Necessary to run the script: -pip install crccheck -``` -Once you have done it, you should be able to run the bin2ota.py script successfully. - -### Uploading OTA file to the net ### - -Now you can upload your .OTA file to an online reachable location, e.g. *OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota* has been uploaded to: - -https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota - -You can change the default file location on the code by modifying the next line on the ***"OTA_Qspi_Flash"** sketch or in the **"OTA_SD_Portenta"** sketch depending on which method are you going to follow: - -```cpp -static char const OTA_FILE_LOCATION[] = "Introduce here your online OTA file location"; -``` -It is important to know that if your OTA file is uploaded to an HTTPS website you will need to modify the next line in the code: - -```cpp - int const ota_download = ota.download(OTA_FILE_LOCATION, true /* is_https */); -``` -This line is in **line 87** for the **"OTA_Qspi_Flash"** sketch or in **line 88** on the **"OTA_SD_Portenta"** sketch. - -If you are going to use the example OTA file used in this tutorial you don't need to follow the steps in this section, just execute the sketch with the default file location. - - -***Now you have two options to choose, use QSPI or use an SD Card to storage your OTA file. You can use the left side index to jump to the option that you may need.*** - -### QSPI Storage Mode - -#### Setting Up -To use 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). With it, you will need to have selected 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. - -![Arduino Portenta H7 Board Connection](assets/portenta_h7_board_selection.png) - -#### Writing the Script -To proceed with a OTA using the QSPI flash, you can open the sketch from **Examples >Arduino_Portenta_OTA > OTA_Qspi_Flash**. - -***Do not forget to fill your Wi-Fi AP SSID and password on the `arduino_secrets.h` tab.*** - -This sketch will connect to your Wi-Fi, verify whether the OTA feature is available by checking the installed firmware on your Portenta. - -Then prepare the OTA storage, download the .ota file from the internet, decompress it, reset the board so after the reboot it will swipe the new firmware and you will notice it by checking the Built-in LED flashing on red, green and blue. - -### SD Card Storage Mode - -#### Setting Up -To use the **SD card** as the preferred OTA (Over-The-Air) storage device, you can use the Arduino Portenta Vision Shield and Portenta H7 connected via **HD (High-Density)** Connectors. - -![Arduino Portenta H7 with Vision Shield (Ethernet)](assets/portenta_h7_plus_vision_shield.svg) - -With this, you will need the Arduino Portenta H7 board connected to the computer with the Arduino IDE. You will need to have selected the **Arduino Portenta H7 (M7 Core)** with the Flash split of **1MB M7 + 1 MB M4** for the purpose of this tutorial and the corresponding port. - -#### Writing the Script -As same as QSPI storage mode, to proceed with a OTA using the SD Card, you can open the sketch from **Examples > Arduino_Portenta_OTA > OTA_SD_Portenta**. - -***Do not forget to fill your Wi-Fi AP SSID and password on the `arduino_secrets.h` tab.*** - -This sketch will connect to your Wi-Fi, verify whether the OTA feature is available by checking the installed firmware on your Portenta. - -Then prepare the OTA storage, download the .ota file from the internet, decompress it, reset the board so after the reboot it will swipe the new firmware and you will notice it by checking the Built-in LED flashing on red, green and blue. - -## Testing the Code -Having successfully uploaded the code and completed the OTA process, you will be able to see the Arduino Portenta H7 blinking LED Red, Blue, Green in a cyclic manner. You will also be able to see process log in the Serial Monitor provided by Arduino IDE for more details. - -![Arduino Portenta H7 OTA Completion with Cyclic RGB Blink](assets/portenta_h7_ota_blink_cycle.svg) - -![Arduino Portenta H7 OTA QSPI Serial Monitor Log](assets/portenta_ota_qspi_result.png) - -![Arduino Portenta H7 OTA SD Card Serial Monitor Log](assets/portenta_ota_sd_result.png) - -## Conclusion -You have now learned how to use the OTA feature provided by the Arduino Portenta H7, by updating its firmware. You will now be able to create the OTA file with the sketch designed by yourself and use this to update Arduino Portenta H7’s firmware via OTA (Over-The-Air) feature with either QSPI or SD card storage mechanism. - -### Next Steps -Now, with the OTA capability in place, you can design future-proof system based on Arduino Portenta H7 or try different system disciplines using the OTA capability. - -## Full Sketches -The complete script is as follows. - -### QSPI Storage Mode - -```cpp -#include -#include -#include "arduino_secrets.h" - -static char const SSID[] = SSID_NAME; /* your network SSID (name) */ -static char const PASS[] = SSID_PASS; /* your network password (use for WPA, or use as key for WEP) */ - -static char const OTA_FILE_LOCATION[] = "https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota"; - -void setup() -{ - Serial.begin(115200); - while (!Serial) {} - - if (WiFi.status() == WL_NO_SHIELD) - { - Serial.println("Communication with WiFi module failed!"); - return; - } - - int status = WL_IDLE_STATUS; - while (status != WL_CONNECTED) - { - Serial.print ("Attempting to connect to '"); - Serial.print (SSID); - Serial.println("'"); - status = WiFi.begin(SSID, PASS); - delay(10000); - } - Serial.print ("You're connected to '"); - Serial.print (WiFi.SSID()); - Serial.println("'"); - - Arduino_Portenta_OTA_QSPI ota(QSPI_FLASH_FATFS_MBR, 2); - Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None; - - if (!ota.isOtaCapable()) - { - Serial.println("Higher version bootloader required to perform OTA."); - Serial.println("Please update the bootloader."); - Serial.println("File -> Examples -> STM32H747_System -> STM32H747_updateBootloader"); - return; - } - - Serial.println("Initializing OTA storage"); - if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None) - { - Serial.print ("Arduino_Portenta_OTA::begin() failed with error code "); - Serial.println((int)ota_err); - return; - } - - Serial.println("Starting download to QSPI ..."); - int const ota_download = ota.download(OTA_FILE_LOCATION, false /* is_https */); - if (ota_download <= 0) - { - Serial.print ("Arduino_Portenta_OTA_QSPI::download failed with error code "); - Serial.println(ota_download); - return; - } - Serial.print (ota_download); - Serial.println(" bytes stored."); - - - Serial.println("Decompressing LZSS compressed file ..."); - int const ota_decompress = ota.decompress(); - if (ota_decompress < 0) - { - Serial.print("Arduino_Portenta_OTA_QSPI::decompress() failed with error code"); - Serial.println(ota_decompress); - return; - } - Serial.print(ota_decompress); - Serial.println(" bytes decompressed."); - - - Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory ..."); - if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None) - { - Serial.print ("ota.update() failed with error code "); - Serial.println((int)ota_err); - return; - } - - Serial.println("Performing a reset after which the bootloader will update the firmware."); - Serial.println("Hint: Portenta H7 LED will blink Red-Blue-Green."); - delay(1000); /* Make sure the serial message gets out before the reset. */ - ota.reset(); -} - -void loop() -{ -} -``` - -### SD Card Storage Mode - -```cpp -#include -#include -#include "arduino_secrets.h" - -static char const SSID[] = SSID_NAME; /* your network SSID (name) */ -static char const PASS[] = SSID_PASS; /* your network password (use for WPA, or use as key for WEP) */ - -static char const OTA_FILE_LOCATION[] = "https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota"; - -void setup() -{ - Serial.begin(115200); - while (!Serial) {} - - if (WiFi.status() == WL_NO_SHIELD) - { - Serial.println("Communication with WiFi module failed!"); - return; - } - - int status = WL_IDLE_STATUS; - while (status != WL_CONNECTED) - { - Serial.print ("Attempting to connect to '"); - Serial.print (SSID); - Serial.println("'"); - status = WiFi.begin(SSID, PASS); - delay(10000); - } - Serial.print ("You're connected to '"); - Serial.print (WiFi.SSID()); - Serial.println("'"); - - Arduino_Portenta_OTA_SD ota(SD_FATFS_MBR, 1); - Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None; - - if (!ota.isOtaCapable()) - { - Serial.println("Higher version bootloader required to perform OTA."); - Serial.println("Please update the bootloader."); - Serial.println("File -> Examples -> STM32H747_System -> STM32H747_updateBootloader "); - return; - } - - Serial.println("Initializing OTA storage"); - if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None) - { - Serial.print ("Arduino_Portenta_OTA::begin() failed with error code "); - Serial.println((int)ota_err); - return; - } - - - Serial.println("Starting download to SD ..."); - int const ota_download = ota.download(OTA_FILE_LOCATION, false /* is_https */); - if (ota_download <= 0) - { - Serial.print ("Arduino_Portenta_OTA_SD::download failed with error code "); - Serial.println(ota_download); - return; - } - Serial.print (ota_download); - Serial.println(" bytes stored."); - - - Serial.println("Decompressing LZSS compressed file ..."); - int const ota_decompress = ota.decompress(); - if (ota_decompress < 0) - { - Serial.print("Arduino_Portenta_OTA_SD::decompress() failed with error code"); - Serial.println(ota_decompress); - return; - } - Serial.print(ota_decompress); - Serial.println(" bytes decompressed."); - - - Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory"); - if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None) - { - Serial.print ("Arduino_Portenta_OTA::update() failed with error code "); - Serial.println((int)ota_err); - return; - } - - Serial.println("Performing a reset after which the bootloader will update the firmware."); - Serial.println("Hint: Portenta H7 LED will blink Red-Blue-Green."); - delay(1000); - ota.reset(); -} - -void loop() -{ -} -``` - -## Troubleshooting -For troubleshooting the issues that might have arose following the tutorial, you can use following tips to solve the issue. - -- If there has been an issue with Wi-Fi module, it means the device may have suffered from losing the Wi-Fi firmware partition. To solve this, you will have to use **PortentaWiFiFirmwareupdater** sketch found on Arduino IDE examples to fix the issue. -- QSPI storage may throw error -3 while running Portenta H7 OTA QSPI example. To fix this, you can use this guide of [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 and it should have been solved by eliminating error -3 (OTA Storage initialization error). +--- +title: 'Over-The-Air (OTA) Updates with the Arduino Portenta H7' +description: 'Learn how to perform an OTA update of the firmware on the Arduino Portenta H7' +difficulty: intermediate +tags: + - OTA + - Over-The-Air + - Wi-Fi + - Cloud +author: 'Taddy Chung, José Bagur' +libraries: + - name: Arduino IoT Cloud + url: https://www.arduino.cc/reference/en/libraries/arduinoiotcloud/ + - name: Arduino_Portenta_OTA + url: https://github.com/arduino-libraries/Arduino_Portenta_OTA +hardware: + - hardware/04.pro/boards/portenta-h7 + - hardware/04.pro/boards/portenta-h7-lite-connected +software: + - ide-v1 + - ide-v2 + - web-editor + - cli +--- + +## Overview +In this tutorial, you will learn how to use and allow firmware updates via **OTA (Over-The-Air)** feature with the **Arduino Portenta H7**. With this tutorial, you will be able to create a binary file to be used with the OTA feature and use the internal **QSPI** or a external **SD card** to accomplish the OTA (Over-The-Air) process. + +***To proceed with OTA using a SD Card, you will need to use a carrier or shield with a SD card slot, e.g Portenta Breakout, Portenta Max Carrier, Portenta Vision Shield.*** + +## Goals +The goals of this tutorial are: +- Create an OTA file required to use the OTA (Over-The-Air) feature. +- Use QSPI or SD card storage to load the firmware downloaded using the OTA feature. + +## Hardware and Software Needed +- [Arduino Portenta H7](https://store.arduino.cc/portenta-h7) +- Operative System: Linux or MacOS system, this procedure is not 100% compatible on Windows. +- Arduino IDE 1.8.10+ or Arduino Pro IDE 0.0.4+ +- USB-C® type cable (either USB-A to USB-C® or USB-C® to USB-C®) +- Arduino IoT Cloud and Arduino_Portenta_OTA libraries +- SD card (optional, you can use QSPI instead) +- Carrier or shield compatible with the Portenta H7 with a SD Card slot, in case you choose to use the SD Card. + +## What OTA Means +**OTA** (Over-The-Air) is a method of distributing wirelessly to end devices to update their firmware, configuration or security-related protocols. The purpose of this method is to change a device’s behavior or its settings for better performance, for adding new features or to change its targeted usage. + +## Instructions + +We will explain briefly the steps required to be able to use OTA (Over-The-Air) process with Arduino Portenta H7. It will consist of firmware OTA file creation and use of preferred storage mode (QSPI or SD card). + +### Firmware OTA File Creation +You will need to create the binary file required for the OTA (Over-The-Air) process to be able use it with either storage option stated previously. For the purpose of this tutorial, you will have to use the following script to create the binary file. + +```cpp +/* + This sketch can be used to generate an example binary that can be uploaded to Portenta via OTA. + It needs to be used together with + - 'OTA_Qspi_Flash.ino' if you want to use the Qspi Flash as storage system + OR + - 'SD_Qspi_Flash.ino' if you want to use the SD card as storage system + + Steps to test OTA on Portenta: + 1) Upload this sketch or any other sketch (this one lights up the RGB LED with different colours). + 2) In the IDE select: Sketch -> Export compiled Binary + 3) Upload the exported binary to a server + 4) Choose a storage mechanism (SD or QSPI), open the related OTA_*_Portenta.ino sketch, + eventually update the OTA_FILE_LOCATION + 5) Upload the sketch OTA_*_Portenta.ino to perform OTA via SD or QSPI Flash +*/ + +void setLed(int blue, int green, int red) { + digitalWrite(LEDB, blue); + digitalWrite(LEDG, green); + digitalWrite(LEDR, red); +} + + +void setup() +{ + pinMode(LEDB, OUTPUT); + pinMode(LEDG, OUTPUT); + pinMode(LEDR, OUTPUT); +} + +void loop() +{ //led BLUE ON + setLed(1, 0, 0); + delay(1000); + //led GREEN ON + setLed(0, 1, 0); + delay(1000); + //led RED ON + setLed(0, 0, 1); + delay(1000); +} +``` + +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 firsthand. This is to verify whether the sketch compiles and is working correctly. After verifying this, in Arduino IDE, you will search for **Sketch > Export Compiled Binary**. + +![Exporting Binary for the Sketch](assets/binary_export.png) + +With the binary file ready, you can now create the OTA file needed to enable Over-The-Air process. + +To continue, macOS or Linux environment is required. For Windows environment, it is possible to use virtualization software such as [Oracle VM Virtualbox](https://www.virtualbox.org/) using your preferred choice of compatible Linux distribution. If you're not familiar with Linux environments, [Ubuntu](https://ubuntu.com/) is one of many distributions that can help you explore Linux environment with ease of access. + +Once you're comfortable with an environment, you will need a tool which can be found at the following link. + +***[Arduino IoT Cloud Library - Over-The-Air Tools](https://github.com/arduino-libraries/ArduinoIoTCloud/tree/master/extras/tools)*** + +You will have to extract the library at a preferred location to be able to use the tools. Then, you will need to run on the terminal the following commands in sequence to be able to create the OTA file. + +Copy the binary file into the library tool's folder + +```cpp +// Exported binary format reference: sketch.bin +cp OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin ~/Arduino/libraries/ArduinoIoTCloud/extras/tools/ +``` + +Go inside that directory + +```cpp +cd ~/Arduino/libraries/ArduinoIoTCloud/extras/tools +``` + +Encode your binary file into `OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss` + +```cpp +// Argument format: ./lzss.py --encode sketch.bin sketch.lzss +./lzss.py --encode OTA_Usage_Portenta.ino.PORTENTA_H7_M7.bin OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss +``` + +Convert your encoded file into `.ota` format + +```cpp +// Argument format: ./bin2ota.py PORTENTA_H7_M7 sketch.lzss sketch.ota +./bin2ota.py PORTENTA_H7_M7 OTA_Usage_Portenta.ino.PORTENTA_H7_M7.lzss OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota +``` + +You can use `OTA_Usage_Portenta.ino.PORTENTA_H7_M7` as a sketch name for facilitated identification of the file. After this, you will have the `.ota` file of the sketch that you will use with the OTA process. + +### Installing Python 3 On Linux + +If you are using Linux, maybe you cannot run the **bin2ota.py** script. This may be because you need to install [Python 3](https://www.python.org/) and the necessary modules. To do it execute the next command on your **Linux terminal**: + +```cpp +sudo apt install python-is-python3 +`````` + +You will also need to install the **crccheck** module on python by following the next instructions: + +Installing pip on python: +```cpp +//Necessary to install python modules: +sudo apt install python3-pip +``` +Installing the crccheck necessary module on python: + +```cpp +//Necessary to run the script: +pip install crccheck +``` +Once you have done it, you should be able to run the bin2ota.py script successfully. + +### Uploading OTA file to the net ### + +Now you can upload your .OTA file to an online reachable location, e.g. *OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota* has been uploaded to: + +https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota + +You can change the default file location on the code by modifying the next line on the ***"OTA_Qspi_Flash"** sketch or in the **"OTA_SD_Portenta"** sketch depending on which method are you going to follow: + +```cpp +static char const OTA_FILE_LOCATION[] = "Introduce here your online OTA file location"; +``` +It is important to know that if your OTA file is uploaded to an HTTPS website you will need to modify the next line in the code: + +```cpp + int const ota_download = ota.download(OTA_FILE_LOCATION, true /* is_https */); +``` +This line is in **line 87** for the **"OTA_Qspi_Flash"** sketch or in **line 88** on the **"OTA_SD_Portenta"** sketch. + +If you are going to use the example OTA file used in this tutorial you don't need to follow the steps in this section, just execute the sketch with the default file location. + + +***Now you have two options to choose, use QSPI or use an SD Card to storage your OTA file. You can use the left side index to jump to the option that you may need.*** + +### QSPI Storage Mode + +#### Setting Up +To use 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). With it, you will need to have selected 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. + +![Arduino Portenta H7 Board Connection](assets/portenta_h7_board_selection.png) + +#### Writing the Script +To proceed with a OTA using the QSPI flash, you can open the sketch from **Examples >Arduino_Portenta_OTA > OTA_Qspi_Flash**. + +***Do not forget to fill your Wi-Fi AP SSID and password on the `arduino_secrets.h` tab.*** + +This sketch will connect to your Wi-Fi, verify whether the OTA feature is available by checking the installed firmware on your Portenta. + +Then prepare the OTA storage, download the .ota file from the internet, decompress it, reset the board so after the reboot it will swipe the new firmware and you will notice it by checking the Built-in LED flashing on red, green and blue. + +### SD Card Storage Mode + +#### Setting Up +To use the **SD card** as the preferred OTA (Over-The-Air) storage device, you can use the Arduino Portenta Vision Shield and Portenta H7 connected via **HD (High-Density)** Connectors. + +![Arduino Portenta H7 with Portenta Vision Shield - Ethernet](assets/portenta_h7_plus_vision_shield.svg) + +With this, you will need the Arduino Portenta H7 board connected to the computer with the Arduino IDE. You will need to have selected the **Arduino Portenta H7 (M7 Core)** with the Flash split of **1MB M7 + 1 MB M4** for the purpose of this tutorial and the corresponding port. + +#### Writing the Script +As same as QSPI storage mode, to proceed with a OTA using the SD Card, you can open the sketch from **Examples > Arduino_Portenta_OTA > OTA_SD_Portenta**. + +***Do not forget to fill your Wi-Fi AP SSID and password on the `arduino_secrets.h` tab.*** + +This sketch will connect to your Wi-Fi, verify whether the OTA feature is available by checking the installed firmware on your Portenta. + +Then prepare the OTA storage, download the .ota file from the internet, decompress it, reset the board so after the reboot it will swipe the new firmware and you will notice it by checking the Built-in LED flashing on red, green and blue. + +## Testing the Code +Having successfully uploaded the code and completed the OTA process, you will be able to see the Arduino Portenta H7 blinking LED Red, Blue, Green in a cyclic manner. You will also be able to see process log in the Serial Monitor provided by Arduino IDE for more details. + +![Arduino Portenta H7 OTA Completion with Cyclic RGB Blink](assets/portenta_h7_ota_blink_cycle.svg) + +![Arduino Portenta H7 OTA QSPI Serial Monitor Log](assets/portenta_ota_qspi_result.png) + +![Arduino Portenta H7 OTA SD Card Serial Monitor Log](assets/portenta_ota_sd_result.png) + +## Conclusion +You have now learned how to use the OTA feature provided by the Arduino Portenta H7, by updating its firmware. You will now be able to create the OTA file with the sketch designed by yourself and use this to update Arduino Portenta H7’s firmware via OTA (Over-The-Air) feature with either QSPI or SD card storage mechanism. + +### Next Steps +Now, with the OTA capability in place, you can design future-proof system based on Arduino Portenta H7 or try different system disciplines using the OTA capability. + +## Full Sketches +The complete script is as follows. + +### QSPI Storage Mode + +```cpp +#include +#include +#include "arduino_secrets.h" + +static char const SSID[] = SSID_NAME; /* your network SSID (name) */ +static char const PASS[] = SSID_PASS; /* your network password (use for WPA, or use as key for WEP) */ + +static char const OTA_FILE_LOCATION[] = "https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota"; + +void setup() +{ + Serial.begin(115200); + while (!Serial) {} + + if (WiFi.status() == WL_NO_SHIELD) + { + Serial.println("Communication with WiFi module failed!"); + return; + } + + int status = WL_IDLE_STATUS; + while (status != WL_CONNECTED) + { + Serial.print ("Attempting to connect to '"); + Serial.print (SSID); + Serial.println("'"); + status = WiFi.begin(SSID, PASS); + delay(10000); + } + Serial.print ("You're connected to '"); + Serial.print (WiFi.SSID()); + Serial.println("'"); + + Arduino_Portenta_OTA_QSPI ota(QSPI_FLASH_FATFS_MBR, 2); + Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None; + + if (!ota.isOtaCapable()) + { + Serial.println("Higher version bootloader required to perform OTA."); + Serial.println("Please update the bootloader."); + Serial.println("File -> Examples -> STM32H747_System -> STM32H747_updateBootloader"); + return; + } + + Serial.println("Initializing OTA storage"); + if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None) + { + Serial.print ("Arduino_Portenta_OTA::begin() failed with error code "); + Serial.println((int)ota_err); + return; + } + + Serial.println("Starting download to QSPI ..."); + int const ota_download = ota.download(OTA_FILE_LOCATION, false /* is_https */); + if (ota_download <= 0) + { + Serial.print ("Arduino_Portenta_OTA_QSPI::download failed with error code "); + Serial.println(ota_download); + return; + } + Serial.print (ota_download); + Serial.println(" bytes stored."); + + + Serial.println("Decompressing LZSS compressed file ..."); + int const ota_decompress = ota.decompress(); + if (ota_decompress < 0) + { + Serial.print("Arduino_Portenta_OTA_QSPI::decompress() failed with error code"); + Serial.println(ota_decompress); + return; + } + Serial.print(ota_decompress); + Serial.println(" bytes decompressed."); + + + Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory ..."); + if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None) + { + Serial.print ("ota.update() failed with error code "); + Serial.println((int)ota_err); + return; + } + + Serial.println("Performing a reset after which the bootloader will update the firmware."); + Serial.println("Hint: Portenta H7 LED will blink Red-Blue-Green."); + delay(1000); /* Make sure the serial message gets out before the reset. */ + ota.reset(); +} + +void loop() +{ +} +``` + +### SD Card Storage Mode + +```cpp +#include +#include +#include "arduino_secrets.h" + +static char const SSID[] = SSID_NAME; /* your network SSID (name) */ +static char const PASS[] = SSID_PASS; /* your network password (use for WPA, or use as key for WEP) */ + +static char const OTA_FILE_LOCATION[] = "https://downloads.arduino.cc/ota/OTA_Usage_Portenta.ino.PORTENTA_H7_M7.ota"; + +void setup() +{ + Serial.begin(115200); + while (!Serial) {} + + if (WiFi.status() == WL_NO_SHIELD) + { + Serial.println("Communication with WiFi module failed!"); + return; + } + + int status = WL_IDLE_STATUS; + while (status != WL_CONNECTED) + { + Serial.print ("Attempting to connect to '"); + Serial.print (SSID); + Serial.println("'"); + status = WiFi.begin(SSID, PASS); + delay(10000); + } + Serial.print ("You're connected to '"); + Serial.print (WiFi.SSID()); + Serial.println("'"); + + Arduino_Portenta_OTA_SD ota(SD_FATFS_MBR, 1); + Arduino_Portenta_OTA::Error ota_err = Arduino_Portenta_OTA::Error::None; + + if (!ota.isOtaCapable()) + { + Serial.println("Higher version bootloader required to perform OTA."); + Serial.println("Please update the bootloader."); + Serial.println("File -> Examples -> STM32H747_System -> STM32H747_updateBootloader "); + return; + } + + Serial.println("Initializing OTA storage"); + if ((ota_err = ota.begin()) != Arduino_Portenta_OTA::Error::None) + { + Serial.print ("Arduino_Portenta_OTA::begin() failed with error code "); + Serial.println((int)ota_err); + return; + } + + + Serial.println("Starting download to SD ..."); + int const ota_download = ota.download(OTA_FILE_LOCATION, false /* is_https */); + if (ota_download <= 0) + { + Serial.print ("Arduino_Portenta_OTA_SD::download failed with error code "); + Serial.println(ota_download); + return; + } + Serial.print (ota_download); + Serial.println(" bytes stored."); + + + Serial.println("Decompressing LZSS compressed file ..."); + int const ota_decompress = ota.decompress(); + if (ota_decompress < 0) + { + Serial.print("Arduino_Portenta_OTA_SD::decompress() failed with error code"); + Serial.println(ota_decompress); + return; + } + Serial.print(ota_decompress); + Serial.println(" bytes decompressed."); + + + Serial.println("Storing parameters for firmware update in bootloader accessible non-volatile memory"); + if ((ota_err = ota.update()) != Arduino_Portenta_OTA::Error::None) + { + Serial.print ("Arduino_Portenta_OTA::update() failed with error code "); + Serial.println((int)ota_err); + return; + } + + Serial.println("Performing a reset after which the bootloader will update the firmware."); + Serial.println("Hint: Portenta H7 LED will blink Red-Blue-Green."); + delay(1000); + ota.reset(); +} + +void loop() +{ +} +``` + +## Troubleshooting +For troubleshooting the issues that might have arose following the tutorial, you can use following tips to solve the issue. + +- If there has been an issue with Wi-Fi module, it means the device may have suffered from losing the Wi-Fi firmware partition. To solve this, you will have to use **PortentaWiFiFirmwareupdater** sketch found on Arduino IDE examples to fix the issue. +- QSPI storage may throw error -3 while running Portenta H7 OTA QSPI example. To fix this, you can use this guide of [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 and it should have been solved by eliminating error -3 (OTA Storage initialization error). diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/secure-boot/secure-boot.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/secure-boot/secure-boot.md index 30fc3b0ddb..005f646a79 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/secure-boot/secure-boot.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/secure-boot/secure-boot.md @@ -1,6 +1,7 @@ --- title: 'Secure Boot on Portenta H7' description: 'Learn how to use secure boot on the Arduino Portenta H7.' +difficulty: beginner tags: - Secure Boot author: 'Umberto Baldi' diff --git a/content/hardware/04.pro/boards/portenta-h7/tutorials/setting-up-portenta/content.md b/content/hardware/04.pro/boards/portenta-h7/tutorials/setting-up-portenta/content.md index 77b657e371..d38a9d5e61 100644 --- a/content/hardware/04.pro/boards/portenta-h7/tutorials/setting-up-portenta/content.md +++ b/content/hardware/04.pro/boards/portenta-h7/tutorials/setting-up-portenta/content.md @@ -51,7 +51,7 @@ The Arduino core for the Portenta H7 sits on top of the Mbed OS and allows to de ### Configuring the Development Environment In this section, we will guide you through a step-by-step process of setting up your Portenta board for running an Arduino Sketch that blinks the built-in RGB LED. -***IMPORTANT: Please make sure to update the bootloader to the most recent version to benefit from the latest improvements. Follow [these steps](updating-the-bootloader) before you proceed with the next step of this tutorial.*** +***IMPORTANT: Please make sure to update the bootloader to the most recent version to benefit from the latest improvements. Follow [these steps](https://docs.arduino.cc/tutorials/portenta-h7/updating-the-bootloader/) before you proceed with the next step of this tutorial.*** ### 1. The Basic Setup Let's begin by Plug-in your Portenta to your computer using the appropriate USB-C® cable. Next, open your IDE and make sure that you have the right version of the Arduino IDE downloaded on to your computer. @@ -92,12 +92,12 @@ void loop() { For Portenta H7 LED_BUILTIN represents the built-in RGB LED on the board in green color. -**Note:** The individual colors of the built-in RGB LED can be accessed and controlled separately. In the tutorial [Dual core processing](dual-core-processing) you will learn how to control the LED to light it in different colors +**Note:** The individual colors of the built-in RGB LED can be accessed and controlled separately. In the tutorial [Dual core processing](https://docs.arduino.cc/tutorials/portenta-h7/dual-core-processing/) you will learn how to control the LED to light it in different colors ### 4. Upload the Blink Sketch Now it's time to upload the sketch and see if the LED will start to blink. Make sure you select Arduino Portenta H7 (M7 core) as the board and the port to which the Portenta H7 is connected. If the Portenta H7 doesn't show up in the list of ports, go back to step 1 and make sure that the drivers are installed correctly. Once selected click Upload. Once uploaded the built-in LED should start blinking with an interval of 1 second. -**Note:** The Portenta H7 has an M7 and an M4 processor which run separate cores. That's why you need to select the one to which you want to upload your sketch to (check out the tutorial [Dual core processing](dual-core-processing) to learn more about Portenta's processors). +**Note:** The Portenta H7 has an M7 and an M4 processor which run separate cores. That's why you need to select the one to which you want to upload your sketch to (check out the tutorial [Dual core processing](https://docs.arduino.cc/tutorials/portenta-h7/dual-core-processing/) to learn more about Portenta's processors). ![Select the Arduino Portenta H7 (M7 core) in the board selector.](assets/por_ard_gs_upload_sketch.png) @@ -107,7 +107,7 @@ Now it's time to upload the sketch and see if the LED will start to blink. Make You have now configured your Portenta board to run Arduino sketches. Along with that you gained an understanding of how the Arduino Core runs on top of Mbed OS. ### Next Steps -- Proceed with the next tutorial [Dual core processing](dual-core-processing) to learn how to make use of Portenta H7's two processors to do two separate tasks simultaneously. +- Proceed with the next tutorial [Dual core processing](https://docs.arduino.cc/tutorials/portenta-h7/dual-core-processing/) to learn how to make use of Portenta H7's two processors to do two separate tasks simultaneously. - Read more about why we chose Mbed as as the foundation [here](https://blog.arduino.cc/2019/07/31/why-we-chose-to-build-the-arduino-nano-33-ble-core-on-mbed-os/). ## Troubleshooting diff --git a/content/hardware/04.pro/boards/portenta-x8/essentials.md b/content/hardware/04.pro/boards/portenta-x8/essentials.md index fad4dbd5db..022940bf76 100644 --- a/content/hardware/04.pro/boards/portenta-x8/essentials.md +++ b/content/hardware/04.pro/boards/portenta-x8/essentials.md @@ -26,7 +26,7 @@ Download the latest firmware for Portenta X8 (Recommended). - + All available Portenta X8 firmware release notes. diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/04.python-arduino-data-exchange/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/04.python-arduino-data-exchange/content.md index 5088a916c8..3d3f6ca366 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/04.python-arduino-data-exchange/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/04.python-arduino-data-exchange/content.md @@ -1,6 +1,7 @@ --- title: '04. Data Exchange Between Python® on Linux & Arduino Sketch' description: 'This tutorial will show you how to run a Python® application that exchanges data with an Arduino Sketch.' +difficulty: intermediate tags: - RPC - Python® @@ -112,7 +113,7 @@ python-sensor-rpc_1 | Altitude: 311.0769348144531 Whenever you change anything in the Python® script on your computer, you will have to sync it back to the X8 and re-build the container. Following command sequence will help you to do this process: -``` +```bash # On your computer adb push python-sensor-rpc /home/fio diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/08.image-building/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/08.image-building/content.md index c486284991..dd9f98b320 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/08.image-building/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/08.image-building/content.md @@ -232,7 +232,7 @@ In this tutorial, you have learned how to build a "builder" Docker image, get it ## Next Steps -Please follow the [Flashing tutorial](image-flashing) to flash your device with your custom image. You can use the files provided from this build to flash the Portenta X8 following the tutorial's steps. +Please follow the [Flashing tutorial](https://docs.arduino.cc/tutorials/portenta-x8/image-flashing/) to flash your device with your custom image. You can use the files provided from this build to flash the Portenta X8 following the tutorial's steps. ## Troubleshooting diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/12.multi-protocol-gateway/content.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/12.multi-protocol-gateway/content.md index 20e6469afe..923cd849e9 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/12.multi-protocol-gateway/content.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/12.multi-protocol-gateway/content.md @@ -1,6 +1,7 @@ --- title: '12. Multi-Protocol Gateway With Portenta X8 & Max Carrier' description: 'This tutorial shows how to setup a multi-protocol gateway environment on Portenta X8 using Max Carrier' +difficulty: intermediate tags: - Containers - Docker @@ -111,7 +112,7 @@ Before you begin diving deep into creating a Multi-protocol gateway, and having The `m4-proxy` is a service that manages data exchange between these layers. You can use the following command in the terminal to observe if the service is running correctly. -``` +```bash sudo journalctl -fu m4-proxy ``` @@ -119,7 +120,7 @@ Now you will implement RPC (Remote Procedure Call) to establish communication be **You will not be able to check messages via `Serial.println()` statements** to check if the Arduino sketch is running in the desired manner. You will have to use instead **`py-serialrpc`**, which is a service that will assist you in listening to those messages, and printing them on a console on the Linux layer. To have the service active, please download [this compressed file](assets/py-serialrpc.zip) to build and run the container on the Linux side of Portenta X8. Please execute the following commands to have the service running. -``` +```bash // Copy the decompressed files in ../adb/32.0.0 adb push py-serialrpc /home/fio adb shell @@ -134,7 +135,7 @@ cd /home/fio/py-serialrpc To access the logs of `py-serialrpc` service, while maintaining the same directory, execute the following command. -``` +```bash sudo docker-compose logs -f --tail 20 ``` @@ -142,7 +143,7 @@ sudo docker-compose logs -f --tail 20 If you have not configured internal Wi-Fi® connectivity within the system, please use the following command line: -``` +```bash nmcli device wifi connect "SSID" password "PASSWORD" ``` @@ -495,22 +496,22 @@ It is now time to make the multi-protocol gateway run and for this, you will nee You will need to have the files ready in a folder inside the `adb` directory within Arduino root. -``` +```bash C:\Users\#USERNAME#\AppData\Local\Arduino15\packages\arduino\tools\adb\32.0.0 ``` Having the files ready in that directory, you can use the following commands to push the files to the `fio` directory inside the Portenta X8. The second command will let you navigate inside the Portenta X8. -``` +```bash adb push multi-protocol-gateway /home/fio adb shell ``` You will now build the container using the following commands. The following command will tag the container with `Multi_Protocol_Gateway_X8` as its name. -``` +```bash cd ../home/fio/Multi_Protocol_Gateway_X8 -#Multi_Protocol_Gateway_X8 sudo docker build . -t multi_gateway +Multi_Protocol_Gateway_X8 sudo docker build . -t multi_gateway ``` You will be able to see the following results when the image is built successfully. @@ -521,19 +522,19 @@ You will be able to see the following results when the image is built successful After a successful container build, you will run the image. To do that, you can use the following command. This command will immediately give an output in your terminal, telling you how the Python® script is running. If you wish to have it running in the background, please add the `-d` flag at the end of the command. -``` -#Multi_Protocol_Gateway_X8 sudo docker-compose up +```bash +Multi_Protocol_Gateway_X8 sudo docker-compose up ``` Finally, you will have the multi-protocol gateway running, which uses Wi-Fi® and LoRa® connectivity. Also, RPC for exchanging data between its layers. However, there are cases where you would wish to make changes by adding more functionalities, such as including Cat. M1 or NB-IoT to expand its communication spectrum. For this, you will need to stop the image. To stop the image from running, you can use the following command. -``` -#Multi_Protocol_Gateway_X8 sudo docker-compose down +```bash +Multi_Protocol_Gateway_X8 sudo docker-compose down ``` Getting to know the status of the image is also crucial as it is the indicator of the state of operation. The following command brings up **active** containers and shows the status if the container restarted or stopped due to certain reasons. The second command lists built images and it will show you the components that go with the main image that you're building. -``` +```bash docker ps -a docker images ``` diff --git a/content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md b/content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md index 948e0ac610..3e5f438d4c 100644 --- a/content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md +++ b/content/hardware/04.pro/carriers/portenta-hat-carrier/tutorials/user-manual/content.md @@ -554,9 +554,9 @@ This sub-section introduces the essential hardware connection points and interfa The Portenta X8, H7, and C33 enhance functionality through High-Density connectors. For a comprehensive understanding of these connectors, please refer to the complete pinout documentation for each Portenta model. -- [Complete Portenta X8 pinout information](https://docs.arduino.cc/static/019dd9ac3b08f48192dcb1291d37aab9/ABX00049-full-pinout.pdf) -- [Complete Portenta H7 pinout information](https://docs.arduino.cc/static/2d38006e78d2abc588a80f12bb9c0c70/ABX00042-full-pinout.pdf) -- [Complete Portenta C33 pinout information](https://docs.arduino.cc/static/903c16295f3bf076c2ed23eb1b38791c/ABX00074-full-pinout.pdf) +- [Complete Portenta X8 pinout information](https://docs.arduino.cc/resources/pinouts/ABX00049-full-pinout.pdf) +- [Complete Portenta H7 pinout information](https://docs.arduino.cc/resources/pinouts/ABX00042-full-pinout.pdf) +- [Complete Portenta C33 pinout information](https://docs.arduino.cc/resources/pinouts/ABX00074-full-pinout.pdf) ### USB Interface diff --git a/content/hardware/04.pro/carriers/portenta-max-carrier/essentials.md b/content/hardware/04.pro/carriers/portenta-max-carrier/essentials.md index 207fa80be4..149dc3d775 100644 --- a/content/hardware/04.pro/carriers/portenta-max-carrier/essentials.md +++ b/content/hardware/04.pro/carriers/portenta-max-carrier/essentials.md @@ -14,7 +14,7 @@ The complete Arduino sketches from the Pro tutorials. - + Read files and/or output sound. diff --git a/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md b/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md index 38795e7bd6..5f7d43cae3 100644 --- a/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md +++ b/content/hardware/04.pro/shields/portenta-cat-m1-nb-iot-gnss-shield/tutorials/cheat-sheet/cheat-sheet.md @@ -1,6 +1,7 @@ --- title: 'Arduino® Portenta Cat. M1/NB IoT GNSS Shield Cheat Sheet' description: 'Learn how to set up the Portenta Cat. M1/NB IoT GNSS Shield and get a quick overview of its functionality. Obtain information regarding pins and how to use the different communication technologies.' +difficulty: beginner tags: - Installation - Cat. M1 diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/essentials.md b/content/hardware/04.pro/shields/portenta-vision-shield/essentials.md index 2e0a8dd9c4..1877ca206e 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/essentials.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/essentials.md @@ -6,7 +6,7 @@ - + A library for sending and receiving data using LoRa® radios. diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tech-specs.yml b/content/hardware/04.pro/shields/portenta-vision-shield/tech-specs.yml index 1b80ad8cb0..fed85d2cda 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tech-specs.yml +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tech-specs.yml @@ -1,9 +1,9 @@ Shield: Name: Arduino® Portenta Vision Shield SKU (Ethernet): ASX00021 - SKU (LoRa): ASX00026 + SKU (LoRa®): ASX00026 Connectivity: - LoRa: 868/915MHz ABZ-093 LoRa® Module with ARM Cortex-M0+ + LoRa®: 868/915MHz ABZ-093 LoRa® Module with ARM Cortex-M0+ Sensors: Microphone: MP34DT05 Camera: Himax HM-01B0 camera module diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/speech-recognition-engine/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/speech-recognition-engine/content.md index 65bcad4f8e..2c503e7d00 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/speech-recognition-engine/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/speech-recognition-engine/content.md @@ -56,7 +56,7 @@ In case you are interested in unlocking the full potential of the tool, the tuto To use the Arduino Speech Recognition Engine, you will need one of the following boards: -- [Arduino Portenta H7 (any variant)](https://store.arduino.cc/portenta-h7) + Portenta Vision Shield ([LoRa](https://store.arduino.cc/portenta-vision-shield-lora) or [Ethernet](https://store.arduino.cc/portenta-vision-shield)) +- [Arduino Portenta H7 (any variant)](https://store.arduino.cc/portenta-h7) + Portenta Vision Shield ([LoRa](https://store.arduino.cc/products/arduino-portenta-vision-shield-lora%C2%AE) or [Ethernet](https://store.arduino.cc/products/arduino-portenta-vision-shield-ethernet)) - [Arduino Nano 33 BLE Sense Rev 1](https://store.arduino.cc/products/arduino-nano-33-ble-sense) - [Arduino Nano 33 BLE Sense Rev 2](https://store.arduino.cc/products/nano-33-ble-sense-rev2) - [Arduino Nano RP2040](https://store.arduino.cc/products/arduino-nano-rp2040-connect) @@ -91,7 +91,7 @@ There are three libraries, you will need to install one or another depending on Go to the Library Manager, search for the library that you need for your board and install it. -In case you need more instructions about how to install libraries, visit: https://docs.arduino.cc/hacking/software/Libraries +In case you need more instructions about how to install libraries, read this [guide](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library/). #### Get The Serial Number