Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

drivers/mtd_spi_eeprom: add MTD wrapper for AT25XXX EEPROMs #13877

Conversation

JokoMLPA
Copy link
Contributor

Contribution description

Adding mtd wrapper for SPI-EEPROMs like at25xxx or M95xxx using mtd interface.
The structure is similar to mtd_flashpage or mtd_sdcard.

Testing procedure

You can test the driver using RIOT/examples/filesystem (via littlefs). You need to define MTD0 in your board.h and create a mtd_spi_eeprom_t configuration containing the driver parameters, which has to be passed to the mtd layer.

Issues/PRs references

@roberthartung
Copy link
Member

It looks like there are many unrelated changes, am I correct here? I would like to see the base implementation + tests in one PR and then changes to the boards if needed.

@benpicco
Copy link
Contributor

@JokoMLPA please do a git rebase -i master and remove all the unrelated commits.

Alternatively, since this is only one commit, you can also do a git reset --hard master and then curl https://github.com/RIOT-OS/RIOT/commit/b1ce9f4b9e19a606a3c548407762c8814bc42dc7.patch | git am

git cherry-pick b1ce9f4b9e19a606a3c548407762c8814bc42dc7 should also work

@benpicco benpicco changed the title Feat/20200409 add mtd spi eeprom drivers/mtd_spi_eeprom: add MTD wrapper for AT25XXX EEPROMs Apr 15, 2020
@benpicco benpicco added Area: drivers Area: Device drivers Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: fs Area: File systems labels Apr 15, 2020
@JokoMLPA JokoMLPA force-pushed the feat/20200409__add_mtd_spi_eeprom branch from b1ce9f4 to 5d50077 Compare April 16, 2020 14:35
@benpicco
Copy link
Contributor

Can you please also add a simple test application to tests/ so this can be compile-tested by CI?

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 30, 2020
@benpicco
Copy link
Contributor

Travis has some more nits and Murdock isn't happy yet.

@cgundogan cgundogan added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 30, 2020
@JokoMLPA JokoMLPA force-pushed the feat/20200409__add_mtd_spi_eeprom branch from a6d5e9c to 1e8535b Compare April 30, 2020 17:48
@benpicco benpicco requested a review from vincent-d April 30, 2020 21:25
Copy link
Contributor

@benpicco benpicco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm - tested with examples/filesystem (requires #14006).

One more thing - can you please add this patch:

--- a/drivers/Makefile.dep
+++ b/drivers/Makefile.dep
@@ -509,6 +509,10 @@ endif
 ifneq (,$(filter mtd_%,$(USEMODULE)))
   USEMODULE += mtd
 
+  ifneq (,$(filter mtd_at25xxx,$(USEMODULE)))
+    USEMODULE += at25xxx
+  endif
+
   ifneq (,$(filter mtd_sdcard,$(USEMODULE)))
     USEMODULE += sdcard_spi
   endif

So all the user has to do is USEMODULE += mtd_at25xxx and then dependencies will be resolved automatically.

@benpicco
Copy link
Contributor

benpicco commented May 5, 2020

Please squash!

@JokoMLPA JokoMLPA force-pushed the feat/20200409__add_mtd_spi_eeprom branch from 253cda6 to 16d6ce5 Compare May 5, 2020 12:09
@maribu
Copy link
Member

maribu commented May 5, 2020

Nitpick: Add a colon to the commit message after the subsystem (drivers/at25xxx: add MTD wrapper for AT25XXX EEPROMs).

drivers/at25xxx: add mtd_wrapper as submodule

tests: add mtd_at25xxx test module for mtd wrapper

drivers/Makefile.dep: add at25xxx dep for mtd_at25xxx module
@JokoMLPA JokoMLPA force-pushed the feat/20200409__add_mtd_spi_eeprom branch from 16d6ce5 to 177a653 Compare May 5, 2020 12:41
@benpicco benpicco merged commit 8e11acc into RIOT-OS:master May 6, 2020
@benpicco benpicco deleted the feat/20200409__add_mtd_spi_eeprom branch May 6, 2020 13:56
@miri64 miri64 added this to the Release 2020.07 milestone Jun 24, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area: drivers Area: Device drivers Area: fs Area: File systems CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants