Skip to content
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

Use SD card as store&forward memory #5083

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft

Conversation

caveman99
Copy link
Member

Not 100% sure if this is a good idea.

@caveman99
Copy link
Member Author

n.b. this enables store&forward as a client for non-esp32 devices.

@markbirss
Copy link
Contributor

@caveman99 The rak board has addon sdcard board also

@caveman99
Copy link
Member Author

@markbirss yes, I wanna go slowly step by step. For the rak I thought the flash add-ons would be a better choice. Still looking into this.

@GUVWAF
Copy link
Member

GUVWAF commented Oct 16, 2024

Sounds really nice.

Any idea on how long a write and read takes (since it seems this isn't asynchronous)?

@caveman99
Copy link
Member Author

Any idea on how long a write and read takes (since it seems this isn't asynchronous)?

Nope, i couldn't test it (yet). It's 200ish byte per file, but also the SDcard interface is usually single lane.

@caveman99 caveman99 force-pushed the store-and-forward branch 3 times, most recently from ea5b17f to 3abe294 Compare October 25, 2024 11:06
@Woutvstk
Copy link

Hi
I had made a pull request to add hardware support for the NRF52 platform. Someone mentioned that I should add my commits to this pull request. Could you give me acces to this PR branch or would you like to do things differently? Let me know, thanks

caveman99 and others added 5 commits December 29, 2024 22:41
* First attempt to adding hardware support for NRF52 SPI SD Card using arduino SD library
My first time contributing to an open source project so not very confident in what i'm doing.

Changes to
FSCommon:
initializing SD library for NRF52. Progress: No compile error, but SD card does not get initialized properly yet
added ifdef ARCH_ESP32 conditions around esp32 SD library functions

memget: added ifdef conditional statements

StoreForwardModule.cpp: added ifdef conditional statements

Rak4631 platfromIO.ini and variant.h:
added arduino-libraries/SD@^1.3.0 library to libdeps
defined HAS_SDCARD and SPI pins

Arduino SD library. Made changes to library because using namespace SDLIB in header file caused ambiguity problems
Not sure this is the right way of adding a library, also, how do i implement changes to the library permanently to the project?

Am I going somewhat in the right direction with these changes? Tell me your thoughts, thanks

* replaced arduino SD library to custom fork.
A "using namespace" statement in the header file was to messy to work around.
NRF52 SD card initialisation added

* updated library reference
added card size and type function to SD library
added populateSDCard for NRF52

* Changed NRF52 SD object from SDFilesystem to SD

Changed NRF52 SD object from SDFilesystem to SD for more compatibility with esp32 SD library. Some functions are still different but most used open, read, write and close are the same.

* Removed duplicate ESP32/NRF52 SD card access code

Mainly made changes to the custom arduino SD library to make it compatible with the esp32 SD library already used in the store and forward code.
With these compatible function names and return, I removed some duplicate code.

* trunk fmt and pin SD library to commit hash

* print this out on ESP32 anyway

---------

Co-authored-by: Thomas Göttgens <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants