You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/07.opta/opta-family/opta/tutorials/08.memory-partitioning/content.md
+37-16
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,11 @@ hardware:
19
19
20
20
## Overview
21
21
22
-
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.
22
+
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.
23
23
24
-
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 deviceto enable all of the available features.
24
+
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.
25
25
26
-
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.
26
+
In this tutorial, we will use an Opta™ and learn how to partition the memory to enable all its functionalities to be programmed using the Arduino IDE and the Arduino programming language.
@@ -44,32 +44,43 @@ In this tutorial, we will learn how to partition the memory of an Opta™ device
44
44
### Software Requirements
45
45
46
46
-[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)
47
-
-[The memory partitioning sketch and the certificates file](assets/memory_partitioning.zip)
47
+
-[The memory partitioning sketch and the certificate file](assets/memory_partitioning.zip)
48
48
49
49
## Memory Partitioning
50
50
51
-
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.
51
+
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.
52
+
53
+
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.
52
54
53
55
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.
54
56
55
57
## Instructions
56
58
57
59
### Setting Up the Arduino IDE
58
60
59
-
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.
61
+
This tutorial requires the latest version of the Arduino IDE, which can be downloaded[here](https://www.arduino.cc/en/software). In the Arduino IDE, you need to install the core for Opta™ devices. To do this, go to T**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.
60
62
61
63

62
64
63
-
Now we are ready to start compiling and uploading Arduino sketches to an Opta™ device using the Arduino IDE.
65
+
***For the Portenta Machine Control, in the __Boards Manager__ tab, search for `portenta` and install the latest `Arduino Mbed OS Portenta Boards` core version.***
66
+
67
+
We are now ready to compile and upload Arduino sketches to an Opta™ device using the Arduino IDE.
64
68
65
-
***Memory partitioning of an Opta™ or a Portenta Machine Control should be done using the latest core and libraries to ensure the system is up-to-date with the intended default configuration.***
69
+
***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.***
66
70
67
71
### Partitioning Memory of an Opta™ Device
68
72
69
-
The sketch below will guide us through partitioning the memory of an Opta™ device.
73
+
To partition the memory of an Opta™ device, 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:
74
+
75
+
```
76
+
memory_partitioning
77
+
├── certificates.h
78
+
└── memory_partitioning.ino
79
+
```
70
80
71
-
***The complete sketch and the certificates file can be downloaded [__here__](assets/memory_partitioning.zip). __ Please remember to store both files in the same folder__.***
81
+
***The complete sketch and the certificate files can be downloaded [__here__](assets/memory_partitioning.zip). __Please store both files in the same directory__.***
72
82
83
+
The sketch below shows the memory partition process to be applied for Opta™.
***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).***
342
+
330
343
The sketch shown above performs four main tasks:
331
344
332
345
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.
333
346
334
-
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.
347
+
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.
335
348
336
-
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.
349
+
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.
337
350
338
351
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.
339
352
340
-
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.
353
+
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.
341
354
342
355

343
356
344
-
After a while, you should see in the Serial Monitor information on the progress of the flashing process, as shown in the image below.
357
+
After a while, you should see information on the progress of the flashing process in the Serial Monitor, as shown in the image below.
345
358
346
359

347
360
348
-
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.
361
+
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.
362
+
363
+
**The process is similar for the Portenta Machine Control.** Once the same memory partition code uploads and finishes its operation, it should show similar results in the Arduino IDE's Serial Monitor as the Opta™. It will be ready to start using the full functionalities of the Portenta Machine Control with the Arduino IDE.
349
364
350
365
## Conclusion
351
366
352
-
In this tutorial, we successfully partitioned the memory of an Opta™ or 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.
367
+
In this tutorial, we showed how to partition 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.
368
+
369
+
We also showed that the same process can be applied to the Portenta Machine Control to achieve similar results.
370
+
371
+
## Next Steps
353
372
354
373
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.
374
+
375
+
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.
0 commit comments