Commit Graph

283 Commits (mbed-os-5.13)

Author SHA1 Message Date
int_szyk 6cb405d3b8 tweak watchdog kick reset test Change the value of KICK_ADVANCE_MS so targets pass the test in worst cases 2019-08-23 11:37:41 +01:00
int_szyk 0a50a4e0fa tweak overflow_protect() common_tickers() 2019-08-23 11:37:41 +01:00
int_szyk c82cc8f09c tweaked overflow_protect() lp_ticker() 2019-08-23 11:37:41 +01:00
Przemyslaw Stekiel 93fe9015ca tests-mbed_hal-us_ticker: adapt to the new requirements (relax us ticker frequecy). 2019-08-23 11:37:41 +01:00
int_szyk ef369dd926 Newline at the end of files 2019-08-12 08:32:07 +01:00
int_szyk 50edb3d920 Update main.cpp 2019-08-12 08:32:06 +01:00
int_szyk 6d38596a27 Updated testcases 2019-08-12 08:32:06 +01:00
Chun-Chieh Li 67edba468c Fix mbed_hal-watchdog failing with OOM
This is to fix OOM error on targets with just 16KiB RAM.
2019-07-25 15:18:27 +01:00
Filip Jagodzinski a7178b3519 Test: Watchdog: Fix test_restart case
Watchdog::stop() is called in this test. If the target does not support
stopping the watchdog this case needs to be skipped.
Also improve handling ignored test cases.
2019-07-11 11:55:28 +01:00
Martin Kojtal 2a26e1af4b watchdog: fix copyright 2019-07-11 11:55:18 +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
Mel W 257e4cb686 capitalizing class name
Hope this is alright.
2019-07-11 11:55:11 +01:00
Mel W cbb26403eb Capitalizing Watchdog 2019-07-11 11:55:11 +01:00
Mel W f1a3ccc21b small grammatical changes
Not sure if the formatting's still alright on these.
2019-07-11 11:55:11 +01:00
Filip Jagodzinski f5e61b99a1 Docs: Watchdog: Update code comments
* capitalize driver class name,
* reword test docs for the driver & HAL,
* capitalize Mbed name,
* reword the comments explaining the SERIAL_FLUSH_TIME_MS macro.
2019-07-11 11:55:11 +01:00
Donatien Garnier ec010fc5e6 Fix more astyle failures 2019-07-11 11:55:10 +01:00
Donatien Garnier fd7e46b799 Apply new astyle config style 2019-07-11 11:55:09 +01:00
Donatien Garnier 7c05a83afa Update license headers 2019-07-11 11:55:09 +01:00
Steve Cartmell 4f2acf5f03 test(api-watchdog): Fix errors in compiling watchdog greentea tests
The latest rebase of the watchdog feature branch introduced errors in compiling
watchdog tests due to missing headers.

- Watchdog HAL API test
  Include missing header files to main.cpp (mbed_wait_api.h, stdlib.h).

- Watchdog HAL API timing test
  Include missing header files to main.cpp (us_ticker_api.h).

- Watchdog Driver API test
  Include missing header files to main.cpp (mbed_wait_api.h, stdlib.h).
  Inject mbed namespace into main.cpp to fix Watchdog name resolution.
2019-07-11 11:55:09 +01:00
ccli8 87ca77bbfc Fix NUMAKER_PFM_NANO130 cannot pass mbed_hal/watchdog_reset test
On NUMAKER_PFM_NANO130 target, WDT's clock source is fixed to LIRC, which is much
less accurate than other targets. Enlarge delta define to pass this test.
2019-07-11 11:55:08 +01:00
ccli8 90c75f5d01 Enlarge wait time for flushing serial buffer in Greentea test code
Original wait time is not enough for UART to flush out before deepsleep/reset on some targets.
2019-07-11 11:55:08 +01:00
Filip Jagodzinski 9ed1209657 Tests: HAL API: Reset_reason: Add tests 2019-07-11 11:55:06 +01:00
Filip Jagodzinski 685efbde97 Tests: HAL: Watchdog: Fix timing accuracy test
Relax time measurement margins for UBLOX_EVK_ODIN_W2.
2019-07-11 11:55:05 +01:00
Filip Jagodzinski a129b57443 Tests: HAL API: Watchdog: Add time accuracy tests 2019-07-11 11:55:05 +01:00
Filip Jagodzinski 4f05912b99 Tests: HAL API: Watchdog: Add dev reset tests 2019-07-11 11:55:05 +01:00
Filip Jagodzinski a7734d0fc8 Tests: HAL API: Watchdog: Add tests 2019-07-11 11:55:04 +01:00
Kevin Bracey 0d12800b9f wait_us optimization
As the timer code became more generic, coping with initialization on
demand, and variable width and speed us_ticker_api implementations,
wait_us has gradually gotten slower and slower.

