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

Feature: STM32 watchdog timer control #1882

Merged
merged 47 commits into from
Aug 6, 2024
Merged

Conversation

dragonmux
Copy link
Member

@dragonmux dragonmux commented Jul 29, 2024

Detailed description

In this PR we sort out support for and deal with WDTs support across the whole STM32 range supported. Included in this are fixes for issues such as bad Flash maps on some families, which were necessary to properly deal with differences in part addresses such as on the STM32L1 family where the address the DBGMCU is at changes based on which part it is in the family.

The approach used here needs work for handling what happens if a user attaches into a part, changes the code in Flash on the part, runs that new code which then modifies certain DBGMCU registers such as to set up tracing, and then detaches. Even with this limitation/bug in place, this greatly improves the state of debug across these families, by properly handling the WDTs during processor halt, and by properly setting up handling for WFI and WFE instructions encountered while debugging, solving a very long-standing problem with STM32 support.

This PR has been tested as much as possible on STM32F1/GD32F1, GD32VF1, STM32F4, STM32H5, STM32MP15 and STM32H7 parts, but we do not have the parts to test this on other series. We've done our best not to break anything however, so the chances of a regression are low. That said, user testing by people who do have parts, and preferably by people using the WDTs or WFI/WFE instructions, would be much appreciated.

Your checklist for this pull request

Closing issues

Fixes #117 (at least for STM32; LPC parts are generally already ok; i.MXRT is already taken care of; other parts are unknowns, but should probably be their own separate PRs and issues)
Also fixes #612

@dragonmux dragonmux added Bug Confirmed bug Enhancement General project improvement User Testing Needed Looking for user testing reports labels Jul 29, 2024
@dragonmux dragonmux added this to the v2.0 release milestone Jul 29, 2024
@dragonmux dragonmux requested a review from esden July 29, 2024 21:35
@dragonmux dragonmux linked an issue Jul 29, 2024 that may be closed by this pull request
@dragonmux dragonmux force-pushed the feature/stm32-watchdog-control branch from 8701675 to cd8441d Compare July 29, 2024 21:44
@dragonmux dragonmux force-pushed the feature/stm32-watchdog-control branch 4 times, most recently from f986653 to 592c070 Compare August 5, 2024 09:22
…en debug halted, and configuring processor debug to work through WFI/WFE
…ntation, and handling for the GD32VF103's DBGMCU
…and configuring processor debug to work through WFI/WFE
@dragonmux dragonmux force-pushed the feature/stm32-watchdog-control branch from 2675a6d to 9c46078 Compare August 6, 2024 18:02
…documentation block to bring it into line with the rest of the code base
…1 parts to simplify map setup and DBGMCU handling
…th WFI/WFE debugging and freezing the WDTs while in debug halt
… as these things can be achieved with the options bytes command
…e correct location to get a valid identification on the part
@dragonmux dragonmux force-pushed the feature/stm32-watchdog-control branch from 9c46078 to c4785d0 Compare August 6, 2024 18:03
Copy link
Member

@esden esden left a comment

Choose a reason for hiding this comment

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

LGTM! Merging so that it gets more testing from users. It should improve the status quo.

@esden esden merged commit c4785d0 into main Aug 6, 2024
26 checks passed
@dragonmux dragonmux deleted the feature/stm32-watchdog-control branch August 6, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed bug Enhancement General project improvement User Testing Needed Looking for user testing reports
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Leave devices in better state after probe and after debug session Watchdog not paused when debugging
2 participants