Skip to content

Added timeouts (delays) on serial port and mounting point #986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2015
Merged

Added timeouts (delays) on serial port and mounting point #986

merged 1 commit into from
Mar 24, 2015

Conversation

PrzemekWirkus
Copy link
Contributor

Description

  • Added timeouts (delays) on serial port and mounting point accesses in host_test and copy plugins to prevent serial/disk I/O errors when device remounts USB iface of interface chip.
  • Also some Freedom boards (KL25Z, KL46Z) can cause re-mounting issues when (experimental) parallel test execution is turn on option --parallel.
    This implementation hopefully solves both problems.

    Rationale

    There was a problem with U-BLOX interface chip which is re-mounting and causing serial / mount point I/O when test suite is executed.
    See here: http://developer.mbed.org/questions/6743/singletestpy-need-wait-between-end-of-co

Fix is adding pooling for serial port and mount point so we are only flashing and reading from serial when both are available (when accessing).

Usage:

$ singletest.py -i test_spec.json -M muts_all.json  --global-loops 3 -W

or (only when mbed-ls is installed)

$ singletest.py --auto --global-loops 3 -W

Note: Flags --global-loops 3 -W added to repeat failing tests up to 3 times.

Results:

Test summary:
+---------+------------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
| Result  | Target     | Toolchain | Test ID     | Test Description                      | Elapsed Time (sec) | Timeout (sec) | Loops |
+---------+------------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
| OK      | UBLOX_C027 | ARM       | DTCT_1      | Simple detect test                    |        0.58        |       10      |  1/1  |
| OK      | UBLOX_C027 | ARM       | EXAMPLE_1   | /dev/null                             |        3.5         |       20      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_10     | Hello World                           |        0.4         |       5       |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_11     | Ticker Int                            |       11.41        |       15      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_12     | C++                                   |        1.43        |       10      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_16     | RTC                                   |        4.62        |       20      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_2      | stdio                                 |        0.84        |       20      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_23     | Ticker Int us                         |       11.42        |       15      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_24     | Timeout Int us                        |       11.45        |       15      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_25     | Time us                               |       11.61        |       15      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_26     | Integer constant division             |        1.43        |       20      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_34     | Ticker Two callbacks                  |       11.43        |       15      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_A1     | Basic                                 |        1.41        |       20      |  1/1  |
| OK      | UBLOX_C027 | ARM       | MBED_A21    | Call function before main (mbed_main) |        1.48        |       20      |  1/1  |
| TIMEOUT | UBLOX_C027 | ARM       | MBED_A9     | Serial Echo at 115200                 |       40.41        |       20      |  0/3  |
| OK      | UBLOX_C027 | ARM       | MBED_BUSOUT | BusOut                                |        2.36        |       15      |  1/1  |
+---------+------------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
Result: 15 OK / 1 TIMEOUT

Completed in 283.15 sec

(Experimental) Parallel tests for KL25Z and KL46Z fix:

This pull request should also fix parallel execution for few Freedom Boards (its interface chip also behaves in such a way it remounts USB devices after target reset / flashing).
Note: indeed this pull request fixes this issue, at least in configuration I've set up.

$ singletest.py --auto --parallel --global-loops 3 -W
MBEDLS: Detecting connected mbed-enabled devices...
MBEDLS: Detected KL46Z, port: COM40, mounted: E:
MBEDLS: Detected KL25Z, port: COM89, mounted: F:
Building library CMSIS (KL25Z, ARM)Building library CMSIS (KL46Z, ARM)


