-
Notifications
You must be signed in to change notification settings - Fork 178
Add default block device support (SD, SPIF and FLASHIAP) documentation #685
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
Add default block device support (SD, SPIF and FLASHIAP) documentation #685
Conversation
…vice FileSystem documentation for new get_default_instance implementation
@@ -30,6 +30,66 @@ The state of an erased block is **undefined**. The data stored on the block isn' | |||
|
|||
 | |||
|
|||
### BlockDevice get default instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add this to the storage configuration page?
Maybe add a BlockDevice section?
Copy edit file, mostly for grammar and style consistency.
Make initial copy edits, mostly for formatting.
Fix typo.
Copy edit for spelling and minor style nits.
Remove extra information from user API, and copy edit remaining text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address my comments.
@@ -6,6 +6,34 @@ The main purpose of a FileSystem is to be instantiated. The FileSystem's constru | |||
|
|||
The FileSystem's `file` and `dir` functions are protected because you should not use the FileSystem `file` and `dir` functions directly. They are only a convenience for implementors. Instead, the [File](file.html) and [Dir](dir.html) classes provide access to file and directory operations in a C++ class that respects [RAII](/docs/development/introduction/glossary.html#r) and other C++ conventions. | |||
|
|||
### File system get default instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Can we move the configuration content to the storage config page?
|
||
## FlashIAPBlockDevice class reference | ||
|
||
[](<Should be added after doxygen run>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Do we have an example for this yet? If not, can you create one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, but I will add a code snippet to help people understand how to use it.
@@ -0,0 +1,17 @@ | |||
## FlashIAPBlockDevice | |||
|
|||
The flash IAP block device is a block device driver built on top of the FlashIAP API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add more description of what this API does and its use cases.
|
||
The flash IAP block device is a block device driver built on top of the FlashIAP API. | ||
|
||
## Warning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to have Product review this warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This warning should be removed.
- The file system code (hosted in `mbed-os`) is composed of 2 parts: the FAT file system implementation code and the file system classes that present a consistent API to the retarget module for different (third-party) file system implementations. | ||
- The Block API. The SDCard block device is a persistent storage block device. | ||
- The SPI module provides the Mbed OS SPI API. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a section here linking to our Doxygen.
Please note that while a default block device exists an application is not enforced to use it and can create its own one. | ||
|
||
### Overriding default block device implementation | ||
The get default instance is implemented as MBED_WEAK at features/storage/system_storage/SystemStorage.cpp. That means that it can be overridden by implementing the function without MBED_WEAK and change the default block device for a given application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a link to -> this will be useful ?? it's not immediately clear to me what the macro means..
Hi @AnotherButler. I will update the PR today with changes addressing all comments. |
….md config. Adding info regarding FlashIAPBlockDevice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No comments, looks great.
Copy edit file, mostly for consistent tense across docs.
Copy edit file, mostly for active voice.
Delete duplicate content.
Delete duplicate content.
Copy edit file for clarity.
Copy edit file for active voice, present tense and other grammar.
|
||
#### Configuring components | ||
|
||
Adding "components": ["???"] in targets.json: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theotherjimmy As it's the weekend in Israel, could you please tell me what should go here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's going to be one of "SD", "SPIF" or "FLASHIAP"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just say "for example, the following entry in targets.json
enables the SD component". The following example should be trimmed to only identifying info and the important information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"K64F": {
"components": ["SD"],
"core": "Cortex-M4F",
"supported_toolchains": ["ARM", "GCC_ARM", "IAR"],
"inherits": ["Target"],
"features": ["STORAGE"],
"release_versions": ["2", "5"],
...
},
Is probably enough to get the point across.
}, | ||
``` | ||
|
||
Adding "target.components_add": ["???"] in application config file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theotherjimmy As it's the weekend in Israel, could you please tell me what should go here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So could I change it to
Adding "target.components_add": [""] in application config file:
For clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. That particular line is somewhat nonsense, somewhat leads to unexpected behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend:
"The following mbed_app.json
snippet enables the Spi flash component when compiling for the MTB_ADV_WISE_1570 target.
"MTB_ADV_WISE_1570": {
"target.components_add": ["SPIF"]
}
(removed unrelated lines from the example)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theotherjimmy Let's keep the comments professional and kind. I know @yossi2le and I both appreciate your help streamlining the example, but it doesn't mean the redundant lines are "garbage".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in "things to be thrown out"? I could have picked a more constructive word for sure. That word may have been in poor taste. Edited.
Personally I think unrelated lines take away from an example as they have the potential to distract or misdirect the reader and I find that having them is a determent to the example.
I meat no ill will or disparaging remarks to anyone or their writing skills/style.
Honestly, The beginning of that comment was really worse so I edited that out too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theotherjimmy No hard feelings;)
|
||
### DataFlashBlockDevice class reference | ||
|
||
[](<Should be added after doxygen run>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Add link after code merges.
|
||
## FlashIAPBlockDevice class reference | ||
|
||
[](<Should be added after doxygen run>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Add link after code merges.
|
||
### SDBlockDevice class reference | ||
|
||
[](<Should be added after doxygen run>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Add link after code merges.
|
||
### SPIFBlockDevice class reference | ||
|
||
[](<Should be added after doxygen run>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Add link after code merges.
Update snippets with recommended changes for clarity.
@AnotherButler Thanks for the changes. |
@yossi2le I can't find the code in the Doxygen: https://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/annotated.html Could you please help me? |
I wish I could. I am puzzled, are we looking at the correct build.
However, this file has been moved to mbed-os/features/storage/blockdevice/BlockDevice.h I have a feeling this Doxygen output is before #7774 |
@kegilbert Is this something you can help with? |
@yossi2le @kegilbert I'm going to comment out the broken links until we can fix them. That way, I can merge this, so OOB can start reviewing the descriptions and examples. Please do not stop working to figure out why these links don't work just because this PR is closing. |
Comment out missing link.
Temporarily comment out missing link.
@AnotherButler |
Comment out missing link.
Comment out missing link.
@yossi2le @kegilbert I've updated the Doxygen, and these classes still aren't appearing: https://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/annotated.html Should they be under Data Structures, where I'm looking? Or are they somewhere else? |
Fix broken link now that Doxygen's fixed.
Add link now that Doxygen's fixed.
Add link now that Doxygen's fixed.
Add link now that Doxygen's fixed.
This PR is intended to update the documentation of block devices and filesystems after the merge of PR ARMmbed/mbed-os#7774 into mbed-os.
The documentation contains
Please refer to PR #7774 in the link above for all details regarding this change.