Commit Graph

25565 Commits (mbed-os-5.13)

Author SHA1 Message Date
Martin Kojtal 3f96afdf4d Remove watchdog manager
Use VirtualWatchdog instead
2019-07-11 11:55:20 +01:00
Martin Kojtal d7cba43afd VirtualWatchdog: software watchdog
Refactor old Watchdog (it was not a driver) to become VirtualWatchdog.
This is software virtual watchdog. This it the primary used watchdog in user application.

VirtualWatchdog: has-a watchdog. Initializes hw watchdog - start it when first used, stops it when there is no more VirtualWatchdog in the system -
list is empty.

Adding also check to watchdog to make sure there is only one in the system - runtime error if multiple objects created to already
running hw watchdog.
2019-07-11 11:55:20 +01:00
Martin Kojtal cd8ac1e132 Watchdog: refactor driver
Watchdog is hardware driver. It interacts with HAL - provides wrapper to interact with the peripheral.

Provides basic functionality: start/stop, get timeout/max timeout.
It is automatically kicked by a timer, according to the timeout set in ctor.
2019-07-11 11:55:20 +01:00
Amanda Butler 1869a1d4a7 Edit ResetReason.h
Edit file for active voice, complete sentences and grammar.
2019-07-11 11:55:19 +01:00
Amanda Butler aa9941805c Edit Watchdog.h
Edit file, mostly for active voice, consistent abbreviations, grammar and spelling.
2019-07-11 11:55:19 +01:00
Amanda Butler 5558539d55 Edit watchdog_api.h
Edit file, mostly for active voice, consistent tense and international spelling.
2019-07-11 11:55:19 +01:00
Amanda Butler 68f132f36d Edit reset_reason_api.h
Edit file, mostly for correct grammar.
2019-07-11 11:55:19 +01:00
Martin Kojtal 41434d8b08 watchdog hal: remove space 2019-07-11 11:55:19 +01:00
Martin Kojtal 92661f63a6 watchdog: fix astyle issue
Missing a space after group and before license
2019-07-11 11:55:19 +01:00
Filip Jagodzinski b50bb226fb HAL: Watchdog: Update the header file
Minor doxygen fixes.
2019-07-11 11:55:19 +01:00
Filip Jagodzinski df372fd19e ResetReason: Update the header file
Minor doxygen fixes.
2019-07-11 11:55:18 +01:00
Filip Jagodzinski 8c6d0cf9cf HAL: ResetReason: Update the header file
Add defined & undefined behavior.
Minor doxygen fixes.
2019-07-11 11:55:18 +01:00
Martin Kojtal 2a26e1af4b watchdog: fix copyright 2019-07-11 11:55:18 +01:00
Filip Jagodzinski fb55409150 HAL: Watchdog: Update the header file
Add a SPDX license identifier.
Add defined & undefined behavior.
2019-07-11 11:55:18 +01:00
Filip Jagodzinski 33ef09b3df Test: watchdog_mgr: Remove dead code 2019-07-11 11:55:18 +01:00
Filip Jagodzinski f52eca9ebe Test: update reset_reason driver test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.

