[riot-notifications] [RIOT-OS/RIOT] drivers/mrd_spi_nor: derive capacity from JEDEC ID (#14084)

benpicco notifications at github.com
Thu May 14 22:12:13 CEST 2020


###  Contribution description

Flash chips are easily interchangeable, so don't force encoding the size in the board configuration.
It can be discovered at run-time by parsing the JEDEC ID.

Unfortunately the way the information is encoded there differs between vendors.

I took this formula from a previous project where we used flash chips from Adesto, Spansion, Micron and ISSI. 
This is not exhaustive, but it's a good start.


### Testing procedure

Set `ENABLE_DEBUG` to 1 in `mtd_spi_nor.c`, then remove the `.sector_count` from your board's `mtd_spi_nor_t` configuration.

The size printed should stay the same when running any flash based test (e.g. `tests/pkg_littlefs2`).


### Issues/PRs references

<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/14084

-- Commit Summary --

  * drivers/mrd_spi_nor: derive capacity from JEDEC ID
  * drivers/mrd_spi_nor: move printing of flash debug info

-- File Changes --

    M drivers/include/mtd_spi_nor.h (11)
    M drivers/mtd_spi_nor/mtd_spi_nor.c (49)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/14084.patch
https://github.com/RIOT-OS/RIOT/pull/14084.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/14084
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200514/de41881b/attachment-0001.htm>


More information about the notifications mailing list