`ESP8266Interface::connect()` and `ESP8266Interface::disconnect()` can be used in terms of asynchronous operations. Mainly, it is based on newly added private variable of type `esp_connection_software_status` which is used to keep tracking of state of connection.`wifi_connect_nonblock` test was renamed and amended to test both `connect()` and `disconnect()` operation
Change stack sizes in test stats_cpu and mbedmicro-rtos-mbed-threads.
The value 384 was declared to make this test pass on STM32F070RB,
but its main stack value has been changed to 3KB so now it passes
this test with 512 stack size. The change was needed to make GR_LYCHEE
pass this test on ARM compiler.
IPCore's netsocket tests are expected to run all tests even if some of them fail. The TEST_ASSERT_INT_WITHIN macro sets a global variable Unity.CurrentTestFailed which prevents further checks and gives incorrect failure count. Other assertion macros in Unity do not do that.
The most suitable place to free up I2C pins is in i2c_free(). Due to
i2c_free() not available in I2C HAL, we free up I2C pins manually by
configuring them back to GPIO.
Without free-up of I2C pins, SDA/SCL pins of the same I2C peripheral may
share by multiple ports due to 'all ports' tests here, and the following I2C
tests would be subject to interference by shared ports.
The Nuvoton targets listed below don't support input pull-up/pull-down mode
and so are skipped for test:
- NUMAKER_PFM_NANO130
- NUMAKER_PFM_NUC472
- NUMAKER_PFM_M453
Calls to Timer::attach() are inlined in order not to use floating-point
library functions calls given Timer::attach_us() expects an integer
for the callback interval.
* Create new `s_timestamp_t` type to specify timestamp is seconds
* Alter `attach()` API to expect `s_timestamp_t` for interval value
* Create helper macro to convert seconds to milliseconds and help code
readability
* Modify Greentea tests accordingly
Test case printed IP address. If ip address is null, IAR compiled binary fails.
Added check for printing null. If IP address is null, then it prints string 'null'.
Test case printed IP address. If ip address is null, IAR compiled binary fails.
Added check for printing null. If IP address is null, then it prints string 'null'.
* Fix rtos include path in NRFCordioHCIDriver
* Flatten USB driver directory structure
* Add missing include for us_ticker
* Add more missing includes for us_ticker
* Fix mbed_hal_fpga_ci_test_shield/uart test
* Fix bare-metal build
* Fix Watchdog UNITTEST
* Fix Mbed OS 2 build for Public/Internal headers relocating
The contents of the usb directory were moved to appropriate locations and the usb directory removed.
* Public USB headers moved under drivers/
* Internal USB headers moved under drivers/internal/
* USB Source code moved under drivers/source/usb/
* Moved usb/device/hal/ under hal/usb/
* Moved usb/device/USBPhy/ under hal/usb/
* Merged usb/device/targets/ into targets/
* Separated public and private USB API documentation under Doxygen groups drivers-public-api and drivers-internal-api.
* Fixed wrapper functions for IAR
* Fixed and renamed profile to minimal-printf.json
* Moved minimal-printf under platform
* Removed minimal-printf/mbed_lib.json
* Modified exporter template to work with partial profile
* Prevented optimization of printf to avoid compiler function substitution
- Add the no confidentiality & no replay protection flags
- Add actual size parameter in PS/ITS get APIs
- Change a few size parameters from uint32_t to size_t
During the SiP workshop, we discovered that 3% is too narrow due to a combination of:
Voltage rail differences between target and FPGA
Extension of lesser-resolution ADC's to 16-bit results
The test case which checks full range cannot be executed at the moment due to a hardware bug in FPGA-Test-Shield.
This test case will be restored when the final version of FPGA-Test-Shield is ready.
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.
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.
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.
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.
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.
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.
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.
Running PowerShell script on some windows machines is blocked.
To avoid this problem script was replace by the code run directly in PowerShell console.
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.
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.
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.
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.
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.
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.
Fix was to add some time between iterations connect-disconnect.
In cellular disconnect, cellular network may send disconnect events
and if those events come when connect is already ongoing test will fail.
So wait a bit after disconnect so that disconnect events should be over.
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/ .
Do not call sleep from the test thread, but let scheduler do it.
And also include the deep sleep latency in the computation of the allowed
delta for deep sleep test case.
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.
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.
* capitalize driver class name,
* reword test docs for the driver & HAL,
* capitalize Mbed name,
* reword the comments explaining the SERIAL_FLUSH_TIME_MS macro.
Change the config parameter used as a delay before sending the sync
packet after the device reset in watchdog and reset_reason tests. Use
'forced_reset_timeout' instead of 'program_cycle_s'.
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.
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.
due to partial implementation. Having FUTURE_SEQUANA_M0 and
FUTURE_SEQUANA PSA targets is misleading.
Signed-off-by: Devaraj Ranganna <devaraj.ranganna@arm.com>
Reason for needing greater timeout could be this test's performance.
UDPSOCKET_ECHOTEST_BURST_NONBLOCK is implementing the receiving
differently and is passing with 1 second timeout.
Get rid of a volatile, and use atomics to synchronise with the interrupt
routine instead.
Useful as a non-RTOS basic compilation check for the atomics - the
fuller atomic test relies on the RTOS.
These are platform tests, but rely on the RTOS to run multiple threads
to exercise it.
(The atomics are still useful in non-RTOS, to protect against interrupt
handlers, but testing versus other threads is easier. The implementation
is the same either way, so doesn't seem worth testing non-RTOS
specifically).
The loop was wrongly incrementing the index of the array after assiging
the value. Thus the first array element was used twice and the last one
was never user. The issue is fixed and the loops are refactored and
simplified to avoid such confusion in the future.
This test case uses `hidapi` -- a cross-platform Python module.
To keep the initial Mbed setup as simple as possible, the `hidapi`
module is skipped on Linux hosts because of its external dependancies
for this platform.
The module can be easily installed following instructions from the
README file.
The test case is skipped if the host machine lacks `hidapi` module.
Wait for the host driver to finish setup before sending any HID reports
from the device.
USBHID::wait_ready() blocks until the device reaches 'configured' state,
but the state of the host HID driver remains unknown to the device.
To successfully use pyusb on Windows hosts, a Zadig configuration has to
be performed. Since config for basic tests has already been provided,
use it again.
FastModels are a software simulator for Arm platform/cores.
They mean to be used as a tool for testing or early prototype stage development.
Due to the nature of software simulator can't grantee the timing accuracy like HW.
So time drifting test is skipped for software models.