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 interrupts while writing #15965

Merged

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Feb 9, 2021

Contribution description

This disabled interrupts while write operations on the internal flash are ongoing.
@firas-hamdi discovered that firmware updates over 802.15.4 with 1024 byte CoAP block size would sometimes (~10% of all updates) trigger a hard fault caused by an Imprecise data access (IMPRECISERR) on samd51.

I failed to re-create this on same54-xpro over Ethernet, so I was wondering if the increased interrupt load due to 6lo fragmentation might have something to do with it.

Testing procedure

I'll try to come up with a setup that triggers this via GPIO interrupts.

Issues/PRs references

@benpicco benpicco requested a review from dylad February 9, 2021 16:16
@benpicco benpicco added Area: cpu Area: CPU/MCU ports Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) labels Feb 9, 2021
@benpicco benpicco added this to Backlog / Proposals in RIOT Sprint Day via automation Feb 16, 2021
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 23, 2021
@benpicco benpicco requested a review from jue89 February 23, 2021 09:43
@benpicco benpicco added this to the Release 2021.04 milestone Apr 13, 2021
@kaspar030
Copy link
Contributor

What's the state here? Could someone take a look?

@dylad
Copy link
Member

dylad commented Apr 26, 2021

Do we have a way to reproduce this ? I don't think the flashpage driver is faulty here, maybe the problem is related to highspeed bus.
Is it also reproducible on CM0+ ?

@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
@benpicco
Copy link
Contributor Author

benpicco commented Feb 9, 2023

So far this only happened on SAM D5x/E5x but it's pretty reliable.
E.g. SUIT update is not possible without this (it will hard fault at some random point).

@Teufelchen1
Copy link
Contributor

@benpicco is this still happening?

@benpicco
Copy link
Contributor Author

Yes, we've been including this in our downstream branch ever since.

Copy link
Contributor

@Teufelchen1 Teufelchen1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested through deployment according to @benpicco

@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 30, 2024
@benpicco
Copy link
Contributor Author

benpicco commented Jan 30, 2024

Always happy when I get to shorten this list 😃

@benpicco benpicco force-pushed the cpu/sam0_common/flashpage_irq_disable branch from bb9d5cf to a21acf0 Compare January 30, 2024 17:48
@github-actions github-actions bot added the Platform: ARM Platform: This PR/issue effects ARM-based platforms label Jan 30, 2024
@riot-ci
Copy link

riot-ci commented Jan 30, 2024

Murdock results

✔️ PASSED

a21acf0 cpu/sam0_common: flashpage: disable interrupts while writing

Success Failures Total Runtime
8629 0 8629 11m:27s

Artifacts

@Teufelchen1 Teufelchen1 added this pull request to the merge queue Jan 31, 2024
Merged via the queue into RIOT-OS:master with commit cec06d5 Jan 31, 2024
25 checks passed
@benpicco benpicco deleted the cpu/sam0_common/flashpage_irq_disable branch January 31, 2024 12:36
@MrKevinWeiss MrKevinWeiss added this to the Release 2024.04 milestone Apr 30, 2024
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 Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
RIOT Sprint Day
  
Backlog / Proposals
Development

Successfully merging this pull request may close these issues.

None yet

6 participants