Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

cpu/sam0_common: flashpage: disable cache while writing #21043

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

benpicco
Copy link
Contributor

Contribution description

From errata 2.14.1:

NVM reads could be corrupted when mixing NVM reads with Page Buffer writes.

Workaround

Disable cache lines before writing to the Page Buffer when executing from NVM or reading
data from NVM while writing to the Page Buffer. Cache lines are disabled by writing a one to
CTRLA.CACHEDIS0 and CTRLA.CACHEDIS1.

Testing procedure

I ran examples/suit_update on same54-xpro.
This would previously crash when not disabling the interrupts.

I also tested this on samr34-xpro to ensure no regressions on saml21.

samd21 never needed the disabled interrupts in the first place.

Issues/PRs references

@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Nov 26, 2024
@dylad
Copy link
Member

dylad commented Nov 26, 2024

Does this PR also affect SAML1X ?

@fabian18
Copy link
Contributor

You told me about the errata and I would be happy to have the interrupts enabled again.
It does not solve #19928, but we should have this in if you say it fixes something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports Platform: ARM Platform: This PR/issue effects ARM-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants