diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index ee6645a559..def4df47f6 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -26,7 +26,6 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - run: git log -1 --pretty=format:%aI content/learn/04.electronics/05.servo-motors/servo-motors.md - uses: actions/setup-node@v4 with: node-version: 18 diff --git a/content/_dev-test/product.md b/content/_dev-test/product.md new file mode 100644 index 0000000000..1be2b74ad2 --- /dev/null +++ b/content/_dev-test/product.md @@ -0,0 +1,13 @@ +--- +title: Test +url_shop: /test/ +url_guide: /test/ +primary_button_url: /test/ +primary_button_title: Test +secondary_button_url: /test/ +secondary_button_title: Test +core: "" +certifications: [] +sku: [] +essentials_title: "test" +--- \ No newline at end of file diff --git a/content/arduino-cloud/08.arduino-cloud-cli/07.getting-started/arduino-cloud-cli.md b/content/arduino-cloud/08.arduino-cloud-cli/07.getting-started/arduino-cloud-cli.md index afb9e31b12..00fbc67301 100644 --- a/content/arduino-cloud/08.arduino-cloud-cli/07.getting-started/arduino-cloud-cli.md +++ b/content/arduino-cloud/08.arduino-cloud-cli/07.getting-started/arduino-cloud-cli.md @@ -128,7 +128,7 @@ Here's follows the FQBN's list of the supported devices: ### LoRaWAN® Devices -To configure LoRaWAN® devices, use the additional `create-lora` and the `--frequency-plan` flag. This +To configure LoRaWAN® devices, use the additional `create-lora` and the `--frequency-plan` flag. This ``` arduino-cloud-cli device create-lora --name --frequency-plan --port --fqbn diff --git a/content/hardware/04.pro/boards/portenta-x8/tutorials/14.x8-firmware-release-notes/x8-firmware-release-notes.md b/content/hardware/04.pro/boards/portenta-x8/tutorials/14.x8-firmware-release-notes/x8-firmware-release-notes.md index 9f7dc5212a..760151fabf 100644 --- a/content/hardware/04.pro/boards/portenta-x8/tutorials/14.x8-firmware-release-notes/x8-firmware-release-notes.md +++ b/content/hardware/04.pro/boards/portenta-x8/tutorials/14.x8-firmware-release-notes/x8-firmware-release-notes.md @@ -29,9 +29,7 @@ Compatible carriers with the supported device: The following section highlights the critical updates and enhancements introduced in the latest firmware version. It presents the most significant progress and optimizations implemented to improve performance, enhance user experience, and strengthen security. -## Latest Firmware Version: __861 (Release arduino-91.2)__ - -**Release Date: June 26, 2024** +## Latest Firmware Version: __2024.06 (Release arduino-91.2, OS Image 861)__ The listing herein offers a glimpse into the Portenta X8 firmware's continuous improvement and enhancement. You can expect a concise overview of the integrated key new features, major bug fixes, and critical security patches to ensure the highest level of functionality and performance within the Portenta X8 system. @@ -59,11 +57,10 @@ The listing herein offers a glimpse into the Portenta X8 firmware's continuous i Below is a list of all available firmware versions with their release notes. - -### OS Image 846 - May 15, 2024 +### OS Image 846
- OS Image 846: Release arduino-91.1 + 2024.05 (Release arduino-91.1, OS Image 846) #### Image Access - Full image [download](https://downloads.arduino.cc/portentax8image/846.tar.gz) @@ -77,10 +74,10 @@ Below is a list of all available firmware versions with their release notes.


-### OS Image 844 - May 10, 2024 +### OS Image 844
- OS Image 844: Release arduino-91 + 2024.05 (Release arduino-91, OS Image 844) #### Image Access - Full image [download](https://downloads.arduino.cc/portentax8image/844.tar.gz) @@ -108,10 +105,10 @@ Below is a list of all available firmware versions with their release notes.


-### OS Image 822 - April 8, 2024 +### OS Image 822
- OS Image 822: Release arduino-88.94 + 2024.04 (Release arduino-88.94, OS Image 822) #### Image Access - Full image [download](https://downloads.arduino.cc/portentax8image/822.tar.gz) @@ -138,10 +135,10 @@ Below is a list of all available firmware versions with their release notes.


-### OS Image 746 - October 25, 2023 +### OS Image 746
- OS Image 746: Release arduino-88.91 + 2023.10 (Release arduino-88.91, OS Image 746) #### Image Access - Full image [download](https://downloads.arduino.cc/portentax8image/746.tar.gz) @@ -166,9 +163,10 @@ Below is a list of all available firmware versions with their release notes.


