Commit Graph

269 Commits (c98b0d0b03bd111d47cbe0ae8d6545103a42b9e1)

Author SHA1 Message Date
Kevin Bracey fc8e8f67c6 Deprecate wait/wait_ms APIs 2019-07-15 10:13:50 +03:00
Kevin Bracey 83b329cb71 RTOS API for bare metal
Provide partial RTOS API for bare metal builds - things that
can be done in a single threaded environment.

Allows more code to work in both RTOS and bare metal builds without
change, and in particular gives easy access to the ability to
efficiently wait for something occurring in interrupt.

Available in bare-metal:
* ThisThread
* osThreadFlagsSet to set flags on main thread (can be set from IRQ)
* EventFlags (can be set from IRQ)
* Semaphores (can be released from IRQ)
* Mutex (dummy implementation)

Not useful:
* ConditionVariable (could only be signalled from 2nd thread)
* RtosTimer (calls in a second thread context)
* Thread

Unimplemented:
* Mail, Queue, MemoryPool

Possible future work:
* ConditionVariableCS to act as IRQ signalled ConditionVariable
2019-07-15 10:13:50 +03:00
Kevin Bracey 607856ee9a Set unit tests to C++14
Adjust some non-C++11-compatible code that failed as a result.
2019-07-09 19:08:57 +03:00
Martin Kojtal 7059221817
Merge pull request #10925 from AnttiKauppila/buff_size_fix
Doubled ATHandler's BUFF_SIZE
2019-07-03 11:48:02 +01:00
Martin Kojtal ccb63d771e
Merge pull request #10857 from ARMmbed/feature-watchdog
Add Watchdog and ResetReason
2019-07-03 11:43:52 +01:00
Martin Kojtal 25fbd3956b Watchdog: remove VirtualWatchdog
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!).
2019-07-02 12:46:23 +01:00
Filip Jagodzinski 968e270b0b Watchdog: Fix unittests
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.
2019-07-02 12:46:23 +01:00
Martin Kojtal fd445a57cb Watchdog: remove config value for timeout, set it dynamically
Use start method to set timeout
2019-07-02 12:46:23 +01:00
Martin Kojtal 89c0ab793e VirtualWatchdog: process fail test expects 0 as reset - no ticker running 2019-07-02 12:46:23 +01:00
Filip Jagodzinski cc7a3dd677 Fix more unittest errors 2019-07-02 12:46:23 +01:00
Filip Jagodzinski 1c12f9b2b0 Fix unittest errors 2019-07-02 12:46:23 +01:00
Martin Kojtal 529f4a2a7e unittest: add virtualwatchdog stub 2019-07-02 12:46:23 +01:00
Martin Kojtal 33f8b35917 watchdog unittest: fix naming after refactor 2019-07-02 12:46:23 +01:00
Martin Kojtal 8231efc41c unittest: remove platform watchdog (moved to drivers) 2019-07-02 12:46:23 +01:00
Martin Kojtal 4549a22566 unittest: move watchdog files to drivers
Test VirtualWatchdog and Watchdog
2019-07-02 12:46:23 +01:00
Martin Kojtal 8bbba26842 unittest: rename watchdog to VirtualWatchdog 2019-07-02 12:46:23 +01:00
Martin Kojtal 2d77fccb09 Watchdog: update unittests 2019-07-02 12:46:23 +01:00
Antti Kauppila 369e2d53ff Fixed unittests 2019-07-02 10:17:06 +03:00
Martin Kojtal e40a76575f watchdog: fix copyright 2019-06-26 09:43:21 +01:00
Anna Bridge 15b5b5da23
Merge pull request #10694 from jarvte/set_authentication_type
Cellular: add method to set authentication type to CellularContext
2019-06-21 12:19:04 +01:00
Anna Bridge 6000724de6
Merge pull request #10703 from AnttiKauppila/optimisation
Cellular: Removed boilerplate code
2019-06-19 12:06:10 +01:00
Antti Kauppila 1ed338ef28 Valgrind & unittest fixes 2019-06-13 15:15:53 +03:00
Rajkumar Kanagaraj c41d80330e Fixed the unittest case failure 2019-06-03 16:32:14 +02:00
Rajkumar Kanagaraj dfe4b533c3 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-06-03 15:31:20 +02:00
Rajkumar Kanagaraj f672974c25 Incorporated the Reivew Comments 2019-06-03 15:24:04 +02:00
Rajkumar Kanagaraj 696638afeb Incorporated the Reivew Comments 2019-06-03 15:24:03 +02:00
Rajkumar Kanagaraj f94eb3cf13 Fix for the Ci build issue 2019-06-03 15:24:01 +02:00
Rajkumar Kanagaraj 47030cd23f 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-06-03 15:23:59 +02:00
Rajkumar Kanagaraj eb98c38226 Hw Watchdog UnitTest cases
-Added the unit test case for testing Hw watchdog
    -Added the supported stubs files
