Skip to content

Commit cdf11bd

Browse files
authored
Merge pull request #25 from arduino-libraries/partitioning_callbacks_opta
Integrate new features
2 parents d0145de + 9948840 commit cdf11bd

33 files changed

+2215
-1231
lines changed

Diff for: .github/workflows/compile-examples.yml

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
- source-path: ./
6969
- name: Arduino_USBHostMbed5
7070
- name: Arduino_POSIXStorage
71+
- name: ArduinoRS485
7172
# Additional library dependencies can be listed here.
7273
# See: https://github.com/arduino/compile-sketches#libraries
7374
sketch-paths: |

Diff for: .vscode/settings.json

+42-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,47 @@
66
"unordered_map": "cpp",
77
"vector": "cpp",
88
"string_view": "cpp",
9-
"initializer_list": "cpp"
9+
"initializer_list": "cpp",
10+
"atomic": "cpp",
11+
"bit": "cpp",
12+
"*.tcc": "cpp",
13+
"cctype": "cpp",
14+
"clocale": "cpp",
15+
"cmath": "cpp",
16+
"compare": "cpp",
17+
"concepts": "cpp",
18+
"cstdarg": "cpp",
19+
"cstddef": "cpp",
20+
"cstdint": "cpp",
21+
"cstdio": "cpp",
22+
"cstdlib": "cpp",
23+
"cstring": "cpp",
24+
"cwchar": "cpp",
25+
"cwctype": "cpp",
26+
"exception": "cpp",
27+
"algorithm": "cpp",
28+
"functional": "cpp",
29+
"iterator": "cpp",
30+
"memory": "cpp",
31+
"memory_resource": "cpp",
32+
"numeric": "cpp",
33+
"optional": "cpp",
34+
"random": "cpp",
35+
"system_error": "cpp",
36+
"tuple": "cpp",
37+
"type_traits": "cpp",
38+
"utility": "cpp",
39+
"iosfwd": "cpp",
40+
"iostream": "cpp",
41+
"istream": "cpp",
42+
"limits": "cpp",
43+
"new": "cpp",
44+
"numbers": "cpp",
45+
"ostream": "cpp",
46+
"ranges": "cpp",
47+
"stdexcept": "cpp",
48+
"streambuf": "cpp",
49+
"typeinfo": "cpp",
50+
"cerrno": "cpp"
1051
}
1152
}

Diff for: README.md

+33-23
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,60 @@
44

55
The Arduino_UnifiedStorage library provides a unified interface to access different types of storage, including internal storage, SD cards, and USB mass storage devices. It simplifies the handling of files and directories across multiple storage mediums on Portenta, Opta, and some Nicla boards.
66

7-
87
## Examples
8+
99
* [**examples/SimpleStorageWriteRead**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/SimpleStorageWriteRead/SimpleStorageWriteRead.ino) - Write/read simple data from SD, USB and internal storage
10+
1011
* [**examples/AdvancedUSBInternalOperations**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/AdvancedUSBInternalOperations/AdvancedUSBInternalOperations.ino) - Navigate file structure and demonstrate file operations between USB and internal storage
12+
1113
* [**examples/BackupInternalPartitions**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/BackupInternalPartitions/BackupInternalPartitions.ino) - Back up all partitions on the internal storage to a USB Mass Storage device.
1214

