Skip to content

Conversation

@benpicco
Copy link
Contributor

@benpicco benpicco commented Sep 2, 2020

Contribution description

This 'fixes' what I thought would be the cause for #14929

  • wait for commands to be done before proceeding
  • disable cache to avoid triggering NVM Read Corruption errata

But this just happens to push the issue away temporariely.
If you replace the interrupt based wait_for_cmd() with a polling

static inline void wait_for_cmd(void)
{
   while (_NVMCTRL->INTFLAG.reg == 0) {}
    _NVMCTRL->INTFLAG.reg = 0xff;
}

or use a different C library or compiler, the bug is back again.

Testing procedure

Flash tests/mtd_flashpage on same54-xpro.
The test will now succeed.
But this is a fluke: try again with PICOLIBC=1 and it will again fail.
(The test would succeed on master with PICOLIBC=1, but fail with newlib. The C library is entirely unrelated to the test.)

Issues/PRs references

attempts to fix #14929 (but no sucess so far)

@benpicco benpicco requested a review from dylad September 2, 2020 20:48
@benpicco benpicco added Community: help wanted The contributors require help from other members of the community State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Sep 2, 2020
@benpicco benpicco requested a review from jue89 September 30, 2020 21:15
@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 21, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
@benpicco benpicco requested a review from fabian18 July 10, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community: help wanted The contributors require help from other members of the community State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cpu/sam0: flashpage write / read cycle produces different results depending on code layout in flash

2 participants