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

Merged
merged 2 commits into from
Dec 15, 2024

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
@benpicco benpicco requested review from maribu and fabian18 November 26, 2024 14:51
@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.

@maribu maribu added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Dec 15, 2024
@riot-ci
Copy link

riot-ci commented Dec 15, 2024

Murdock results

✔️ PASSED

fd49d16 cpu/sam0_common: flashpage: don't disable interruipts while writing

Success Failures Total Runtime
10249 0 10249 15m:31s

Artifacts

@dylad dylad added this pull request to the merge queue Dec 15, 2024
Merged via the queue into RIOT-OS:master with commit 808827c Dec 15, 2024
27 checks passed
@benpicco benpicco deleted the cpu/sam0-flashpage/cachedis branch December 15, 2024 16:46
@MrKevinWeiss MrKevinWeiss added this to the Release 2025.01 milestone Jan 20, 2025
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 CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants