Open
Description
The Arduino_UnifiedStorage library provides the following two ways to access information about the partitions on the Internal storage, both of which are exhibited in SimpleStorageWriteRead.ino:
Arduino_UnifiedStorage::debuggingModeEnabled = true;
- This prints information about the storage media operations to the Serial Monitor.
std::vector<Partition> partitions = InternalStorage::readPartitions();
- The function
InternalStorage::readPartitions()
is called to retrieve a list of partition configurations from the internal storage of the device. This is stored as a dynamically resizable array of objects, in this casepartitions
- The function
However, each approach has its own reality as to what partitions exist. As an example, if we format the Portenta H7 Internal storage to have a single 12MB FAT partition (by uploading the AUS_SPIS_FORMAT_001 sketch):
- The debug messages tell us that there are four partitions, one of which is FAT
[Partitioning][readPartitions][INFO] Partition 1 is formatted with FAT file system
[Partitioning][readPartitions][INFO] Partition 2 is empty, skipping
[Partitioning][readPartitions][INFO] Partition 3 is empty, skipping
[Partitioning][readPartitions][INFO] Partition 4 is empty, skipping
- The
partitions
vector (as defined above) shows that only one partition exists
Partition: 1
Size: 12284
Type: FAT
There should be no difference between the number of partitions reported by both approaches.