-### OS Image 719 - September 27, 2023 +### OS Image 719 +
- OS Image 719: Release arduino-88.7 + 2023.09 (Release arduino-88.7, OS Image 719) #### Image Access - Full image [download](https://downloads.arduino.cc/portentax8image/719.tar.gz) diff --git a/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/memory-partitioning b/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/memory-partitioning new file mode 120000 index 0000000000..5770862ebe --- /dev/null +++ b/content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/memory-partitioning @@ -0,0 +1 @@ +../../../../07.opta/opta-family/opta/tutorials/08.memory-partitioning \ No newline at end of file diff --git a/content/hardware/07.opta/opta-family/opta-analog-exp/datasheet/assets/Opta_Analog_EXP_Block_Diagram.svg b/content/hardware/07.opta/opta-family/opta-analog-exp/datasheet/assets/Opta_Analog_EXP_Block_Diagram.svg new file mode 100644 index 0000000000..b4217f2a11 --- /dev/null +++ b/content/hardware/07.opta/opta-family/opta-analog-exp/datasheet/assets/Opta_Analog_EXP_Block_Diagram.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/content/hardware/07.opta/opta-family/opta-analog-exp/datasheet/assets/Opta_Digital_EXP_Block_Diagram.svg b/content/hardware/07.opta/opta-family/opta-analog-exp/datasheet/assets/Opta_Digital_EXP_Block_Diagram.svg deleted file mode 100644 index b010539f45..0000000000 --- a/content/hardware/07.opta/opta-family/opta-analog-exp/datasheet/assets/Opta_Digital_EXP_Block_Diagram.svg +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/content/hardware/07.opta/opta-family/opta-analog-exp/datasheet/datasheet.md b/content/hardware/07.opta/opta-family/opta-analog-exp/datasheet/datasheet.md index 3436b5815f..c1cd6c0bfc 100644 --- a/content/hardware/07.opta/opta-family/opta-analog-exp/datasheet/datasheet.md +++ b/content/hardware/07.opta/opta-family/opta-analog-exp/datasheet/datasheet.md @@ -214,7 +214,7 @@ The Analog Expansion features eight user-programmable LEDs ideal for status repo The following diagram explains the relation between the main components of the Opta® Analog Expansion: -![Block diagram](assets/Opta_Digital_EXP_Block_Diagram.svg) +![Block diagram](assets/Opta_Analog_EXP_Block_Diagram.svg) ### Input/Output Channels @@ -334,6 +334,8 @@ This device complies with part 15 of the FCC Rules. Operation is subject to the ## Revision History -| Date | **Revision** | **Changes** | -| ---------- | ------------ | ------------- | -| 25/07/2024 | 1 | First Release | +| **Date** | **Revision** | **Changes** | +| :--------: | :----------: | :-------------------: | +| 05/07/2024 | 2 | Block Diagram updated | +| 25/07/2024 | 1 | First Release | + diff --git a/content/hardware/07.opta/opta-family/opta/downloads/opta-full-pinout.pdf b/content/hardware/07.opta/opta-family/opta/downloads/AFX00001-AFX00002-AFX00003-full-pinout.pdf similarity index 100% rename from content/hardware/07.opta/opta-family/opta/downloads/opta-full-pinout.pdf rename to content/hardware/07.opta/opta-family/opta/downloads/AFX00001-AFX00002-AFX00003-full-pinout.pdf diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-1.png b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-1.png index cf722ec2d0..54fa42e261 100644 Binary files a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-1.png and b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-1.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-2.png b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-2.png index 9f5bf69cc4..f7d0ea6205 100644 Binary files a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-2.png and b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-2.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-3.png b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-3.png index 2909aa9ef8..6028937e6a 100644 Binary files a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-3.png and b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-3.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-4.png b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-4.png new file mode 100644 index 0000000000..7df01553ce Binary files /dev/null and b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/arduino-ide-4.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/memory-partitioning-introduction.png b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/memory-partitioning-introduction.png index 3e63e6c34b..5d42e75525 100644 Binary files a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/memory-partitioning-introduction.png and b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/memory-partitioning-introduction.png differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/opta_memory_partitioning.zip b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/memory_partitioning.zip similarity index 98% rename from content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/opta_memory_partitioning.zip rename to content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/memory_partitioning.zip index cd2c5bdef5..8bec42a82e 100644 Binary files a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/opta_memory_partitioning.zip and b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/assets/memory_partitioning.zip differ diff --git a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/content.md b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/content.md index d3e7c83498..4db51475e7 100644 --- a/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/content.md +++ b/content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/content.md @@ -1,10 +1,10 @@ --- -title: 'Opta™ Memory Partitioning for Use with the Arduino IDE' -description: "Learn how to partition the memory of an Opta™ device to be used with the Arduino® ecosystem tools." - +title: 'Memory Partitioning for Use with the Arduino IDE' +description: "Learn how to partition the memory of an Opta™ or a Portenta Machine Control to be used with the Arduino® ecosystem tools." difficulty: beginner tags: - Opta + - PMC - Memory partitioning - Arduino IDE author: 'José Bagur and Taddy Chung' @@ -12,69 +12,77 @@ software: - ide-v1 - ide-v2 hardware: + - hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control - hardware/07.opta/opta-family/opta --- ## Overview -The Opta™ is a secure, easy-to-use micro Programmable Logic Controller (PLC) with Industrial Internet of Things (IIoT) capabilities. It can be programmed with the [Arduino PLC IDE](https://www.arduino.cc/pro/software-plc-ide/), a tool that simplifies programming the device through any of the five programming languages defined by the IEC 61131-3 standard. +The **Opta™** is a secure, easy-to-use micro Programmable Logic Controller (PLC) with Industrial Internet of Things (IIoT) capabilities. The **Portenta Machine Control** is a centralized, energy-efficient industrial control unit capable of operating equipment and machinery. + +Both devices can be programmed with the [Arduino PLC IDE](https://www.arduino.cc/pro/software-plc-ide/), a tool that simplifies programming the device through any of the five programming languages defined by the IEC 61131-3 standard. -The Opta™ can also be programmed with other tools from the Arduino ecosystem, such as the [Arduino IDE](https://www.arduino.cc/en/software) and the Arduino programming language. In case we are using Opta™ with the Arduino PLC IDE and we want to start programming the device using the Arduino IDE and the rest of the Arduino ecosystem tools, we need to partition the memory of the device to enable all of the available features. +The Opta™ and the Portenta Machine Control can also be programmed with other tools from the Arduino ecosystem, such as the [Arduino IDE](https://www.arduino.cc/en/software) and the Arduino programming language. Suppose we are using Opta™ with the Arduino PLC IDE and want to start programming the device using the Arduino IDE and the rest of the Arduino ecosystem tools. In that case, we need to partition the device's memory to enable all available features. This applies to the Portenta Machine Control as well. -In this tutorial, we will learn how to partition the memory of an Opta™ device to enable all of its functionalities to be programmed using the Arduino IDE and the Arduino programming language. +![The Memory Map for Opta™ & Portenta Machine Control](assets/memory-partitioning-introduction.png) -![The Opta™ memory map](assets/memory-partitioning-introduction.png) +In this tutorial, we will use an Opta™ and Portenta Machine Control to learn how to partition the memory, enabling all functionalities to be programmed using the Arduino IDE and the Arduino programming language. ## Goals -- Learn how to partition the memory of an Opta™ device to be used with the Arduino IDE and other ecosystem tools -- Program an Opta™ device using the Arduino IDE and the Arduino programming language. +- Learn how to partition the memory of an Opta™ and a Portenta Machine Control for use with the Arduino IDE and other ecosystem tools. +- Program an Opta™ and a Portenta Machine Control using the Arduino IDE and the Arduino programming language. ## Hardware and Software Requirements ### Hardware Requirements -- [Opta™ Lite](https://store.arduino.cc/products/opta-lite), [Opta™ RS485](https://store.arduino.cc/products/opta-rs485), or [Opta™ WiFi](https://store.arduino.cc/products/opta-wifi) (x1) +- Opta™ ([Opta™ Lite](https://store.arduino.cc/products/opta-lite), [Opta™ RS485](https://store.arduino.cc/products/opta-rs485), or [Opta™ WiFi](https://store.arduino.cc/products/opta-wifi)) (x1) or [Portenta Machine Control](https://store.arduino.cc/products/arduino-portenta-machine-control) (x1) - USB-C® cable (x1) +- [Micro USB cable](https://store.arduino.cc/products/usb-2-0-cable-type-a-micro) (x1) ### Software Requirements -- [Arduino IDE 1.8.10+](https://www.arduino.cc/en/software), [Arduino IDE 2](https://www.arduino.cc/en/software), or [Arduino Web Editor](https://create.arduino.cc/editor) -- [The memory partitioning sketch and the certificates file](assets/opta_memory_partitioning.zip) +- [Arduino IDE 1.8.10+](https://www.arduino.cc/en/software), [Arduino IDE 2](https://www.arduino.cc/en/software), or [Arduino Cloud Editor](https://create.arduino.cc/editor) +- [The memory partitioning sketch and the certificate file](assets/memory_partitioning.zip) ## Memory Partitioning -Memory partitioning involves dividing the available memory of a device into separate regions or partitions, each serving a specific purpose. This process is used for managing memory efficiently and ensuring that different programs or functionalities of the device can coexist without interfering each other. In the context of the Opta™, partitioning the memory allows the device to accommodate different functionalities, such as its Wi-Fi® module firmware, Over-The-Air (OTA) updates functionality, and certificates storage, while still providing memory space for user programs developed in the Arduino IDE and the Arduino programming language. +Memory partitioning involves dividing a device's available memory into separate regions or partitions, each serving a specific purpose. This process is used to manage memory efficiently and ensure that different programs or functionalities of the device can coexist without interfering with each other. + +In the context of the Opta™, partitioning the memory allows the device to accommodate different functionalities, such as its Wi-Fi® module firmware, Over-The-Air (OTA) updates functionality, and certificates storage, while still providing memory space for user programs developed in the Arduino IDE and the Arduino programming language. Similarly, it applies to the Portenta Machine Control as well. -Now, we will guide the process of partitioning an Opta™'s memory to enable the full range of its functionalities to be programmed using the Arduino IDE and the Arduino programming language. +Now, we will guide you through partitioning the memory of an Opta™ and Portenta Machine Control to enable full programming capabilities using the Arduino IDE and the Arduino programming language. -## Instructions +## Setting Up the Arduino IDE -### Setting Up the Arduino IDE +This tutorial requires the latest version of the Arduino IDE, which can be downloaded [here](https://www.arduino.cc/en/software). -This tutorial requires the latest version of the Arduino IDE; we can download it [here](https://www.arduino.cc/en/software). In the Arduino IDE, we need to install the core for Opta™ devices; this can be done by navigating to **Tools > Board > Boards Manager** or clicking the Boards Manager icon in the left tab of the IDE. In the Boards Manager tab, search for `opta` and install the latest `Arduino Mbed OS Opta Boards` version. +In the Arduino IDE, you need to install the core for *Opta™*. To do this, go to **Tools > Board > Boards Manager** or click the **Boards Manager** icon in the left tab of the IDE. In the **Boards Manager** tab, search for `opta` and install the latest `Arduino Mbed OS Opta Boards` version. ![Installing the Opta™ core in the Arduino IDE bootloader](assets/arduino-ide-1.png) -Now we are ready to start compiling and uploading Arduino sketches to an Opta™ device using the Arduino IDE. +For the *Portenta Machine Control*, in the __Boards Manager__ tab, search for `portenta` and install the latest `Arduino Mbed OS Portenta Boards` core version. -***Memory partitioning of an Opta™ should be done using the latest core and libraries to ensure the system is up-to-date with the intended default configuration.*** +We are now ready to compile and upload Arduino sketches to an Opta™ or a Portenta Machine Control using the Arduino IDE. -### Partitioning Memory of an Opta™ Device +***Memory partitioning of an Opta™ or a Portenta Machine Control should use the latest core and libraries to ensure the system is up-to-date with the intended default configuration.*** -The sketch below will guide us through partitioning the memory of an Opta™ device. The complete sketch and the certificates file can be downloaded [here](assets/opta_memory_partitioning.zip). **Remember to store both files in the same folder**. +## Partitioning the Memory of an Opta™ +To partition the memory of an Opta™, you need an Arduino sketch that includes memory partition operations and a certificate file. These files can be downloaded directly from the [Software Requirements section](#software-requirements) or [here](assets/memory_partitioning.zip). Ensure both files are stored in the same directory, as shown in the following layout: -```arduino -/** - Opta memory partitioning - Name: opta_memory_partitioning.ino - Purpose: Partition the memory of an Opta device +``` +memory_partitioning +├── certificates.h +└── memory_partitioning.ino +``` - @author Arduino PRO team - @version 1.0 04/04/22 -*/ +***The complete sketch and the certificate files can be downloaded [__here__](assets/memory_partitioning.zip). __Please store both files in the same directory__.*** + +The sketch below shows the memory partition process to be applied for Opta™. +```arduino // Include necessary libraries for working #include #include @@ -330,28 +338,318 @@ void printProgress(uint32_t offset, uint32_t size, uint32_t threshold, bool rese } ``` +***If you encounter an error while in the compilation process, __please remember to have both script and certificate files in the same folder__. The certificate file is crucial for the memory partitioning process. The complete sketch and the certificate files can be downloaded [__here__](assets/memory_partitioning.zip).*** + The sketch shown above performs four main tasks: -1. **Initialize and erase the QSPI Flash memory**: The sketch initializes the QSPI Flash memory of the Opta™ device and erases its content to prepare the memory for new firmware and data. One of the built-in LEDs of the device is used to indicate the progress of the memory-erasing process. +1. **Initialize and erase the QSPI Flash memory**: The sketch initializes the QSPI Flash memory of the Opta™ and erases its content to prepare the memory for new firmware and data. One of the built-in LEDs of the device is used to indicate the progress of the memory-erasing process. -2. **Create partitions and format them in the QSPI Flash memory**: The sketch creates and formats partitions in the QSPI Flash memory for the Wi-Fi firmware, Over-The-Air (OTA) updates functionality, and certificates storage. +2. **Create partitions and format them in the QSPI Flash memory**: The sketch creates and formats partitions in the QSPI Flash memory for the Wi-Fi firmware, Over-The-Air (OTA) updates functionality and certificates storage. -3. **Write Wi-Fi firmware and certificates data**: The sketch writes the Wi-Fi firmware and certificate data to the appropriate partitions in the QSPI Flash memory. It also flashes the memory-mapped Wi-Fi firmware and certificates. +3. **Write Wi-Fi firmware and certificate data**: The sketch writes the Wi-Fi firmware and certificate data to the appropriate partitions in the QSPI Flash memory and flashes the memory-mapped Wi-Fi firmware and certificates. -4. **Display progress in the Arduino IDE Serial Monitor**: The sketch provides a visual indication of the progress of the flashing process using one of the built-in LEDs of the Opta™ device and displays messages through the Arduino IDE Serial Monitor to inform the user about the current status of the flashing process. +4. **Display progress in the Arduino IDE Serial Monitor**: The sketch provides a visual indication of the progress of the flashing process using one of the built-in LEDs of the Opta™ and displays messages through the Arduino IDE Serial Monitor to inform the user about the current status of the flashing process. -To upload the code, click the **Verify** button to compile the sketch and check for errors; then click the **Upload** button to program the device with the sketch. +To upload the code, click the **Verify** button to compile the sketch and check for errors. Then, click the **Upload** button to program the device with the sketch. If two COM ports are available, which might happen after using the PLC IDE to program the device, select the COM port with the lower number. ![Uploading a sketch to the Opta™ the Arduino IDE](assets/arduino-ide-2.png) -After a while, you should see in the Serial Monitor information on the progress of the flashing process, as shown in the image below. +After a while, you should see information on the progress of the flashing process in the Serial Monitor, as shown in the image below. + +![Memory partitioning results of the Opta™ as shown in the Arduino IDE's Serial Monitor](assets/arduino-ide-3.png) + +If everything went as intended, you should see a success message in the Serial Monitor. Now, we are ready to start using the full capabilities of the Opta™ with the Arduino IDE. + +## Partitioning the Memory of a Portenta Machine Control + +**The memory partitioning process for the Portenta Machine Control follows the same procedure as the Opta™.** You will need the latest `Arduino Mbed OS Portenta Boards` core version. If you do not have the latest version, please refer to the [Setting Up the Arduino IDE](#setting-up-the-arduino-ide) section before proceeding. + +You will need an Arduino sketch with memory partition operations and a certificate file. These files can be downloaded from the [Software Requirements section](#software-requirements) or directly [here](assets/memory_partitioning.zip). Ensure both files are stored in the same directory, as shown below: + +``` +memory_partitioning +├── certificates.h +└── memory_partitioning.ino +``` + +***The complete sketch and the certificate files can be downloaded [__here__](assets/memory_partitioning.zip). __Please store both files in the same directory__.*** + +Compile and upload the following code to partition the memory of a Portenta Machine Control: + +```arduino +// Include necessary libraries for working +#include +#include +#include +#include +#include "wiced_resource.h" +#include "certificates.h" + +// Ensure that the M7 core is being used instead of the M4 core +#ifndef CORE_CM7 +#error Update the WiFi firmware by uploading the sketch to the M7 core instead of the M4 core. +#endif + +using namespace mbed; + +// Create instances of block devices and filesystems for the QSPI Flash memory +BlockDevice* root; +MBRBlockDevice* wifi_data; +MBRBlockDevice* ota_data; +FATFileSystem wifi_data_fs("wlan"); +FATFileSystem ota_data_fs("fs"); + +void setup() { + // Set the built-in LED pin as an output and turn it off + pinMode(LED_BUILTIN, OUTPUT); + digitalWrite(LED_BUILTIN, LOW); + + // Initialize serial communication and wait up to 2.5 seconds for a connection + Serial.begin(115200); + for (auto startNow = millis() + 2500; !Serial && millis() < startNow; delay(500)) + ; + + // Blink the built-in LED 10 times as a visual indicator that the process is starting + for (auto i = 0u; i < 10; i++) { + digitalWrite(LED_BUILTIN, HIGH); + delay(25); + digitalWrite(LED_BUILTIN, LOW); + delay(50); + } + + // Initialize and erase the QSPI flash memory. + Serial.println("Erasing the QSPIF"); + root = BlockDevice::get_default_instance(); + auto err = root->init(); + if (err != 0) { + Serial.print("Error Initializing the QSPIF: "); + Serial.println(err); + while (true) { + digitalWrite(LED_BUILTIN, HIGH); + delay(50); + digitalWrite(LED_BUILTIN, LOW); + delay(150); + } + } + + // Create partitions for Wi-Fi firmware, OTA updates, and certificate storage + // Get device geometry. + const auto erase_size = root->get_erase_size(); + const auto size = root->size(); + const auto eraseSectors = size / erase_size; -![Flashing process feedback of the Opta™ shown in the Arduino IDE's Serial Monitor](assets/arduino-ide-3.png) + for (auto i = 0u; i < eraseSectors; i++) { + err = root->erase(i * erase_size, erase_size); + if (i % 64 == 0) { + digitalWrite(LED_BUILTIN, HIGH); + delay(25); + digitalWrite(LED_BUILTIN, LOW); + } + if (err != 0) { + Serial.print("Error erasing sector "); + Serial.println(i); + Serial.print(" ["); + Serial.print(i * erase_size); + Serial.print(" - "); + Serial.print(float{ i } / float{ eraseSectors } * 100); + Serial.print("%] -> "); + Serial.print(err ? "KO" : "OK"); + Serial.println(); + for (auto i = 0u; i < 2; i++) { + digitalWrite(LED_BUILTIN, HIGH); + delay(50); + digitalWrite(LED_BUILTIN, LOW); + delay(150); + } + } + } + + Serial.println("Done"); + for (auto i = 0u; i < 5; i++) { + digitalWrite(LED_BUILTIN, HIGH); + delay(25); + digitalWrite(LED_BUILTIN, LOW); + delay(50); + } -If everything is correct, you should see a success message in the Serial Monitor. Now we are ready to start using the full capabilities of the Opta™ with the Arduino IDE. + // Format the partitions and create filesystem instances + // WiFi Firmware and TLS TA certificates: 1 MB + // Arduino OTA: 13 MB + MBRBlockDevice::partition(root, 1, 0x0B, 0 * 1024 * 1024, 1 * 1024 * 1024); + MBRBlockDevice::partition(root, 3, 0x0B, 14 * 1024 * 1024, 14 * 1024 * 1024); + MBRBlockDevice::partition(root, 2, 0x0B, 1024 * 1024, 14 * 1024 * 1024); + + // Create the filesystem references + wifi_data = new MBRBlockDevice(root, 1); + ota_data = new MBRBlockDevice(root, 2); + + // Write Wi-Fi firmware and certificate data to the appropriate partitions + Serial.print("Formatting WiFi partition... "); + err = wifi_data_fs.reformat(wifi_data); + if (err != 0) { + Serial.println("Error formatting WiFi partition"); + while (true) { + digitalWrite(LED_BUILTIN, HIGH); + delay(50); + digitalWrite(LED_BUILTIN, LOW); + delay(150); + } + } + + Serial.println("done."); + Serial.print("Formatting OTA partition..."); + err = ota_data_fs.reformat(ota_data); + if (err != 0) { + Serial.println("Error formatting OTA partition"); + while (true) { + digitalWrite(LED_BUILTIN, HIGH); + delay(50); + digitalWrite(LED_BUILTIN, LOW); + delay(150); + } + } + + Serial.println("done."); + for (auto i = 0u; i < 10; i++) { + digitalWrite(LED_BUILTIN, HIGH); + delay(25); + digitalWrite(LED_BUILTIN, LOW); + delay(50); + } + + Serial.println("QSPI Flash Storage Ready."); + + // Flash the memory-mapped Wi-Fi firmware and certificates + extern const unsigned char wifi_firmware_image_data[]; + extern const resource_hnd_t wifi_firmware_image; + FILE* fp = fopen("/wlan/4343WA1.BIN", "wb"); + const int file_size = 421098; + int chunck_size = 1024; + int byte_count = 0; + + Serial.println("Flashing /wlan/4343WA1.BIN file"); + printProgress(byte_count, file_size, 10, true); + while (byte_count < file_size) { + if (byte_count + chunck_size > file_size) + chunck_size = file_size - byte_count; + int ret = fwrite(&wifi_firmware_image_data[byte_count], chunck_size, 1, fp); + if (ret != 1) { + Serial.println("Error writing firmware data"); + break; + } + byte_count += chunck_size; + printProgress(byte_count, file_size, 10, false); + } + fclose(fp); + + chunck_size = 1024; + byte_count = 0; + const uint32_t offset = 15 * 1024 * 1024 + 1024 * 512; + + Serial.println("Flashing memory mapped firmware"); + printProgress(byte_count, file_size, 10, true); + while (byte_count < file_size) { + if (byte_count + chunck_size > file_size) + chunck_size = file_size - byte_count; + int ret = root->program(wifi_firmware_image_data, offset + byte_count, chunck_size); + if (ret != 0) { + Serial.println("Error writing firmware data"); + break; + } + byte_count += chunck_size; + printProgress(byte_count, file_size, 10, false); + } + + chunck_size = 128; + byte_count = 0; + fp = fopen("/wlan/cacert.pem", "wb"); + + Serial.println("Flashing certificates"); + printProgress(byte_count, cacert_pem_len, 10, true); + while (byte_count < cacert_pem_len) { + if (byte_count + chunck_size > cacert_pem_len) + chunck_size = cacert_pem_len - byte_count; + int ret = fwrite(&cacert_pem[byte_count], chunck_size, 1, fp); + if (ret != 1) { + Serial.println("Error writing certificates"); + break; + } + byte_count += chunck_size; + printProgress(byte_count, cacert_pem_len, 10, false); + } + fclose(fp); + + fp = fopen("/wlan/cacert.pem", "rb"); + char buffer[128]; + int ret = fread(buffer, 1, 128, fp); + Serial.write(buffer, ret); + while (ret == 128) { + ret = fread(buffer, 1, 128, fp); + Serial.write(buffer, ret); + } + fclose(fp); + + Serial.println("\nFirmware and certificates updated!"); + Serial.println("It's now safe to reboot or disconnect your board."); +} + +void loop() { + // Empty loop function, main task is performed in the setup function +} + +/** + Get the size of a file + + @param bootloader fp (FP) + @return files size +*/ +long getFileSize(FILE* fp) { + fseek(fp, 0, SEEK_END); + int size = ftell(fp); + fseek(fp, 0, SEEK_SET); + + return size; +} + +/** + Display the progress of the flashing process + + @params offset (uint32_t), size (uint32_t), threshold (uint32_t) and reset (bool) + @return none +*/ +void printProgress(uint32_t offset, uint32_t size, uint32_t threshold, bool reset) { + static int percent_done = 0; + if (reset == true) { + percent_done = 0; + Serial.println("Flashed " + String(percent_done) + "%"); + } else { + uint32_t percent_done_new = offset * 100 / size; + if (percent_done_new >= percent_done + threshold) { + percent_done = percent_done_new; + Serial.println("Flashed " + String(percent_done) + "%"); + } + } +} +``` + +***If you encounter an error during the compilation process, __please ensure both the script and certificate files are in the same folder__. The certificate file is crucial for the memory partitioning process. The complete sketch and the certificate files can be downloaded [here](assets/memory_partitioning.zip).*** + +Once the memory partition code is uploaded, wait for the process to finish. The upload target for the Portenta Machine Control is `Arduino Portenta H7`, which will be automatically detected by the Arduino IDE. + +The Arduino IDE's Serial Monitor should display memory partition results similar to those of the Opta™. + +![Memory partitioning results of the Portenta Machine Control as shown in the Arduino IDE's Serial Monitor](assets/arduino-ide-4.png) + +After this, you will be ready to use the full functionalities of the Portenta Machine Control with the Arduino IDE. ## Conclusion -In this tutorial, we successfully partitioned the memory of an Opta™ device, enabling its full range of functionalities to be programmed using Arduino ecosystem tools such as the Arduino IDE and the Arduino programming language. We walked through initializing and erasing the QSPI Flash memory, partitioning and formatting the memory, and writing the Wi-Fi firmware and certificate data onto the device's memory. +In this tutorial, we showed how to partition the memory of an Opta™ and a Portenta Machine Control, enabling its full range of functionalities to be programmed using Arduino ecosystem tools such as the Arduino IDE and the Arduino programming language. + +We walked through initializing and erasing the QSPI Flash memory, partitioning and formatting the memory, and writing the Wi-Fi firmware and certificate data onto the device's memory. + +## Next Steps As you move forward, you can explore the extensive Arduino ecosystem, leverage various libraries and hardware add-ons, and create powerful, connected, and secure industrial solutions using the Opta™. Check out our [Opta™ User Manual](/tutorials/opta/user-manual) to learn more about its hardware and software features. + +To learn more about using the Portenta Machine Control within the Arduino IDE to its full capability, please check out the [Portenta Machine Control User Manual](https://docs.arduino.cc/tutorials/portenta-machine-control/user-manual/) and the [Arduino Portenta Machine Control Library Guide](https://docs.arduino.cc/tutorials/portenta-machine-control/pmc-arduino-library/) for using the `Arduino_PortentaMachineControl` library. \ No newline at end of file diff --git a/content/hardware/_unlisted/kits/opta-ext-a0602/certifications/Arduino_AFX00007-DoC_CE.pdf b/content/hardware/_unlisted/kits/opta-ext-a0602/certifications/Arduino_AFX00007-DoC_CE.pdf new file mode 100644 index 0000000000..3b3a560b73 Binary files /dev/null and b/content/hardware/_unlisted/kits/opta-ext-a0602/certifications/Arduino_AFX00007-DoC_CE.pdf differ diff --git a/content/hardware/_unlisted/kits/opta-ext-a0602/certifications/Arduino_AFX00007-DoC_UKCA.pdf b/content/hardware/_unlisted/kits/opta-ext-a0602/certifications/Arduino_AFX00007-DoC_UKCA.pdf new file mode 100644 index 0000000000..b99f457fe3 Binary files /dev/null and b/content/hardware/_unlisted/kits/opta-ext-a0602/certifications/Arduino_AFX00007-DoC_UKCA.pdf differ diff --git a/content/hardware/_unlisted/kits/opta-ext-a0602/product.md b/content/hardware/_unlisted/kits/opta-ext-a0602/product.md new file mode 100644 index 0000000000..58341266d7 --- /dev/null +++ b/content/hardware/_unlisted/kits/opta-ext-a0602/product.md @@ -0,0 +1,5 @@ +--- +title: Opta Ext A0602 +certifications: [CE, UKCA] +sku: [AFX00007] +--- \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index bf291c885f..cfc8b24893 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "ISC", "dependencies": { - "@arduino/docs-arduino-cc": "^2.0.17", + "@arduino/docs-arduino-cc": "^2.0.18", "gatsby": "^5.11.0", "gatsby-background-image": "^1.6.0", "gatsby-image": "^3.11.0", @@ -339,9 +339,9 @@ } }, "node_modules/@arduino/docs-arduino-cc": { - "version": "2.0.17", - "resolved": "https://npm.pkg.github.com/download/@arduino/docs-arduino-cc/2.0.17/dc6ef8e37ef44da76b9d368aac8f9ab7a1eccf83", - "integrity": "sha512-duf4819HtRw1JldOQO4RDmlBI1GBa/GKFufuyjCu908jELekZvDGFO1pVniQAsVpf2EOU9uUHbjx+RlJTb28wg==", + "version": "2.0.18", + "resolved": "https://npm.pkg.github.com/download/@arduino/docs-arduino-cc/2.0.18/2bf192a54cd3413f96de6c4fa10596a899ec97ea", + "integrity": "sha512-uJzYiftIHZRGjDBTAiGZK6xkXpvmHiQuFYxNlDD/TYPyNrSZFZSU7N2su+cnwgXlQlKNBtzor5roqFsIbUMwSw==", "dependencies": { "@algolia/autocomplete-core": "^1.10.0", "@algolia/autocomplete-plugin-recent-searches": "^1.17.0", @@ -395,6 +395,7 @@ "react-popper": "^2.3.0", "react-select": "^5.7.4", "react-stately": "^3.25.0", + "react-toastify": "^10.0.5", "react-transition-group": "^4.4.5", "remark-unwrap-images": "^4.0.0", "sass": "^1.64.2", @@ -22677,6 +22678,26 @@ "react": "^16.8.3 || ^17 || ^18" } }, + "node_modules/react-toastify": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-10.0.5.tgz", + "integrity": "sha512-mNKt2jBXJg4O7pSdbNUfDdTsK9FIdikfsIE/yUCxbAEXl4HMyJaivrVFcn3Elvt5xvCQYhUZm+hqTIu1UXM3Pw==", + "dependencies": { + "clsx": "^2.1.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, + "node_modules/react-toastify/node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "engines": { + "node": ">=6" + } + }, "node_modules/react-transition-group": { "version": "4.4.5", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", diff --git a/package.json b/package.json index 8e0be1180a..2b0e55946c 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "homepage": "https://github.com/arduino/docs-content#readme", "dependencies": { - "@arduino/docs-arduino-cc": "^2.0.17", + "@arduino/docs-arduino-cc": "^2.0.18", "gatsby": "^5.11.0", "gatsby-background-image": "^1.6.0", "gatsby-image": "^3.11.0",