RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

mtd: refactor mtd struct for better erase support

Open vincent-d opened this issue 7 years ago • 12 comments

Contribution description

As said in #8400, erase in mtd spi nor is not working correctly as on some flash, the erase size might be smaller than the sector size.

Thie PR adds min_erase_size and sector_size fields in the mtd_dev_t to fix that.

On spi flashes supporting different erase size, the config can be (for instance a flash with 64KB blocks and 4KB erasable sectors): sector_size = 65536 min_erase_size = 4096

Issues/PRs references

This is based on #8399 and #8400

vincent-d avatar Jan 23 '18 11:01 vincent-d

Rebased since #8399 and #8400 have been merged

vincent-d avatar Feb 26 '18 15:02 vincent-d

Rebased

vincent-d avatar Mar 05 '18 16:03 vincent-d

Rebased.

Could someone take a look at this one?

vincent-d avatar May 14 '18 13:05 vincent-d

@gebart can you review or shall we look for someone new?

tcschmidt avatar May 25 '18 20:05 tcschmidt

@gebart can you review or shall we look for a new reviewer?

tcschmidt avatar May 25 '18 20:05 tcschmidt

It seems we are not that far from merging this PR. Maybe @smlng can help reviewing and testing this PR since he reviewed #8239 (littlefs). For FatFS, let's also ping @MichelRottleuthner and again @smlng: they were both involved in #7104 and #6072.

aabadie avatar Jan 04 '19 13:01 aabadie

Maybe also @x3ro can easily help here?

tcschmidt avatar Jan 04 '19 13:01 tcschmidt

Interesting, I'll see if I can find time to look at this during the next week.

x3ro avatar Jan 04 '19 14:01 x3ro

Hmm, I understand the need for min_erase_size but can't seem to figure out why it was necessary to replace pages_per_sector with sector_size. I feel like I'm missing something obvious. Can you help out, @vincent-d?

x3ro avatar Jan 08 '19 21:01 x3ro

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

stale[bot] avatar Jan 17 '20 15:01 stale[bot]

@vincent-d Could you give this a rebase? I can give this a review one of these days.

bergzand avatar Feb 13 '20 09:02 bergzand

Since this PR has been stale for several years, I'll convert it to a draft.

Please feel free to remove the draft state if anyone wants to pick this up again.

mguetschow avatar Jun 11 '24 09:06 mguetschow