-
Notifications
You must be signed in to change notification settings - Fork 3
Integrate new features #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 45 commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
21e28f1
added opta fixes, using latest POSIXStorage lib
cristidragomir97 083b2ce
added opta logger
cristidragomir97 12b6e76
added partitioning, did 'some' refactoring
cristidragomir97 f783e81
added full refactorings, but it fails to build for now
cristidragomir97 a5f54ee
fixed issues caused by refactorings
cristidragomir97 38f181d
Merge pull request #1 from cristidragomir97/refactorings
cristidragomir97 17f9203
Merge branch 'arduino-libraries:main' into main
cristidragomir97 541952e
added readPartitions, unified Logger for C33, H7 and opta
cristidragomir97 02e852f
fixed examples
cristidragomir97 07b405d
refactoring partitioning
cristidragomir97 9cd7a6e
Improve formatting
sebromero 6d677f6
Improve documentation
sebromero bb22d70
Refactor variable name
sebromero f107ae1
Report success only if all partitions are correctly formatted
sebromero 4e7931f
Simplify code by using guard clauses
sebromero b0a5061
Rename variable
sebromero 5ee1f70
Remove unused code
sebromero 852ef17
Add documentation
sebromero 0331227
Simplify code
sebromero 7024428
Remove superfluous empty lines
sebromero df9c8b6
Simplify code by using guard clauses
sebromero 2ce00cd
Fix compiler warnings
sebromero 6103551
Revert calls to printToSerialOrRS485
sebromero 3d332ea
Use board config instead of custom defines
sebromero dd83662
Fix spelling mistakes
sebromero be4f8b0
Add missing return statements
sebromero 99ffb53
Fix incorrect reference
sebromero 688059b
Replace printToSerialOrRS485 with debugPrint
sebromero 1940f36
Add missing import
sebromero 1821d32
Use Boards file instead of redefining board features
sebromero 6bb89a9
Merge pull request #24 from arduino-libraries/partitioning_refactorings
cristidragomir97 638a5ba
fixes on tests
cristidragomir97 79bbd80
added RS485 dependency in gituhub actions, fixed unused methods from …
cristidragomir97 817aeae
updated RS485 dependency in github action
cristidragomir97 943a875
fixes and tweaks
cristidragomir97 ac8699a
added debugPrint statements everywhere
cristidragomir97 2ea7e0c
fixed warningins
cristidragomir97 722bf6e
fixed bug on first-time internal storage usage
cristidragomir97 9f2b611
implemented static bool for logging
cristidragomir97 7f2e8e3
fixed logging
cristidragomir97 3b5be8d
cleaned up examples, fixed RS485, fixed spelling errors
cristidragomir97 4200218
updated readme and docs
cristidragomir97 26c8b0b
Update README.md
cristidragomir97 3a80cc5
Update Partitioning.cpp to skip partitions of 0x0B type that have 0 b…
cristidragomir97 08910eb
Update Partitioning.cpp to avoid empty partitions
cristidragomir97 50fb1fc
Readme improvements
aliphys b5b21e1
cosmetic and consistency fixes
cristidragomir97 9089fa7
Merge branch 'main' into partitioning_callbacks_opta
sebromero a10bdc8
Change storage variable name in example
sebromero 9948840
Bump version number
sebromero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,76 @@ | ||
# 💾 Unified Storage Library | ||
|
||
# 💾 Unified Storage Library | ||
|
||
|
||
|
||
[](https://github.com/arduino-libraries/Arduino_UnifiedStorage/actions/workflows/check-arduino.yml) [](https://github.com/arduino-libraries/Arduino_UnifiedStorage/actions/workflows/compile-examples.yml) [](https://github.com/arduino-libraries/Arduino_UnifiedStorage/actions/workflows/spell-check.yml) [](https://github.com/arduino-libraries/Arduino_UnifiedStorage/actions/workflows/sync-labels.yml) | ||
|
||
|
||
|
||
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. | ||
|
||
|
||
|
||
## Examples | ||
|
||
* [**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 | ||
|
||
* [**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 | ||
|
||
* [**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. | ||
|
||
* [**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. | ||
|
||
* [**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. | ||
|
||
## 👀 Instructions | ||
1. Download and install this library | ||
|
||
1. Download and install this library | ||
2. Check compatibility with your platform | ||
3. To use internal storage, you need to make sure it is partitioned and formatted correctly: | ||
|
||
### Formatting the Portenta H7 / Portenta Machine Control / Opta Internal Storage | ||
* Flash the `QSPIFormat` example that can be found in the `STM32H747_System` folder | ||
* Open the serial monitor and select answer with "n" when this appears "Do you want to use partition scheme 1? Y/[n]" | ||
* The sketch will warn you that the content of the QSPI flash will be erased. Answer with "Y". | ||
* 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. | ||
* Reboot the board | ||
|
||
### Formatting the Portenta C33 Internal Storage | ||
* Flash the `QSPIFormat` example that can be found in the `Storage` folder for Portenta C33. | ||
* Open the Serial Monitor. The sketch will warn you that the content of the QSPI flash will be erased. Answer with "Y". | ||
* 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. | ||
* Reboot the board | ||
3. Check out the examples or read read the documentation [here](./docs). | ||
|
||
## ✨ Features | ||
|
||
* Access files and directories on internal storage, SD cards, and USB mass storage devices. | ||
* Read and write data to files. | ||
* Create, remove, and rename files and directories. | ||
* Copy and move files and directories. | ||
* List files and subfolders in a directory. | ||
* Manipulate files and folders from one storage medium to another | ||
* Format partitions and drives (FAT and LittleFS) | ||
* Create and modify partitions on the internal storage | ||
* Register callbacks whenever a USB Mass Storage device has been inserted or removed | ||
* Get verbose output of every action the library performs for seamless debugging | ||
|
||
|
||
|
||
## Compatibility | ||
|
||
This library has been tested with the following STM32 and Renesas based Arduino boards. The availability of storage mediums depends on the hardware interfaces: | ||
* Portenta Machine Control: USB and Internal QSPI Flash | ||
* Portenta H7 + Portenta Breakout: USB, SD, and QSPI | ||
* Portenta H7 + Vision Shield: SD and QSPI | ||
* Portenta C33 + Portenta Breakout: USB, SD, and QSPI | ||
* Portenta C33 + Vision Shield: SD and QSPI | ||
* Opta: Internal QSPI Flash and USB | ||
|
||
* **Portenta Machine Control**: USB and Internal QSPI Flash | ||
* **Portenta H7 + Portenta Breakout**: USB, &sd, and QSPI | ||
* **Portenta H7 + Vision Shield**: SD and QSPI | ||
* **Portenta C33 + Portenta Breakout**: USB, &sd, and QSPI | ||
* **Portenta C33 + Vision Shield**: SD and QSPI | ||
* **Opta**: Internal QSPI Flash and USB | ||
|
||
|
||
|
||
The library allows you to connect a USB drives in a couple of different ways: | ||
|
||
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. | ||
* **Use the USB-C port on the board**: however you have to make sure you are not using the Serial functionality on the same port to avoid conflicts | ||
* **Connect to the USB-A port** on the breakout board | ||
sebromero marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* **Use a USB Hub**, however, we cannot guarantee compatibility with every USB Hub on the market especially the USB-C hubs with advanced features like Ethernet or HDMI. | ||
|
||
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. | ||
|
||
**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. | ||
|
||
This limitation only affects Portenta C33 boards. | ||
|
||
## 📖 Documentation | ||
|
||
|
||
|
||
For more information about this library please read the documentation [here](./docs). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.