Skip to content

drivers: add driver for AT25xxx family of EEPROMs#11945

Merged
aabadie merged 2 commits intoRIOT-OS:masterfrom
benpicco:EEPROM-m95m01
Apr 7, 2020
Merged

drivers: add driver for AT25xxx family of EEPROMs#11945
aabadie merged 2 commits intoRIOT-OS:masterfrom
benpicco:EEPROM-m95m01

Conversation

@benpicco
Copy link
Copy Markdown
Contributor

@benpicco benpicco commented Jul 31, 2019

Contribution description

ST offers SPI based EEPROMs from the M95xxx family.
I've tested it with the M95M01 EEPROM. Other variants exist that differ in page size and address length, but follow the same command scheme.

Devices from other vendors that function in the same way include the families AT25xxx, 25AAxxx, 25LCxxx, CAT25xxx & BR25Sxxx.

I've decided to make both page size and address length a compile-time constant as it allows for compile-time optimizations and the I considered likelihood of having two EEPROMs of different type on the same board to be rather slim.

I can move those parameters to at25xxx_params_t if desired.

The EEPROM interface definition is blatantly stolen from #11929, but no periph_eeprom compatibility wrapper is provided yet.

Testing procedure

  • connect an EEPROM to the SPI bus
  • set AT25XXX_PARAM_… according do your board and EEPROM device
  • run tests/driver_at25xxx

Issues/PRs references

will be converted to the new EEPROM API once #12091 is finalized.

This provides an SPI Implementation analogous to the I2C EEPROM implementation in #11929

So we'll have

  • AT24xxx -> I2C EEPROM
  • AT25xxx -> SPI EEPROM

@benpicco benpicco added Area: drivers Area: Device drivers Type: new feature The issue requests / The PR implemements a new feature for RIOT labels Jul 31, 2019
@benpicco benpicco changed the title drivers: add driver for M95xxx family of EEPROMs drivers: add driver for AT25xxx family of EEPROMs Jul 31, 2019
@benpicco benpicco force-pushed the EEPROM-m95m01 branch 2 times, most recently from 612968d to 46e3d18 Compare August 1, 2019 08:30
@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 Aug 26, 2019
@maribu maribu self-requested a review August 27, 2019 09:54
Copy link
Copy Markdown
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

Looks very good to me. I have some inline-comments. But I guess we should wait if an agreement about a common EEPROM API can be reached within reasonable time, so that using external EEPROM devices becomes easier.

@maribu maribu added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines labels Aug 27, 2019
@benpicco benpicco added CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable State: waiting for other PR State: The PR requires another PR to be merged first labels Aug 28, 2019
@benpicco benpicco removed the State: waiting for other PR State: The PR requires another PR to be merged first label Dec 15, 2019
Copy link
Copy Markdown
Contributor

@fabian18 fabian18 left a comment

Choose a reason for hiding this comment

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

The code looks pretty slim and clean in my eyes. Have a look at inline comments.

@benpicco
Copy link
Copy Markdown
Contributor Author

Rebased to current master

@benpicco benpicco removed the CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable label Mar 4, 2020
@benpicco benpicco force-pushed the EEPROM-m95m01 branch 2 times, most recently from 3cd680e to ee0f483 Compare March 5, 2020 18:49
@fjmolinas
Copy link
Copy Markdown
Contributor

@benpicco could you post some test output?

@benpicco
Copy link
Copy Markdown
Contributor Author

benpicco commented Mar 31, 2020

2020-03-31 13:50:53,452 # AT25XXX EEPROM driver test application
2020-03-31 13:50:53,452 # 
2020-03-31 13:50:53,454 # EEPROM size: 128 kiB
2020-03-31 13:50:53,456 # EEPROM page size: 256 bytes
2020-03-31 13:50:53,459 # EEPROM address length: 24 bits
2020-03-31 13:50:53,459 # 
2020-03-31 13:50:53,462 # .Running test_normal_write test
2020-03-31 13:50:53,473 # .Running test_page_write test
2020-03-31 13:50:53,492 # .Running test_page_clear test
2020-03-31 13:50:53,509 # 
2020-03-31 13:50:53,510 # OK (3 tests)
2020-03-31 13:50:53,512 # All tests done.

Which reminds me - I should probably remove that additional debug output.

@benpicco benpicco removed the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 31, 2020
@benpicco
Copy link
Copy Markdown
Contributor Author

2020-03-31 13:54:08,546 # main(): This is RIOT! (Version: 2020.04-devel-1744-g06810-EEPROM-m95m01)
2020-03-31 13:54:08,550 # AT25XXX EEPROM driver test application
2020-03-31 13:54:08,550 # 
2020-03-31 13:54:08,552 # EEPROM size: 128 kiB
2020-03-31 13:54:08,554 # EEPROM page size: 256 bytes
2020-03-31 13:54:08,557 # EEPROM address length: 24 bits
2020-03-31 13:54:08,557 # 
2020-03-31 13:54:08,599 # ...
2020-03-31 13:54:08,600 # OK (3 tests)

@aabadie aabadie self-assigned this Apr 7, 2020
@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 7, 2020
@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Apr 7, 2020

Sorry, I just noticed one last thing regarding doxygen. Without this, the module would have appeared in the first level modules list.

benpicco added 2 commits April 7, 2020 12:31
This adds a driver for the ST M95xxx series SPI EEPROMs.
The driver has been tested with the M95M01 EEPROM, but should
work with other chips from that family.

SPI-EEPROMs from other vendors from the families AT25xxx, 25AAxxx,
25LCxxx, CAT25xxx & BR25Sxxx should also in the same way.
Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

ACK , please squash! (already squashed...)

@aabadie aabadie merged commit 067b324 into RIOT-OS:master Apr 7, 2020
@benpicco benpicco deleted the EEPROM-m95m01 branch April 7, 2020 11:20
@benpicco
Copy link
Copy Markdown
Contributor Author

benpicco commented Apr 7, 2020

Thank you for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines 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.

7 participants