-
Notifications
You must be signed in to change notification settings - Fork 3k
Watchdog refactoring #9243
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
Watchdog refactoring #9243
Conversation
|
@ARMmbed/mbed-os-hal |
|
@rajkan01, thank you for your changes. |
|
@rajkan01 Please take a look at the |
donatieng
left a comment
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.
Thanks @rajkan01 !
Additionally to my comments I feel some of this code could be made simpler. Atomics could be used to deal with _bitmask and _kick_bitmask.
5eb9f99 to
50c9315
Compare
6baae33 to
e4a0619
Compare
e4a0619 to
7423433
Compare
-Added API to register muliple threads to watchdog drivers -Watchdog timeout reconfigures everytime whenever new register thread with longer timeout period -New APIs for watchdog wd_register(const osThreadId_t tid, const uint32_t timeout) to register to watchdog wd_unregister(const osThreadId_t tid) to unregister to watchdog kick(const osThreadId_t tid) to refresh the watchdog
- mbed_watchdog_mgr has interface name mbed_wdog_manager_start(),mbed_wdog_manager_stop(),mbed_wdog_manager_kick()
- HwWatchdog is going to attach with LowPowerTIcker for periodic callback functionality
- mbed_wdog_manager_start() will either get start either by BL/RTOS Aps,it reads the timeout value specified via macro and macro gets defined in target.json file.
- mbed_wdog_manager_start() internally configure below HAL hw watchdog with timeout specified via target.json
- mbed_wdog_manager_start() internally divide the timeout(specified in target.json) by the 2 and attach LowPowerTicker with periodic callback of hw_kick()
- mbed_wdog_manager_start() internally create one instance of sw watchdog class,to access the static list data structure of sw watchdog class
- mbed_wdog_manager_kick() function periodically get called and refresh the hw watchdog to avoid watchdog reset
- converted C++ code into C based APIs
- added boolean to control watchdog start and stop
- Added detach from ticker on stop API
-SW watchdog has interface name start(),stop(),kick() Sw watchdog internally has static list and shared across multiple instance of SW watchdog
- Sw watchdog initialize timeout value,unique string via constructor whenever threads created sw watchdog object
-Threads make sure pass proper timeout value,Unique string while creating the instance.
-start() called by components(BLE,WIFI etc.,),it adds the entry into static list with few details current count ,etc.,
-kick() called by registered components(BLE,WIFI etc.) to reset current count to zero.
-is_alive - interface API to mbed_watchdog_manager
-implementation optimization
- Added Hw watchdog periodic kick calls software watchdog is_alive check
-Added the unit test case for testing Hw watchdog
-Added the supported stubs files
-Added the mock class function to mock mbed_assert_internal -Added the unit test case to test start,kick,stop -Modified the interface api name from is_alive to process -added the unit test cases for process
88d84bc to
a628339
Compare
|
As it was recently rebased, it might still need one more - conflicts above. |
|
reviewing the history, this PR includes commits from master. needs clean-up |
|
After multiple rebase with master and origin/feature-watchdog it leads to complete cleanup by go through all commit which is complex so created the new pull request |
|
Closing since from what I understand
|
Description
Pull request type
Reviewers
@mbed-os-hal