Use a SERIAL_FLUSH_TIME_MS value consistent with other tests.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski 4180fcc045 Test: update HAL watchdog-timing test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski 5d76717323 Test: update HAL watchdog-reset test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.
Remove explicit calls to sleep.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski e55fff9060 Test: update HAL watchdog test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski d585e1bba6 Test: update HAL reset_reason test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski 3a3bb4f90d Tests: Watchdog: Update timing test
Skip test cases with unsupported timeout values.
2019-07-11 11:55:17 +01:00
Filip Jagodzinski d800cc315c Tests: Watchdog: Decrease default timeout to 100 ms 2019-07-11 11:55:16 +01:00
Filip Jagodzinski f163a4c8d4 Tests: Watchdog: Update test case teardown
Added a mechanism which will prevent an initialised watchdog from
resetting the device during final greentea communication.
This allows testing watchdog timeouts as short as 50 ms.
2019-07-11 11:55:16 +01:00
Filip Jagodzinski 715369d6d1 Tests: Update Watchdog Manager test
Update the watchdog timing requirements:
1. The watchdog should trigger at, or after the timeout value.
2. The watchdog should trigger before twice the timeout value.
2019-07-11 11:55:16 +01:00
Filip Jagodzinski 51835f005b Tests: ResetReason: Use the HAL watchdog API
The Watchdog driver has been updated making this test incompatible
with the new API. Use HAL API instead.
2019-07-11 11:55:16 +01:00
Filip Jagodzinski 30319b8464 Tests: Watchdog: Add Watchdog Manager tests 2019-07-11 11:55:16 +01:00
Filip Jagodzinski 5bf6842efc Tests: Watchdog: Remove outdated driver tests
The Watchdog driver has been updated making these tests incompatible
with the new API. The Watchdog driver functionality is tested with the
unit tests located in UNITTESTS/drivers/Watchdog/ .
2019-07-11 11:55:16 +01:00
Rajkumar Kanagaraj de3b843bfb Fix for Problem copying the instance from BSS to stack
-Created global instance of either LowPowerTicker or Ticker
2019-07-11 11:55:15 +01:00
Rajkumar Kanagaraj 11b09a489a Fixed the unittest case failure 2019-07-11 11:55:15 +01:00
Rajkumar Kanagaraj 75cc3c84cc Added the ticker support
-Modified the device dont have support of lp ticker will ticker for watchdog callback register
2019-07-11 11:55:15 +01:00
Rajkumar Kanagaraj 5150b37aea Update Watchdog
- Changed the process into static method
 - used the singletonptr for creating the low power ticker instance
 - Added the mbed stub into cmake build for cellularnonipsocket,loramacrypto
2019-07-11 11:55:15 +01:00
Rajkumar Kanagaraj 0a5ca29273 Incorporated the Reivew Comments 2019-07-11 11:55:15 +01:00
Rajkumar Kanagaraj 7cdbc3dccf Incorporated the Reivew Comments 2019-07-11 11:55:15 +01:00
Rajkumar Kanagaraj 2959775ff0 fix for astyle 2019-07-11 11:55:14 +01:00
Rajkumar Kanagaraj 19e22a0e3c fix for spell check and header file 2019-07-11 11:55:14 +01:00
Rajkumar Kanagaraj a644886d5d Fix for the Ci build issue 2019-07-11 11:55:14 +01:00
Rajkumar Kanagaraj 17be727821 fix: Fixing rebased created bugs 2019-07-11 11:55:14 +01:00
Rajkumar Kanagaraj 16b340ea60 SW watchdog unittest cases
-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
2019-07-11 11:55:14 +01:00
Rajkumar Kanagaraj 563e3a328a Hw Watchdog UnitTest cases
-Added the unit test case for testing Hw watchdog
    -Added the supported stubs files
2019-07-11 11:55:14 +01:00
Rajkumar Kanagaraj 89e2124d4a HW Watchdog and SW watchdog interface
- Added Hw watchdog periodic kick calls software watchdog is_alive check
2019-07-11 11:55:14 +01:00
Rajkumar Kanagaraj 02b319f3c7 Add SW Watchdog
-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
2019-07-11 11:55:13 +01:00
Rajkumar Kanagaraj 1ab851bacf Add HwWatchdog
- 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
2019-07-11 11:55:13 +01:00
Rajkumar Kanagaraj bb9ccb8f47 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
2019-07-11 11:55:13 +01:00
Filip Jagodzinski b850d70d75 Remove RESET_REASON from MCU_NRF52840 2019-07-11 11:55:13 +01:00
Rajkumar Kanagaraj fc5de6f128 Removed RESET_REASON for NRF51_DK board 2019-07-11 11:55:13 +01:00
Rajkumar Kanagaraj b2f03b2155 Added the SPDX identifier 2019-07-11 11:55:12 +01:00
Rajkumar Kanagaraj 361c787abc Trailing space issue fix 2019-07-11 11:55:12 +01:00
Rajkumar Kanagaraj 3f20350b04 fix for Jenkin build issue 2019-07-11 11:55:12 +01:00
Rajkumar Kanagaraj 7d941950d3 Removed RESET_REASON for NRF52832,NRF52840 family and Removed WATCHDOG for H743ZI board 2019-07-11 11:55:12 +01:00
Rajkumar Kanagaraj 6d501401f3 Revert "fix for build failure issues"
This reverts commit 3ce1d4940cb7fd9d74ca2be75ed08b76854ff534.
2019-07-11 11:55:12 +01:00