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

Bring watchdog feature branch into master #10857

Merged
merged 176 commits into from
Jul 3, 2019
Merged

Bring watchdog feature branch into master #10857

merged 176 commits into from
Jul 3, 2019

Conversation

fkjagodzinski
Copy link
Member

@fkjagodzinski fkjagodzinski commented Jun 18, 2019

Description

Bring feature-watchdog into master.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[x] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@rajkan01 @donatieng @jamesbeyond @0xc0170

Release Notes

Adding new HAL API: watchdog and reset_reason
Adding new drivers: ResetReason and Watchdog

ResetReason - checking the cause of the reset
Watchdog - watchdog timer to reset the system

Steven Cartmell and others added 30 commits May 24, 2019 11:20
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.
fkjagodzinski and others added 9 commits July 2, 2019 12:46
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.
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!).
@fkjagodzinski
Copy link
Member Author

We had this docs PR up 17 months ago: https://github.com/ARMmbed/mbed-os-5-docs/pull/404/files
Can it be cleaned up and merged, or is it so out of date we need to start over?

Updated docs are in ARMmbed/mbed-os-5-docs#1099.

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 2, 2019

Started CI after the latest refactor

Please review meanwhile

@mbed-ci
Copy link

mbed-ci commented Jul 2, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 3, 2019

@bulislaw @donatieng Please review

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 3, 2019

Picked manually , release label back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.