Some platforms have reportedly seen overhead of wait_us() increase from
10µs to 30µs. These changes should fully reverse that drop, and even
make it better than ever.

Add fast paths for platforms that provide compile-time information about
us_ticker. Speed and code size is improved further if:

* Timer has >= 2^32 microsecond range, or better still is 32-bit 1MHz.
* Platform implements us_ticker_read() as a macro
* Timer is initialised at boot, rather than first use

The latter initialisation option is the default for STM, as this has
always been the case.
2019-07-11 11:40:54 +01:00
Filip Jagodzinski 5e9a2a7b2a Tests: SleepManager: Fix test_check for NRF5X
Add missing `lp_ticker_clear_interrupt()` in the interrput handler used
in `test_lock_unlock_test_check()` test.
Remove redefined `us_to_ticks()`.
2019-07-11 11:40:53 +01:00
Laurent Meunier b21d0de725 Update test_lock_unlock_test_check() assertion to cope with new timings
With the DEEP_SLEEP_TEST_CHECK_WAIT_DELTA_US increased,
we now have TEST_ASSERT_UINT64_WITHIN(delta=1000, expected=1000, actual=1000)
so this assertion needed to be updated.

What we need is the deep sleep to be enabled after the programed interrupt
has fired and before a 2ms timeout expiration, which means >= 1000 and < 2000.
2019-07-11 11:40:53 +01:00
Laurent Meunier 9aa859c68d Increase DEEP_SLEEP_TEST_CHECK_WAIT_DELTA_US
now that sleep_manager_can_deep_sleep_test_check() is based on wait_ns
2019-07-11 11:40:53 +01:00
Przemyslaw Stekiel caed5aac99 Further modifications in Sleep Manager test.
Changes:
- restore the original form of setup/teardown handlers,
- test_lock_unlock_test_check(): do not use common ticker layer (Timer, Timeout). Use only ticker HAL layer.
- Increase DEEP_SLEEP_TEST_CHECK_WAIT_DELTA_US delta.
2019-07-11 11:40:53 +01:00
Laurent Meunier d82346e5ca Remove unused variable
and avoid associated warning ...
2019-07-11 11:40:53 +01:00
Laurent Meunier 25e5f2c68c Fix compilation issue for targets without LPTICKER or USTICKER 2019-07-11 11:40:53 +01:00
Laurent Meunier 89602c87d3 Update HAL Sleep manager test to cope with STM32 LPTIM HW
In particular and as kindly suggested by Przemec S. :
1. Add setup/teardown handler’s for all cases. This disables sys-tick,
so there should be no unexpected lp ticker interrupt scheduling.
2. Modify setup/teardown handler’s: remove suspension of lp/us tickers,
so they can count as this is required by test_lock_unlock_test_check test
case.
3. Use TEST_ASSERT_TRUE(sleep_manager_can_deep_sleep_test_check()) after
setting interrupt to cope with STM specific handling (CMPOK interrupt with
deep-sleep locked). This performs wait only if needed and will not affect
other targets which do not need extra wait.
4. Move sleep_manager_lock_deep_sleep() after TEST_ASSERT_TRUE(sleep_manager_can_deep_sleep_test_check())
5. Use TEST_ASSERT_TRUE(sleep_manager_can_deep_sleep_test_check()) in
test_lock_unlock_test_check to let lower layers manage deep sleep.
2019-07-11 11:40:53 +01:00
Przemyslaw Stekiel f1044a7de5 tests-mbed_hal-sleep: add exception for STM LPTIM targets.
On some targets like STM family boards with LPTIM enabled an interrupt is triggered on counter rollover.
We need special handling for cases when next_match_timestamp < start_timestamp (interrupt is to be fired after rollover).
In such case after first wake-up we need to reset interrupt and go back to sleep waiting for the valid one.