15+
* [**examples/Logger**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/Logger/Logger.ino) - This example demonstrates how you can log sensor data into its internal storage and detect the insertion of a USB drive. When a USB drive is connected, it selectively transfers only the new data to the USB mass storage device. Even if you remove the USB drive, the device continues to log data in its internal storage. This capability is particularly valuable for accumulating training data required for embedded machine learning applications.
16+
17+
* [**examples/InternalStoragePartitioning**](https://github.com/arduino-libraries/Arduino_UnifiedStorage/blob/main/examples/InternalStoragePartitioning/InternalStoragePartitioning.ino) - Demonstrates how you can use the Arduino_UnifiedStorage library to create and read partitions on the Internal QSPI Storage.
18+
1319
## 👀 Instructions
14-
1. Download and install this library
20+
21+
1. Download and install this library
1522
2. Check compatibility with your platform
16-
3. To use internal storage, you need to make sure it is partitioned and formatted correctly:
17-
18-
### Formatting the Portenta H7 / Portenta Machine Control / Opta Internal Storage
19-
* Flash the `QSPIFormat` example that can be found in the `STM32H747_System` folder
20-
* Open the serial monitor and select answer with "n" when this appears "Do you want to use partition scheme 1? Y/[n]"
21-
* The sketch will warn you that the content of the QSPI flash will be erased. Answer with "Y".
22-
* When asked if you'd like to use LittleFS on the data partition, select "n". Most of the examples assume that the drive is formatted as FAT. You can use the library to format to LittleFS later.
23-
* Reboot the board
24-
25-
### Formatting the Portenta C33 Internal Storage
26-
* Flash the `QSPIFormat` example that can be found in the `Storage` folder for Portenta C33.
27-
* Open the Serial Monitor. The sketch will warn you that the content of the QSPI flash will be erased. Answer with "Y".
28-
* When asked if you'd like to use LittleFS on the data partition, select "n". Most of the examples assume that the drive is formatted as FAT. You can use the library to format to LittleFS later.
29-
* Reboot the board
23+
3. Check out the examples or read read the documentation [here](./docs).
3024

3125
## ✨ Features
26+
3227
* Access files and directories on internal storage, SD cards, and USB mass storage devices.
3328
* Read and write data to files.
3429
* Create, remove, and rename files and directories.
3530
* Copy and move files and directories.
3631
* List files and subfolders in a directory.
3732
* Manipulate files and folders from one storage medium to another
3833
* Format partitions and drives (FAT and LittleFS)
34+
* Create and modify partitions on the internal storage
35+
* Register callbacks whenever a USB Mass Storage device has been inserted or removed
36+
* Get verbose output of every action the library performs for seamless debugging
3937

4038
## Compatibility
39+
4140
This library has been tested with the following STM32 and Renesas based Arduino boards. The availability of storage mediums depends on the hardware interfaces:
42-
* Portenta Machine Control: USB and Internal QSPI Flash
43-
* Portenta H7 + Portenta Breakout: USB, SD, and QSPI
44-
* Portenta H7 + Vision Shield: SD and QSPI
45-
* Portenta C33 + Portenta Breakout: USB, SD, and QSPI
46-
* Portenta C33 + Vision Shield: SD and QSPI
47-
* Opta: Internal QSPI Flash and USB
4841

42+
* **Portenta Machine Control**: USB and Internal QSPI Flash
43+
* **Portenta H7 + Portenta Breakout**: USB, SD, and QSPI
44+
* **Portenta H7 + Vision Shield**: SD and QSPI
45+
* **Portenta C33 + Portenta Breakout**: USB, SD, and QSPI
46+
* **Portenta C33 + Vision Shield**: SD and QSPI
47+
* **Opta**: Internal QSPI Flash and USB
48+
49+
50+
The library allows you to connect a USB drives in a couple of different ways:
51+
52+
* **Use the USB-C port on the board**: Ensure Serial functionality is not in use on the same port to prevent conflicts.
53+
* **Connect to the USB-A port**: Located on the Portenta Breakout
54+
* **Use a USB Hub**: Note that while our some USB Hubs are supported, we cannot ensure compatibility with all USB Hubs. Especially for when used together with advanced features like Ethernet or HDMI, such as certain USB-C hubs.
55+
56+
**Note:** Due to the extremely large selection of USB Mass Storage devices on the market, we cannot guarantee compatibility with your USB thumb drive. However, we had great results with drives from reputable brands such as Kingston, SanDisk, Samsung, etc.
57+
58+
**Note:** Due to an unforeseen compatibility issue on the Portenta Breakout Board, inserting a USB drive on the USB-A port of the breakout board may occasionally cause a reboot on Portenta C33 boards. You can work around this issue by connecting your USB Mass Storage device through a USB hub. Please note that the USB Callback functionality on the Portenta C33 boards might also be affected by this issue.
4959

50-
Note: Due to an unforeseen compatibility issue on the Portenta Breakout Board, inserting a USB drive on the USB-A port of the breakout board may occasionally cause a reboot on Portenta C33 boards. You can work around this issue by connecting your USB Mass Storage device through a USB hub. This limitation only affects Portenta C33 boards.
60+
This limitation only affects Portenta C33 boards.
5161

5262
## 📖 Documentation
5363

0 commit comments

Comments
 (0)