2019-06-03 15:23:59 +02:00
Martin Kojtal 523ad23a30
Merge pull request #10656 from jarvte/fix_cellularctx_destr
Cellular: AT_CellularContext disconnect in non-blocking mode
2019-05-31 12:35:59 +01:00
Antti Kauppila 83d62fbb9c astyle fixes 2019-05-29 20:13:22 +03:00
Antti Kauppila 77e8374058 Cellular: Removed boiler plate code 2019-05-29 16:17:08 +03:00
Teppo Järvelin 8922eeb014 Cellular: add method to set authentication type to CellularContext
Authentication type must be able to set. It was hard coded to CHAP.
Added unit tests for CellularContext to be able to add test for new function.
2019-05-29 09:46:15 +03:00
Kevin Bracey 2fbbd9d2ca Introduce Semaphore::acquire methods
Deprecate wait() in favour of acquire(), try_acquire(),
try_acquire_for() and try_acquire_until().

Brings Semaphore more into line with CMSIS-RTOS 2 (which uses "acquire"),
itself (as it has "release"), and other classes having "try", "try for"
and "try until".

Also steps away from vague "wait" term - the primary operation here is
to acquire the semaphore, and this will of course sleep.
2019-05-28 17:02:06 +03:00
Teppo Järvelin 779fb6defd Cellular: AT_CellularContext disconnect in non-blocking mode
Disconnect was supporting only blocking mode.
2019-05-27 12:23:29 +03:00
Teppo Järvelin d559338b3b Cellular: fix unit test valgrind warnings
Stub files did have some memory leaks and using
unintialized variables.
2019-05-21 14:23:21 +03:00
Martin Kojtal 26aa16ff39
Merge pull request #10557 from jarvte/fix_cellularcontext_init
Cellular: Initialize CellularContext member variables in correct class
2019-05-15 08:48:54 +01:00
Martin Kojtal 3ea1c56124
Merge pull request #10147 from kjbracey-arm/atomic_bitwise
Assembler atomics
2019-05-13 14:18:05 +01:00
Teppo Järvelin e4ee870b2e Cellular: Initialize CellularContext member variables in correct class
CellularContext member variables were initialized in inheriting class.
Now in base class where they should be initialized so that every inheriting
class don't have to init them.
2019-05-10 11:43:48 +03:00
Ari Parkkila 830b4234e9 Cellular: Fix setting of statemachine timeout 2019-05-09 04:42:30 -07:00
Martin Kojtal 6d1b7596e6
Merge pull request #10490 from mirelachirica/at_read_string_stop_tag_ut
Cellular: Added UT for case when read_string buff size hits middle of…
2019-04-29 13:31:35 +01:00
Kevin Bracey 87396e0bf6 Assembler atomics
Reimplement atomic code in inline assembly. This can improve
optimisation, and avoids potential architectural problems with using
LDREX/STREX intrinsics.

API further extended:
* Bitwise operations (fetch_and/fetch_or/fetch_xor)
* fetch_add and fetch_sub (like incr/decr, but returning old value -
  aligning with C++11)
* compare_exchange_weak
* Explicit memory order specification
* Basic freestanding template overloads for C++

This gives our existing C implementation essentially all the functionality
needed by C++11.

An actual Atomic<T> template based upon these C functions could follow.
2019-04-26 13:12:35 +03:00
Mirela Chirica 4d58e58b6b Cellular: Added UT for case when read_string buff size hits middle of stop tag 2019-04-26 12:48:26 +03:00
Teppo Järvelin 9d67a8b61c Cellular: send disconnect to correct ctx
Disconnect was sent to all CellularContext classes even it concerned
one specific context. Some disconnect events are still sent to all
context classes. These event are coming from network and ment for all
context classes or event did not specify cid.
2019-04-17 13:53:40 +03:00
Martin Kojtal 5e73a83332
Merge pull request #10391 from lorjala/unittesting-example
Update the writing example in unit testing README
2019-04-16 09:09:09 +01:00
Amanda Butler 1d1e78cac5
Edit README.md
Edit file for consistent person.
2019-04-15 15:56:26 -05:00
Lari-Matias Orjala a4308426da add a code independent unit test writing example 2019-04-12 15:28:01 +03:00
Ari Parkkila e0f8b2116a Cellular: Fix CellularStateMachine timeout configurations 2019-04-09 22:02:38 -07:00
Cruz Monrreal d1672d0200
Merge pull request #10341 from mirelachirica/check_urc_resp_stop_1
Cellular: Check for URC during AT response stop
2019-04-09 11:05:56 -05:00
Teppo Järvelin 2470a3611c Cellular: new state machine state and better info from stm
Added new state (signal quality) and more information about progress
so application/driver can build recovery logic.
2019-04-09 13:44:45 +03:00