-
Notifications
You must be signed in to change notification settings - Fork 3k
Add workaround for STM32F4 hardfault in sleep mode #12662
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about the
WFE()
in below lines ? do we need them to be patched as well?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mbed OS doesn't use that mode, so not required for us - would just be an unnecessary image size increase. But if the change is being upstreamed to the HAL, seems like you'd want them there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the upstream comes to our repo, this will be updated once driver is updated.
@jeromecoutant We fine as it is here now, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure that ST driver team will accept this change :-(
But as it solves some mbed issues, we are ok to merge this wrkaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better alternative, given the errata description? That is the most universally-feasible workaround in your errata sheet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As soon as confirmed, I'll merge this. It would be good to have this in today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. If RELEASE build is used in CI as well, then the same loading mechanism will apply (thru debug port) and the same issue may arise. So we can't put the proposed compilation switches - please forget my comment and feel free to proceed ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a separate argument that something should be done to get that debug/sleep control register back into its default state anyway, otherwise the just-flashed release build in test is not representative of the deployed image in terms of sleep, whether that comes down to power measurements, timing, hitting bugs like this. Arguably release builds should be manually putting that back to its zero state. Flasher should also have taken more care...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We think it's the flasher role to do so. If you power cycle the product, the release build will work just fine ... I'm not sure we should add an explicit reset of those bits, because even the release build should be debugged and in this case the flasher or debugger (or flasher of the debugger) should set the bits.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know bigger systems like Linux are intensely paranoid about chip state post-bootloader, so tend not to rely on any default state. But we can't really afford the ROM space for that level of paranoia in an embedded image.
And yes, in this specific case, I see your point that a debugger may obviously have deliberately set those bits before running us, for a good reason, so an image should not reset any bits there, regardless of the general "trust default state or not" philosphy.