Building library MBED (KL46Z, ARM)
Building library MBED (KL25Z, ARM)
Building project DETECT (KL25Z, ARM)
Building project DETECT (KL46Z, ARM)
TargetTest::KL25Z::ARM::DTCT_1::Simple detect test [OK] in 0.51 of 10 sec
Building project DEV_NULL (KL25Z, ARM)
TargetTest::KL46Z::ARM::DTCT_1::Simple detect test [OK] in 0.48 of 10 sec
Building project DEV_NULL (KL46Z, ARM)
TargetTest::KL25Z::ARM::EXAMPLE_1::/dev/null [OK] in 3.50 of 20 sec
Building project I2C_MMA8451Q (KL25Z, ARM)
TargetTest::KL46Z::ARM::EXAMPLE_1::/dev/null [OK] in 3.52 of 20 sec
Building project I2C_MMA8451Q (KL46Z, ARM)
TargetTest::KL25Z::ARM::KL25Z_5::MMA8451Q accelerometer [OK] in 12.54 of 15 sec
Building project HELLO (KL25Z, ARM)
TargetTest::KL46Z::ARM::KL25Z_5::MMA8451Q accelerometer [FAIL] in 12.54 of 15 sec
TargetTest::KL25Z::ARM::MBED_10::Hello World [OK] in 0.39 of 5 sec
Building project TICKER (KL25Z, ARM)
TargetTest::KL46Z::ARM::KL25Z_5::MMA8451Q accelerometer [FAIL] in 12.55 of 15 sec
TargetTest::KL25Z::ARM::MBED_11::Ticker Int [OK] in 11.38 of 15 sec
Building project CPP (KL25Z, ARM)
TargetTest::KL25Z::ARM::MBED_12::C++ [OK] in 1.39 of 10 sec
Building project RTC (KL25Z, ARM)
TargetTest::KL46Z::ARM::KL25Z_5::MMA8451Q accelerometer [FAIL] in 12.55 of 15 sec
Building project HELLO (KL46Z, ARM)
TargetTest::KL25Z::ARM::MBED_16::RTC [OK] in 4.59 of 20 sec
Building project STDIO (KL25Z, ARM)
TargetTest::KL46Z::ARM::MBED_10::Hello World [OK] in 0.39 of 5 sec
Building project TICKER (KL46Z, ARM)
TargetTest::KL25Z::ARM::MBED_2::stdio [OK] in 0.74 of 20 sec
Building project TICKER_2 (KL25Z, ARM)
TargetTest::KL46Z::ARM::MBED_11::Ticker Int [OK] in 11.36 of 15 sec
Building project CPP (KL46Z, ARM)
TargetTest::KL25Z::ARM::MBED_23::Ticker Int us [OK] in 11.36 of 15 sec
Building project TIMEOUT (KL25Z, ARM)
TargetTest::KL46Z::ARM::MBED_12::C++ [OK] in 1.36 of 10 sec
Building project RTC (KL46Z, ARM)
TargetTest::KL46Z::ARM::MBED_16::RTC [OK] in 4.58 of 20 sec
Building project STDIO (KL46Z, ARM)
TargetTest::KL46Z::ARM::MBED_2::stdio [OK] in 0.79 of 20 sec
Building project TICKER_2 (KL46Z, ARM)
TargetTest::KL25Z::ARM::MBED_24::Timeout Int us [FAIL] in 14.62 of 15 sec
TargetTest::KL46Z::ARM::MBED_23::Ticker Int us [OK] in 11.39 of 15 sec
Building project TIMEOUT (KL46Z, ARM)
TargetTest::KL25Z::ARM::MBED_24::Timeout Int us [OK] in 11.59 of 15 sec
Building project TIME_US (KL25Z, ARM)
TargetTest::KL46Z::ARM::MBED_24::Timeout Int us [OK] in 11.59 of 15 sec
Building project TIME_US (KL46Z, ARM)
TargetTest::KL25Z::ARM::MBED_25::Time us [OK] in 11.38 of 15 sec
Building project DIV (KL25Z, ARM)
TargetTest::KL25Z::ARM::MBED_26::Integer constant division [OK] in 1.40 of 20 sec
Building project TICKER_3 (KL25Z, ARM)
TargetTest::KL46Z::ARM::MBED_25::Time us [OK] in 11.39 of 15 sec
Building project DIV (KL46Z, ARM)
TargetTest::KL46Z::ARM::MBED_26::Integer constant division [OK] in 1.40 of 20 sec
Building project TICKER_3 (KL46Z, ARM)
TargetTest::KL25Z::ARM::MBED_34::Ticker Two callbacks [OK] in 11.36 of 15 sec
Building project BASIC (KL25Z, ARM)
TargetTest::KL25Z::ARM::MBED_A1::Basic [OK] in 1.36 of 20 sec
Building project CALL_BEFORE_MAIN (KL25Z, ARM)
TargetTest::KL25Z::ARM::MBED_A21::Call function before main (mbed_main) [OK] in 1.44 of 20 sec
Building project ECHO (KL25Z, ARM)
TargetTest::KL46Z::ARM::MBED_34::Ticker Two callbacks [OK] in 11.36 of 15 sec
Building project BASIC (KL46Z, ARM)
TargetTest::KL46Z::ARM::MBED_A1::Basic [OK] in 1.35 of 20 sec
Building project CALL_BEFORE_MAIN (KL46Z, ARM)
TargetTest::KL25Z::ARM::MBED_A9::Serial Echo at 115200 [OK] in 6.34 of 20 sec
Building project BUS_OUT (KL25Z, ARM)
TargetTest::KL46Z::ARM::MBED_A21::Call function before main (mbed_main) [OK] in 1.45 of 20 sec
Building project ECHO (KL46Z, ARM)
TargetTest::KL25Z::ARM::MBED_BUSOUT::BusOut [OK] in 2.30 of 15 sec
Building library RTX (KL25Z, ARM)
Building library RTOS (KL25Z, ARM)
Building project BASIC (KL25Z, ARM)
TargetTest::KL46Z::ARM::MBED_A9::Serial Echo at 115200 [OK] in 6.34 of 20 sec
Building project BUS_OUT (KL46Z, ARM)
TargetTest::KL46Z::ARM::MBED_BUSOUT::BusOut [OK] in 2.32 of 15 sec
Building library RTX (KL46Z, ARM)
Building library RTOS (KL46Z, ARM)
Building project BASIC (KL46Z, ARM)
TargetTest::KL25Z::ARM::RTOS_1::Basic thread [OK] in 11.37 of 15 sec
Building library RTX (KL25Z, ARM)
Building library RTOS (KL25Z, ARM)
Building project MUTEX (KL25Z, ARM)
TargetTest::KL46Z::ARM::RTOS_1::Basic thread [OK] in 11.39 of 15 sec
Building library RTX (KL46Z, ARM)
Building library RTOS (KL46Z, ARM)
Building project MUTEX (KL46Z, ARM)
TargetTest::KL25Z::ARM::RTOS_2::Mutex resource lock [OK] in 11.56 of 20 sec
Building library RTX (KL25Z, ARM)
Building library RTOS (KL25Z, ARM)
Building project SEMAPHORE (KL25Z, ARM)
TargetTest::KL25Z::ARM::RTOS_3::Semaphore resource lock [OK] in 8.49 of 20 sec
Building library RTX (KL25Z, ARM)
Building library RTOS (KL25Z, ARM)
Building project SIGNALS (KL25Z, ARM)
TargetTest::KL46Z::ARM::RTOS_2::Mutex resource lock [OK] in 11.49 of 20 sec
Building library RTX (KL46Z, ARM)
Building library RTOS (KL46Z, ARM)
Building project SEMAPHORE (KL46Z, ARM)
TargetTest::KL25Z::ARM::RTOS_4::Signals messaging [OK] in 6.44 of 20 sec
Building library RTX (KL25Z, ARM)
Building library RTOS (KL25Z, ARM)
Building project QUEUE (KL25Z, ARM)
TargetTest::KL46Z::ARM::RTOS_3::Semaphore resource lock [OK] in 8.49 of 20 sec
Building library RTX (KL46Z, ARM)
Building library RTOS (KL46Z, ARM)
Building project SIGNALS (KL46Z, ARM)
TargetTest::KL25Z::ARM::RTOS_5::Queue messaging [OK] in 2.41 of 20 sec
Building library RTX (KL25Z, ARM)
Building library RTOS (KL25Z, ARM)
Building project MAIL (KL25Z, ARM)
TargetTest::KL46Z::ARM::RTOS_4::Signals messaging [OK] in 6.45 of 20 sec
Building library RTX (KL46Z, ARM)
Building library RTOS (KL46Z, ARM)
Building project QUEUE (KL46Z, ARM)
TargetTest::KL25Z::ARM::RTOS_6::Mail messaging [OK] in 2.41 of 20 sec
Building library RTX (KL25Z, ARM)
Building library RTOS (KL25Z, ARM)
Building project TIMER (KL25Z, ARM)
TargetTest::KL46Z::ARM::RTOS_5::Queue messaging [OK] in 2.41 of 20 sec
Building library RTX (KL46Z, ARM)
Building library RTOS (KL46Z, ARM)
Building project MAIL (KL46Z, ARM)
TargetTest::KL46Z::ARM::RTOS_6::Mail messaging [OK] in 2.40 of 20 sec
Building library RTX (KL46Z, ARM)
Building library RTOS (KL46Z, ARM)
Building project TIMER (KL46Z, ARM)
TargetTest::KL25Z::ARM::RTOS_7::Timer [OK] in 11.37 of 15 sec
Building library RTX (KL25Z, ARM)
Building library RTOS (KL25Z, ARM)
Building project ISR (KL25Z, ARM)
TargetTest::KL25Z::ARM::RTOS_8::ISR (Queue) [OK] in 6.45 of 20 sec
TargetTest::KL46Z::ARM::RTOS_7::Timer [OK] in 11.37 of 15 sec
Building library RTX (KL46Z, ARM)
Building library RTOS (KL46Z, ARM)
Building project ISR (KL46Z, ARM)
TargetTest::KL46Z::ARM::RTOS_8::ISR (Queue) [OK] in 6.45 of 20 sec
Test summary:
+--------+--------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
| Result | Target | Toolchain | Test ID     | Test Description                      | Elapsed Time (sec) | Timeout (sec) | Loops |
+--------+--------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
| OK     | KL25Z  | ARM       | DTCT_1      | Simple detect test                    |        0.51        |       10      |  1/1  |
| OK     | KL46Z  | ARM       | DTCT_1      | Simple detect test                    |        0.48        |       10      |  1/1  |
| OK     | KL25Z  | ARM       | EXAMPLE_1   | /dev/null                             |        3.5         |       20      |  1/1  |
| OK     | KL46Z  | ARM       | EXAMPLE_1   | /dev/null                             |        3.52        |       20      |  1/1  |
| OK     | KL25Z  | ARM       | KL25Z_5     | MMA8451Q accelerometer                |       12.54        |       15      |  1/1  |
| OK     | KL25Z  | ARM       | MBED_10     | Hello World                           |        0.39        |       5       |  1/1  |
| OK     | KL25Z  | ARM       | MBED_11     | Ticker Int                            |       11.38        |       15      |  1/1  |
| OK     | KL25Z  | ARM       | MBED_12     | C++                                   |        1.39        |       10      |  1/1  |
| FAIL   | KL46Z  | ARM       | KL25Z_5     | MMA8451Q accelerometer                |       12.55        |       15      |  0/3  |
| OK     | KL25Z  | ARM       | MBED_16     | RTC                                   |        4.59        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_10     | Hello World                           |        0.39        |       5       |  1/1  |
| OK     | KL25Z  | ARM       | MBED_2      | stdio                                 |        0.74        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_11     | Ticker Int                            |       11.36        |       15      |  1/1  |
| OK     | KL25Z  | ARM       | MBED_23     | Ticker Int us                         |       11.36        |       15      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_12     | C++                                   |        1.36        |       10      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_16     | RTC                                   |        4.58        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_2      | stdio                                 |        0.79        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_23     | Ticker Int us                         |       11.39        |       15      |  1/1  |
| FAIL   | KL25Z  | ARM       | MBED_24     | Timeout Int us                        |       11.59        |       15      |  1/2  |
| OK     | KL46Z  | ARM       | MBED_24     | Timeout Int us                        |       11.59        |       15      |  1/1  |
| OK     | KL25Z  | ARM       | MBED_25     | Time us                               |       11.38        |       15      |  1/1  |
| OK     | KL25Z  | ARM       | MBED_26     | Integer constant division             |        1.4         |       20      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_25     | Time us                               |       11.39        |       15      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_26     | Integer constant division             |        1.4         |       20      |  1/1  |
| OK     | KL25Z  | ARM       | MBED_34     | Ticker Two callbacks                  |       11.36        |       15      |  1/1  |
| OK     | KL25Z  | ARM       | MBED_A1     | Basic                                 |        1.36        |       20      |  1/1  |
| OK     | KL25Z  | ARM       | MBED_A21    | Call function before main (mbed_main) |        1.44        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_34     | Ticker Two callbacks                  |       11.36        |       15      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_A1     | Basic                                 |        1.35        |       20      |  1/1  |
| OK     | KL25Z  | ARM       | MBED_A9     | Serial Echo at 115200                 |        6.34        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_A21    | Call function before main (mbed_main) |        1.45        |       20      |  1/1  |
| OK     | KL25Z  | ARM       | MBED_BUSOUT | BusOut                                |        2.3         |       15      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_A9     | Serial Echo at 115200                 |        6.34        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | MBED_BUSOUT | BusOut                                |        2.32        |       15      |  1/1  |
| OK     | KL25Z  | ARM       | RTOS_1      | Basic thread                          |       11.37        |       15      |  1/1  |
| OK     | KL46Z  | ARM       | RTOS_1      | Basic thread                          |       11.39        |       15      |  1/1  |
| OK     | KL25Z  | ARM       | RTOS_2      | Mutex resource lock                   |       11.56        |       20      |  1/1  |
| OK     | KL25Z  | ARM       | RTOS_3      | Semaphore resource lock               |        8.49        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | RTOS_2      | Mutex resource lock                   |       11.49        |       20      |  1/1  |
| OK     | KL25Z  | ARM       | RTOS_4      | Signals messaging                     |        6.44        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | RTOS_3      | Semaphore resource lock               |        8.49        |       20      |  1/1  |
| OK     | KL25Z  | ARM       | RTOS_5      | Queue messaging                       |        2.41        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | RTOS_4      | Signals messaging                     |        6.45        |       20      |  1/1  |
| OK     | KL25Z  | ARM       | RTOS_6      | Mail messaging                        |        2.41        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | RTOS_5      | Queue messaging                       |        2.41        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | RTOS_6      | Mail messaging                        |        2.4         |       20      |  1/1  |
| OK     | KL25Z  | ARM       | RTOS_7      | Timer                                 |       11.37        |       15      |  1/1  |
| OK     | KL25Z  | ARM       | RTOS_8      | ISR (Queue)                           |        6.45        |       20      |  1/1  |
| OK     | KL46Z  | ARM       | RTOS_7      | Timer                                 |       11.37        |       15      |  1/1  |
| OK     | KL46Z  | ARM       | RTOS_8      | ISR (Queue)                           |        6.45        |       20      |  1/1  |
+--------+--------+-----------+-------------+---------------------------------------+--------------------+---------------+-------+
Result: 2 FAIL / 48 OK

Completed in 342.10 sec

… host_test and copy plugins to prevent serial/disk io errors when device remounts USB iface of interface chip
@RobMeades
Copy link
Contributor

I can confirm that this Pull Request fixes the timing issue with the C027 board.

0xc0170 added a commit that referenced this pull request Mar 24, 2015
Added timeouts (delays) on serial port and mounting point
@0xc0170 0xc0170 merged commit 9f429e6 into ARMmbed:master Mar 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants