Commit Graph

45 Commits (632b2f1660b4aa51deda271f4dc8ef0b5a9695af)

Author SHA1 Message Date
Jimmy Brisson 84f2d089f4 Merge pull request #5147 from 0xc0170/fix_deepsleep_tests
Test: deepsleep() API replacement
2017-10-13 09:19:41 -05:00
Russ Butler 77dd420509 Increase ticker test time for slower devices
Increase the hal ticker test time from 30s to 60s to prevent
a timeout from occurring on slower devices, such as the nrf51.
2017-10-05 11:57:35 -05:00
Russ Butler ec55b82acf Update ticker to map closely to hardware
Allow tickers to specify their native frequency and number of bits.
This allows the conversion to happen in common code rather than in
each vendor's implementation.
2017-10-05 11:57:12 -05:00
Martin Kojtal b30c622522 Test: deepsleep() API replacement
Use sleep() as entry function + check to be certain we
are entering deepsleep when required by test (should be allowed)
2017-10-05 16:43:57 +01:00
Russ Butler 47b0f31d32 Remove direct use of us and lp ticker from tests
Remove the direct use of the microsecond and low power ticker from
the tests. This enforces that sleep mode is properly locked when
using timers. Furthermore, this prepares the codebase for new ticker
changes which allow differing clock frequencies and timer bit widths.
2017-09-13 20:11:39 -05:00
Shrikant Tudavekar 1cb41e9715 use default macro for armcc 2017-09-12 01:00:45 -05:00
Shrikant Tudavekar 45202df55e gaurd thumb instruction for amrc6 2017-09-11 20:09:43 -05:00
Russ Butler f746fc5bac Allow lp_ticker test to coexist with TimerEvents
The lp_ticker test overrides the default ticker handler for the
low power ticker. This stops all other low power TimerEvents in the
system, including the ones for tickless, from getting called. Because
of this devices with tickless enabled malfunction during this test.

This patch fixes this problem by passing all lp ticker events it did
not trigger on to the TimerEvent irq handler.
2017-09-10 17:06:46 -05:00
Russ Butler d9aff6f0dd Prevent deeps sleep in regular sleep test case
Lock deep sleep before calling sleep to prevent the device from
entering deep sleep mode.
2017-09-09 20:43:35 -05:00
Martin Kojtal deb1febb8b sleep manager test: fix Thread stack size
Decrease the default stack size as it's not needed for purposes of testing.
2017-09-09 20:42:55 -05:00
Martin Kojtal c5a41d83c2 test: add sleep manager tests
This commits contains two tests:
- race condition
- deep sleep locking/unlocking
2017-09-07 15:35:07 +01:00
Jimmy Brisson 294d7e7b41 Merge pull request #4690 from 0xc0170/us_ticker_test
test: add us ticker test
2017-08-07 10:26:54 -05:00
Martin Kojtal ae51f183c6 test: add hal ticker test (us + lp tickers)
This test exercises ticker API
- init should be executed just once
- read timestamp

Set interrupt should be tested via upper layer, as it does not provide
API to change handler that is invoked in the ISR ticker handler.
2017-07-26 17:05:51 +01:00
Marcus Chang 299c7f24ac mbed-hal: Fixed flash test
The test assumed that data written to flash would be memory mapped
and directly accessible. On some platform this is not the case
and data has to read back through an explicit read command.

