Repository navigation
Conversation
On a CPU fault or kernel panic, Zephyr's default handler logs and halts, but the HRTIM keeps running: the gates keep switching at their last duty cycle with no software in control. This was observed on the bench with a fault in the critical task while the power stage was on. The HRTIM driver now provides k_sys_fatal_error_handler, which disables every HRTIM output (TA1..TF2) before flushing the logs and halting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks
This was referenced Nov 25, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On a CPU fault or kernel panic, Zephyr's default
k_sys_fatal_error_handlerlogs and halts. The HRTIM keeps running, so the gates keep switching at their last duty cycle with no software in control.This PR has the HRTIM driver provide
k_sys_fatal_error_handler. It disables every HRTIM output (TA1..TF2), then flushes the logs (LOG_PANIC) and halts.Context
On the bench, a fault in the critical task (an allocation from interrupt context) stopped the board while the power stage was supplied, and nothing was left to stop the HRTIM.
Notes for reviewers
k_sys_fatal_error_handlerwould now get a duplicate symbol at link time. No module or example in Core defines one today. If you want applications to be able to override it, we could make this one weak, or call a weakhrtim_fatal_hookinstead.Test
spin@1_2_0/twist_v1_4_2.Before marking ready
🤖 Generated with Claude Code