Skip to content

Conversation

@rajkan01
Copy link
Contributor

@rajkan01 rajkan01 commented Jan 3, 2019

Description

Watchdog refactoring to multithreaded thread.
-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

Pull request type

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

Reviewers

@mbed-os-hal

@rajkan01 rajkan01 changed the title Feature watchdog v1 - Work in Progress Watchdog refactoring - Work in Progress Jan 3, 2019
@ghost
Copy link

ghost commented Jan 3, 2019

@ARMmbed/mbed-os-hal

@ciarmcom ciarmcom requested review from a team January 3, 2019 16:00
@ciarmcom
Copy link
Member

ciarmcom commented Jan 3, 2019

@rajkan01, thank you for your changes.
@ARMmbed/mbed-os-hal @ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@cmonr
Copy link
Contributor

cmonr commented Jan 3, 2019

@rajkan01 Please take a look at the travis-ci/events failure.

Copy link
Contributor

@donatieng donatieng left a 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.

@rajkan01 rajkan01 force-pushed the feature-watchdog-v1 branch from 5eb9f99 to 50c9315 Compare January 9, 2019 18:01
@rajkan01 rajkan01 force-pushed the feature-watchdog-v1 branch 5 times, most recently from 6baae33 to e4a0619 Compare January 11, 2019 12:31
@rajkan01 rajkan01 force-pushed the feature-watchdog-v1 branch from e4a0619 to 7423433 Compare January 16, 2019 18:07
bulislaw and others added 18 commits March 7, 2019 18:23
-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
@rajkan01 rajkan01 force-pushed the feature-watchdog-v1 branch from 88d84bc to a628339 Compare March 7, 2019 18:33
@rajkan01 rajkan01 changed the base branch from feature-watchdog to master March 7, 2019 18:34
@0xc0170
Copy link
Contributor

0xc0170 commented Mar 8, 2019

As it was recently rebased, it might still need one more - conflicts above.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 8, 2019

reviewing the history, this PR includes commits from master. needs clean-up

@rajkan01
Copy link
Contributor Author

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
#10066 with only feature-watchdog-v1 branch changes cherry picked related to watchdog

@cmonr
Copy link
Contributor

cmonr commented Mar 20, 2019

Closing since from what I understand

  1. the watchdog rebase PR has already been done and pushed, and
  2. Feature watchdog v1 rb #10066 takes care of the refactor

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.