The test has been changed to use the flash read command instead
of direct memory access.
2017-07-19 14:32:39 +01:00
Jimmy Brisson adfed0f9de Merge pull request #4644 from 0xc0170/fix_ticker_delta_negative
Ticker: add fire interrupt now function
2017-07-17 11:05:46 -05:00
Martin Kojtal 56cb1582be ticker test: add test for set interrupt with timestamp in the past
2 test cases added, one for event in the past, one for event in future but very close
to the current time, thus once is set, it is already in the past, and we fire
interrupt immediately.
2017-07-13 12:23:25 +01:00
Martin Kojtal 4ff432904e ticker test: add fire now stub 2017-07-13 12:23:25 +01:00
Chris 8365d9d00d Remove volatile 2017-06-30 22:44:05 +01:00
Chris ed8b378c6e Code tidy 2017-06-30 22:09:47 +01:00
Chris 562a548053 Assembly based loop for timing test 2017-06-30 20:33:58 +01:00
Chris 92e4a1faf7 Fix timing issues found in "Flash - clock and cache test"
ARMCC seemed to be inlining time_cpu_cycles() but with a different number of clock cycles in the loop, GCC worked fine.
2017-06-29 09:51:44 +01:00
Sam Grove cfc4159c3f Merge pull request #4490 from pan-/reintroduce_ticker_test
tests: Reintroduce ticker test.
2017-06-11 01:09:24 -05:00
Russ Butler adcd2928fe Fix mktime test DST error
Initialize all values of timeinfo in make_time_info. This prevents
the field 'tm_isdst' from getting inadvertently set to 1 causing
time to be off by 1 hour.
2017-06-09 16:29:24 -05:00
Russ Butler d6af53c3ab Limit mktime test range for IAR
Do not test mktime or localtime past the year 1935 for IAR since this
is out of their supported range.
2017-06-09 16:26:17 -05:00
Vincent Coubard 6b020a3510 mbed_localtime: Add support of year day.
This field is needed by the LPC43XX targets.
2017-06-08 10:32:57 +01:00
Vincent Coubard 946ed353bc mbed_mktime: Improve documentation for doxygen. 2017-06-08 10:01:43 +01:00
Vincent Coubard f880e44145 remove usage of mktime/localtime in favor of dedicated functions.
The use of mktime was causing a fault when called in interrupt handler because on GCC it lock the mutex protecting the environment, To overcome this issue, this patch add dedicated routine to convert a time_t into a tm and vice versa.
In the process mktime has been optimized and is now an order of magnitude faster than the routines present in the C library.
2017-06-07 22:06:22 -05:00
Vincent Coubard 7a8898bb21 tests: Reintroduce ticker test.
This test was removed because of its memory footprint.
Most of the memory consummed by the test itself was related to the instantion of test cases in RAM.

With the introduction of case_t which allows tests cases to live in FLASH, the memory footprint has been drastically reduced (860 bytes of RAM saved) and the ticker test can be reintroduced in the code base.
2017-06-07 10:59:23 +01:00
Martin Kojtal 3e0cdb966c tests: remove ticker test
This is temporary, as this test does not fit to some 16kB RAM devices. This requires few more steps: some small devices are using big async HAL structures, RTX changes increased the RAM footprint, plus this test seems to be too big. With all these, it won't fit in RAM regions for some devices.
2017-06-02 09:26:39 +01:00
Sam Grove fa0cd205a2 Merge pull request #4094 from pan-/fix_hal_ticker
[HAL] Add support for 64 bit us timestamp
2017-06-01 23:25:26 -05:00
Vincent Coubard c6433b018a lp ticker test: Fix timestamp update during deepsleep test. 2017-06-01 16:31:48 +01:00
Vincent Coubard 3e24e8fa62 lp_ticker test: Capture completion time at completion point. 2017-05-31 19:13:10 +01:00
Vincent Coubard 834a302664 ticker test: Fix data scope dependency. 2017-05-23 11:14:10 +01:00
Vincent Coubard fe2144f7ec ticker tests: optimize RAM usage. 2017-05-22 12:07:12 +01:00
Vincent Coubard 4adba7caff ticker test: fix code format. 2017-05-17 18:55:53 +01:00
kl-cruz 4bb818cd97 nRF52840: Fixed flashapi test and casting issue 2017-05-17 09:21:39 +02:00
Vincent Coubard ab09a1722f ticker api: Schedule immediately event in the past. 2017-05-16 10:37:35 +01:00
Vincent Coubard aeffd738c7 ticker_api: Code clarification
* update_interrupt renamed into schedule_interrupt
* update_current_timestamp renamed into update_present_time
* ticker_event_queue_t::timestamp renamed into
* ticker_event_queue_t::present_time
* Fix doxygen comments in ticker_api.h
* Update comments internal comments in mbed_ticker_api.c
2017-05-16 10:37:35 +01:00
Vincent Coubard b1f3aa76bb [HAL] Add Tests for the hal ticker API. 2017-05-16 10:35:11 +01:00
ccli8 bcae1429e5 [Greentea] Fix test code mbed-os-tests-mbed_hal-flash 2017-03-20 15:06:06 +08:00
0xc0170 4d55719321 test: add flash functional tests for flash HAL
Add tests to verify the hal port of the flash_api.
2017-02-21 14:08:23 -06:00
Mahadevan Mahesh ac9668a498 Update tests to fix build failures. Also make the code similar to other tests
Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-11-02 11:45:14 -05:00
Brian Daniels 9a4aeec1b2 Waiting before call to deepsleep to allow buffers to flush 2016-10-13 13:51:54 -05:00
svastm cc55173329 Use lp_timer to count time in the deepsleep tests
Because microseconds timer can be disable during deepsleep
2016-09-08 18:09:45 +02:00
Bartek Szatkowski 7203be9e6f Add tests for LowPowerTimeout and lp_ticker 2016-08-25 13:25:02 +01:00