-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Bring watchdog feature branch into master #10857
Conversation
HAL watchdog functionality will be implemented as two separate APIs. The reset reason API allows a user to detect the last system reset reason to identify if a Watchdog was triggered. The Watchdog API allows configuring and updating Watchdog timers on all boards. This commit defines the headers.
- Add preprocessor guard to watchdog api that errors if the reset reason api is not also implemented - Add RESET_REASON and WATCHDOG to K64F targets.json - Add watchdog reference implementation
- Fix typo in module comment - Redefine the default system behaviour in sleep mode - Guard K64F enableWait flag - Remove bit shifts from reset reason enum
- Change API to match C++ API throughout drivers - Amend HAL API documentation to be more specific
WDOG_Disable will suspend the watchdog until a reset is triggered instead of stopping it altogether. Deinit will disable it until it is reinitialized.
Limit MAX_TIMEOUT_MS to UINT32_MAX. Improve MAX_TIMEOUT_MS handling. Fix hal_watchdog_get_platform_features() returning .max_timeout = 0xfffffff8 instead of 0xffffffff.
Fix WATCHDOG_STATUS_INVALID_ARGUMENT for timeout values from 1 ms to 407 ms (fix inability to set prescaler bits to zero). Fix timeout <-> IWDG registers conversions. Fix read & write access to IWDG_PR and IWDG_RLR registers. Fix LSI RC frequency setting. Limit MAX_TIMEOUT_MS to UINT32_MAX.
Added a missing wait for the WCT window end. Without it, consecutive init() or stop() calls were ignored.
Relax time measurement margins for UBLOX_EVK_ODIN_W2.
Watchdog::stop() is called in this test. If the target does not support stopping the watchdog this case needs to be skipped. Also improve handling ignored test cases.
Use start method to set timeout
No config, neither additional parameter - the first instance of the class initalizes the peripheral.
Compare get_timeout against the last timeout successfully set. Merge most of the test cases into one. Do not rely on the tests execution order. Fix the watchdog_api_stub to keep timeout value set by init function.
We will provide documentation how to create your own VirtualWatchdog. It's simple, create timeout and watchdog objects. This class brought lot of discussion and questions. After our refactor we made this class just a linked list of objects - something tickers can do as well (they already have linked list) and handling hw should be done via Watchdog due to the limitations (timeout can be set only once per app!).
Updated docs are in ARMmbed/mbed-os-5-docs#1099. |
Started CI after the latest refactor Please review meanwhile |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
@bulislaw @donatieng Please review |
Picked manually , release label back. |
Description
Bring
feature-watchdog
intomaster
.Pull request type
Reviewers
@rajkan01 @donatieng @jamesbeyond @0xc0170
Release Notes
Adding new HAL API:
watchdog
andreset_reason
Adding new drivers:
ResetReason
andWatchdog
ResetReason
- checking the cause of the resetWatchdog
- watchdog timer to reset the system