Skip to content

[HACK] cpu/sam0_common: eth: delay init by 10ms for more stable Ethernet#21634

Merged
benpicco merged 1 commit intoRIOT-OS:masterfrom
benpicco:hack/sam0-eth/delay
Aug 4, 2025
Merged

[HACK] cpu/sam0_common: eth: delay init by 10ms for more stable Ethernet#21634
benpicco merged 1 commit intoRIOT-OS:masterfrom
benpicco:hack/sam0-eth/delay

Conversation

@benpicco
Copy link
Copy Markdown
Contributor

Contribution description

We often see hard faults right after boot, sometimes the Ethernet does not send / receive frames at all.

Adding a small delay before initializing the GMAC seems to fix it…

Testing procedure

Issues/PRs references

@benpicco benpicco requested review from dylad and keestux as code owners July 31, 2025 16:33
@github-actions github-actions bot added Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: cpu Area: CPU/MCU ports labels Jul 31, 2025
@benpicco benpicco added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Jul 31, 2025
@crasbe crasbe added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jul 31, 2025
@riot-ci
Copy link
Copy Markdown

riot-ci commented Jul 31, 2025

Murdock results

✔️ PASSED

54a7446 cpu/sam0_common: eth: delay init by 10ms for more stable Ethernet

Success Failures Total Runtime
10560 0 10560 12m:59s

Artifacts

@benpicco benpicco requested a review from maribu August 1, 2025 09:24
@maribu
Copy link
Copy Markdown
Member

maribu commented Aug 1, 2025

Is there maybe an errata or something?

Would be nice to get to the bottom of this and either have a better work around (as in faster) or at least know for sure why this is needed and refer to an errata in the comment above the hack.

Copy link
Copy Markdown
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

Let's hope we can have a better fix soonish. But having a workaround is definitely better than random hard faults every know and then.

@dylad
Copy link
Copy Markdown
Member

dylad commented Aug 1, 2025

I would be happy to have your setup to try to reproduce it on my side once I'm back on tracks.

@benpicco
Copy link
Copy Markdown
Contributor Author

benpicco commented Aug 4, 2025

I think I never saw the issue on same54-xpro, only on our custom boards 😕
Clock configuration is the same though, CPU runs at 120 MHz with EXTERNAL_OSC32_SOURCE set - applying #21631 does not make a difference.

@dylad
Copy link
Copy Markdown
Member

dylad commented Aug 4, 2025

I am not against the current hack. Just thought it would be be good to keep that in mind and find a proper fix later on.
But if I cannot reproduce with current hardware, I guess it will wait a bit 😄

@dylad dylad added this pull request to the merge queue Aug 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 4, 2025
@benpicco benpicco force-pushed the hack/sam0-eth/delay branch from b883853 to 54a7446 Compare August 4, 2025 14:32
@benpicco benpicco enabled auto-merge August 4, 2025 16:56
@benpicco benpicco added this pull request to the merge queue Aug 4, 2025
Merged via the queue into RIOT-OS:master with commit db345a7 Aug 4, 2025
25 checks passed
@benpicco benpicco deleted the hack/sam0-eth/delay branch August 5, 2025 11:22
@benpicco
Copy link
Copy Markdown
Contributor Author

Now this causes a weird hang on same54-xpro when combined with at86rf215 - wtf?!

@dylad
Copy link
Copy Markdown
Member

dylad commented Oct 31, 2025

Do we need to hack the hack then ? 🤯

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

None yet

Development

Successfully merging this pull request may close these issues.

5 participants