These boards will be re-enabled when sleep driver for them is ready.
Note:
This operation is done by removing "SLEEP" feature from target's "device_has" list (in targets.json config file).
For NRF52_DK removing of "SLEEP" feature causes some timing issues which have influence on tests. In order to successfully disable this board we need to disable also related features like "USTICKER", "LOWPOERTIMER" and slightly modify ticker tests, so they will not be executed if usticker support is not available (by default all targets support us ticker).
From lowercase to uppercase and drops 'test_'-prefix. Test case
descriptions do also match to TC names now.
Additionally all the TCs are not behing MBED_EXTENDED_TESTS
anymore.
Starts splitting Greentea test suites to TCP and UDP suites and adds
more test cases like
tcpsocket_echotest_burst
tcpsocket_echotest_burst_nonblock
tcpsocket_endpoint_close
tcpsocket_recv_100k
tcpsocket_recv_100k
tcpsocket_recv_timeout
tcpsocket_send_timeout
tcpsocket_thread_per_socket_safety
udpsocket_echotest_burst
udpsocket_echotest_burst_nonblock
udpsocket_recv_timeout
udpsocket_sendto_timeout
With small wait time at the start, chances are that device does not
enter sleep and idle time is zero. Increasing wait time to make sure
device goes to sleep.
If user has initiated a delayed event (either with call_in or call_every),
user might need to know how much time is left until the event is
due to be dispatched.
Added time_left() function can be used to get the remaining time.
CPUID base register is available for Cortex-M processors only.
Cortex-A devices have Main ID Register, which can be used in future to
get processor info.
Currently test assumes that 1 sec is long enough to set RTC time and read same time which has been set.
In some cases extra time for synchronisation between clock domains is needed and after setting/reading operations the read value might be different than one which has been set (+1 sec).
Additionally in some cases when lp ticker is based on RTC, the RTC implementation may use mechanism to trace elapsed seconds without modifying RTC registers. In such case it is possible that second will change immediately after setting time.
Add 1 sec tolerance (min possible) for such checks.
The unified NRF51 target and feature BLE directories have been
reorganized to follow the naming and directory structure of the
NRF52 implementation.
This reorganization does not include TARGET_MCU_NRF51822 and
derived targets.
The flash clock test is disabled for the NRF52 series. This change
re-enables the test but with a higher tolerance to accommodate the
high jitter on the current ticker implementation.
Previously, the echo test followed a flow like the following:
-STEP- -HOST PC- -DEVICE-
0 send _sync
1 echo back _sync
2 send echo_count
3 echo back echo_count
4 send first echo packet
5 echo back echo packet
(repeat echo steps)
However, as noted by issue #6659, this test would somtimes fail between
steps 4 and 5. To ensure each KV pair makes to the correct destination,
we usually write the KV back. Step 4 does not wait for this to happen
and starts sending echo packets. So the device is acting as the "echo
server".
This change makes the host PC the "echo server". The idea being that the
device will be slower and the host pc should always be able to keep up
with it, not the other way around.
Update the SysTimer test to match the updated API. Changes are:
- increment_tick() renamed to _increment_tick() and explicitly
synchronized
-update_tick() replaced with resume() and a call to suspend() was added
before this
sleep_manager_racecondition test fix for devices with low CPU clock
This RP contains fix for sleep_manager_racecondition test
for very slow devices (like NRF51). It fixes the test itself
as well as side effects of fix introduced in
#5046 (us ticker: fix fire interrupt handling)
The idea of the test was to test race condition between main thread
and interrupt handler calling the same function.
To efficiently test this, each handler call should interrupt
main thread to make race more likely.
On very slow devices (like NRF51) when we set very low ticker period
(e.g less then 1000us for NRF51) there is no much time for thread scheduling.
On such slow devices, setting period to 500 us cause that
main thread is scheduled very rarely and only handler is
constantly called making test unreliable.
Fix introduced in #5046 (us ticker: fix fire interrupt handling)
changed fire_interrupt function implementation causing more
interrupt tailing thus even less time for main thread scheduling.
After introduction of #5046 (us ticker: fix fire interrupt handling)
when running sleep_manager_racecondition test on NRF51
(with ticker1.attach_us(&sleep_manager_locking_irq_test, 500);)
test is failing with timeout due to the fact that interrupt
handler is constantly called and main thread is never scheduled.
In the 'Testing accuracy of equeue semaphore' test case result is printed out in each loop iteration.
Since debug prints should not exist in the final test version I suggest to print information only in case of failure.
Additionally time needed to print single info is equal to ~25 ms (K64F/GCC_ARM). The while loop is designed to execute until 20000 ms elapses, so this print has also impact on number of times the loop is executed (number of semaphore accuracy checks).
The features/mbedtls/targets/TARGET_STM/* files include constant needed
for the error codes returned from the MD functions.
The features/mbedtls/targets/hash_wrappers.c provides thin redirection
layer for the hardware accelerated MD implementations that rely on the
old API.
The TESTS/mbedtls/multi/main.cpp has been changed to use the new API
as its build environment does not rely on the translation unit
containing the necessary wrappers.
A call to
`TCPSocket::recv(void *data, nsapi_size_t size)`
returns, following the mbed documentation, the number of received bytes on
success, and a negative error code on failure.
So in case of success, the return value depends on both the value of parameter
`size` but also on the amount of data already available. This means, that the
value returned can be lower than or equal to the `size` of the `data` buffer
passed as argument to the call.
Therefore, in the cases of `test_tcp_hello_world()` & `find_substring()`
(i.e. test `socket_sigio`), the calls to `TCPSocket::recv()` might return from
one byte up to `sizeof(buffer) - 1` (i.e. 511) bytes for each single call,
while the tests expect to receive the whole response string with a single call.
This commit applies a fix to this situation by implementing a receive loop
which exits once there is no data anymore available to be read from the socket.
test_case_2x_callbacks test was redesigned to eliminate ticker rescheduling and improve time mesure accuracy.
Constant ticker rescheduling (detach()/attach_us() calls)
was causing the gap between consecutive callback calls was not exact 1ms
but 1ms + time needed to call the callback and attach new one.
New design just uses two tickers to update counter alternatively every 1ms without rescheduling them
This commit fixes ticker cross-schedule bug in test_case_2x_callbacks subtest
In effect of this bug:
ticker_callback_1_switch_to_2 was called only once
ticker2 was never been fired because it was repeatedly detached just before fire and attached again
The current 0.1% clock tolerance is too small for certain platforms
which natural variance is larger than this. This commit increases the
tolerance to 0.5% instead.
Sample output from time_cpu_cycles called repeatedly in init,
before running any flash tests:
[1515706585.63][CONN][RXD] diff: 49316
[1515706585.69][CONN][RXD] diff: 49256
[1515706585.75][CONN][RXD] diff: 49286
[1515706585.81][CONN][RXD] diff: 49256
[1515706585.87][CONN][RXD] diff: 49225
[1515706585.94][CONN][RXD] diff: 49286
[1515706585.99][CONN][RXD] diff: 49317
[1515706586.06][CONN][RXD] diff: 49255
[1515706586.12][CONN][RXD] diff: 49286
[1515706586.18][CONN][RXD] diff: 49285
[1515706586.24][CONN][RXD] diff: 49286
[1515706586.31][CONN][RXD] diff: 49347
[1515706586.36][CONN][RXD] diff: 49347
[1515706586.43][CONN][RXD] diff: 49286
[1515706586.49][CONN][RXD] diff: 49286
[1515706586.55][CONN][RXD] diff: 49256
[1515706586.61][CONN][RXD] diff: 49286
[1515706586.68][CONN][RXD] diff: 49346
[1515706586.74][CONN][RXD] diff: 49347
[1515706586.80][CONN][RXD] diff: 49256
Notice the outliers will cause intermittent CI failures.
For each of the following years test example time of the first and last day of each month:
- first - 1970
- example not leap year (not divisible by 4)
- example leap year (divisible by 4 and by 100 and by 400)
- example leap year (divisible by 4 and not by 100)
- example not leap year (divisible by 4 and by 100)
- last fully supported - 2105
Test execution time on K64F is now ~39 sec.
In pararell threads of "thread" test is a simple thread, but it seems that there is a difference in the stack used between Cortex-A and Cortex-M.
As a result of check, in Cortex-A, program aborts because of the lack of stack when PARALLEL_THREAD_STACK_SIZE is 384, workes properly when PARALLEL_THREAD_STACK_SIZE is 512 at least.
"malloc" test is used a simple thread that executes only malloc and free, but it seems that there is a difference in the stack used between Cortex-A and Cortex-M.
As a result of check, in Cortex-A, program aborts because of the lack of stack when THREAD_STACK_SIZE is 256, workes properly when THREAD_STACK_SIZE is 512 at least. Since it seems that the definition processing of "DEFAULT_STACK_SIZE" was gone from Mbed OS by updating CMSIS5/RTX5, I setted 512 directly for Cortex-A.
Most of our IP stacks don't allow removal of interfaces so
interface destructor can not reliably clean up. Therefore we
cannot rely its behaviours in test case.
Instead run interface->disconnect() in case interface was already
created.
HTTP_SERVER_NAME and HTTP_SERVER_FILE_PATH are replaced by
MBED_CONF_APP_HTTP_SERVER_NAME and MBED_CONF_APP_HTTP_SERVER_FILE_PATH
to allow user to make local tests
Test on HTTP connect added as test was always OK even with no connection...
HTTP_SERVER_NAME and HTTP_SERVER_FILE_PATH are replaced by
MBED_CONF_APP_HTTP_SERVER_NAME and MBED_CONF_APP_HTTP_SERVER_FILE_PATH
to allow user to make local tests
UUID lines are removed as they were not used
default case:
If MBED_CONF_APP_ECHO_SERVER_ADDR and MBED_CONF_APP_ECHO_SERVER_PORT are not defined
test is using Greentea to get server information (code before OS 5.6.1 version)
TCP_ECHO_PREFIX is no more a mandatory step
UUID lines are removed as they were not used
default case:
If MBED_CONF_APP_ECHO_SERVER_ADDR and MBED_CONF_APP_ECHO_SERVER_PORT are not defined
test is using Greentea to get server information (code before OS 5.6.1 version)
The test for construction of local static objects doesn't check
to see if the object returned has been fully initialized. Because
of this, an error with ARMCC was not detected.
This patch adds an assert to the race_test to ensure that the
object has been properly initialized.
LowPoterTimer test gives sometimes failed result while testing measured time accumulation. The check which verifies if total number of elapsed milliseconds is valid fails. Test assumes that delta value equal to 1 ms is sufficient for all test cases, which is not true since in case where time measurement is performed few times in sequence the measurement error also accumulates and 1 ms might be not enough. To solve this problem delta value for milliseconds tests must be updated.
1) if we receive more than one __sync, previous handshake would consider
it as echo_count and try to decode the value. Now we skip superfluous __sync.
2) reduce the uart load produced by the test, as we are heavily running tests in
parallel and not one-to-one this update was required.
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.
In test_case_2x_callbacks two tickers are setup to repeatedly
reschedule each other. When these tickers are deleted this
rescheduling is still occurring and can lead to a deleted ticker
being scheduled.
When this happens the following error message is displayed:
Thread 0x0 error -6: Not allowed in ISR context
Note - this problem was not detected by CI since the test reported
the correct results back to the host test and only experienced this
error on tear down.
This problem can be reproduced on an nrf51 by first building the ticker
test with:
"mbed test -t GCC_ARM -m NRF51_DK -n tests-mbed_drivers-ticker
--compile -DMBED_TRAP_ERRORS_ENABLED=1
-DMBED_HEAP_STATS_ENABLED=1 -DMBED_STACK_STATS_ENABLED=1"
And then running testing with:
"mbed test -t GCC_ARM -m NRF51_DK -n tests-mbed_drivers-ticker --run"
This commit reverts commit c1c0f1ea57
because it causes nightly builds to fail. This is because extra tests
added in tests-mbed_drivers-ticker fail on some targets, such as the
KL46Z, MAX32625MBED, MAX32630FTHR, NCS36510, NRF51 and NRF52_DK.