On some targets like STM family boards with LPTIM enabled there is a required delay (~100 us) before we are able to reprogram LPTIM_COMPARE register back to back.
This is handled by the low level lp ticker wrapper which uses LPTIM_CMPOK interrupt. CMPOK fires when LPTIM_COMPARE register can be safely reprogrammed again.
This means that on these platforms we have additional interrupt (CMPOK) fired always ~100 us after programming lp ticker.
Since this interrupt wake-ups the board from the sleep we need to go to sleep after CMPOK is handled.

Background:
There is an errata in LPTIM specification that explains that CMP Flag
condition is not an exact match (COUNTER = MATCH) but rather a
comparison (COUNTER >= MATCH).

As a consequence the interrupt is firing early than expected when
programing a timestamp after the 0xFFFF wrap-around.

In order to
work-around this issue, we implement the below work-around.
In case timestamp is after the work-around, let's decide to program the
CMP value to 0xFFFF, which is the wrap-around value. There would anyway be
a wake-up at the time of wrap-around to let the OS update the system time.
When the wrap-around interrupt happen, OS will check the current time and
program again the timestamp to the proper value.
2019-07-11 11:40:52 +01:00
Przemyslaw Stekiel 1a2af2c7b6 Disable time drifting test cases.
Time drifting test cases use serial communication with the host and are unstable on CI.
Skip time-drifting test cases if SKIP_TIME_DRIFT_TESTS macro is defined.
The idea for the future is to use FPGA test shield for timing tests instead of host scripts.

Also remove `__ARM_FM` macro which in most cases was used to disable time drifting tests. In other cases replace `__ARM_FM` with `TARGET_ARM_FM` which is more suitable.
2019-07-11 11:40:51 +01:00
Przemyslaw Stekiel 1ddebcd9b7 Fix GREENTEA_SETUP() call in not time drifting tests.
In these tests GREENTEA_SETUP() is incorrectly called with "timing_drift_auto" instead of "default_auto".
2019-07-11 11:40:51 +01:00
ccli8 81f117af35 Exclude mbed-hal-spm test for TrustZone chips
This is because for TrustZone chips like M23/M33, SecureFault is implemented in
secure-side and cannot pass on to non-secure side.
2019-07-11 11:39:48 +01:00
Maciej Bocianski d9e2930808 hal_qspi_test: undo buggy code
Remove some buggy code introduced to hal_qspi_test by PR #10435
Added support for QSPI to Cypress Boards
a8570ffe6c
2019-07-11 11:39:48 +01:00
Lingkai Dong ad91527023 critical_section tests: do not check APP interrupts on NRF52
APP interrupts are masked on SoftDevice BLE stack only, but we
have switched to Cordio stack on NRF52 targets.
2019-06-12 16:15:57 +01:00
Martin Kojtal ab82f1fca6
Merge pull request #10627 from devran01/remove_future_sequana_target
Remove targets FUTURE_SEQUANA_M0_PSA and FUTURE_SEQUANA_PSA
2019-05-24 12:16:10 +01:00
Devaraj Ranganna 7765d39283 The targets FUTURE_SEQUANA_M0_PSA and FUTURE_SEQUANA_PSA are removed
due to partial implementation. Having FUTURE_SEQUANA_M0 and
FUTURE_SEQUANA PSA targets is misleading.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
2019-05-21 15:00:31 +01:00
Martin Kojtal f859289634
Merge pull request #10489 from kjbracey-arm/gpio_api_nc
gpio_api.h: Clarify desired behaviour for NC
2019-05-21 14:36:49 +01:00
Guillermo Alonso 70bc390410 added QSPI support to target RHOMBIO_L476DMW1K 2019-05-07 15:44:09 +02:00