Skip to content

RTL8195AM - Fix us_ticker porting #5143

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
Sep 20, 2017
Merged

Conversation

tung7970
Copy link
Contributor

@tung7970 tung7970 commented Sep 20, 2017

Description

commit f7bc126 (Re-work Rtl8195AM ticker) tried to address ticker drifting issue, but in
fact broke ticker functionality.This patch adjusts us_ticker porting to un-break it, and to fix the following tests:

mbed-os-tests-mbed_drivers-ticker
mbed-os-tests-mbed_drivers-timeout
mbed-os-tests-mbedmicro-rtos-mbed-isr
mbed-os-features-frameworks-utest-tests-unit_tests-minimal_async_scheduler
mbed-os-features-frameworks-utest-tests-unit_tests-case_control_async
mbed-os-features-frameworks-utest-tests-unit_tests-case_async_validate

Changes are:

  1. Dont disable timer after every us_ticker interrupt. That basically
    breaks ticker functionality.

  2. Fine-tune us to tick conversion macro. Previous conversion method
    yields 1 tick drift every 2 ms.

  3. Remove special placement of ticker objects. No longer necessary.

Status

READY

Migrations

NO

Related PRs

#5044

Todos

NONE

Deploy notes

NONE

Steps to test or reproduce

mbed greentea test

@tung7970
Copy link
Contributor Author

@Archcady

commit f7bc126 (Re-work Rtl8195AM ticker) tried to address ticker drifting
issue, but in fact broke ticker functionality. This patch adjusts us_ticker
porting to unbreak it, and to fix the following tests:

mbed-os-tests-mbed_drivers-ticker
mbed-os-tests-mbed_drivers-timeout
mbed-os-tests-mbedmicro-rtos-mbed-isr
mbed-os-features-frameworks-utest-tests-unit_tests-minimal_async_scheduler
mbed-os-features-frameworks-utest-tests-unit_tests-case_control_async
mbed-os-features-frameworks-utest-tests-unit_tests-case_async_validate

Changes are:

1. Dont disable timer after every us_ticker interrupt. That basically
   breaks ticker functionality.

2. Fine-tune us to tick conversion macro. Previous conversion method
   yields 1 tick drift every 2 ms.

3. Remove special placement of ticker objects. No longer necessary.

Signed-off-by: Tony Wu <[email protected]>
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Remove special placement of ticker objects. No longer necessary.

👍

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 20, 2017

How was this tested? run tests that you can share the results?

@Archcady
Copy link
Contributor

Archcady commented Sep 20, 2017

Hi @0xc0170 , I found previous PR could not pass driver_ticker test in Greentea. So I just ran Greentea test on this branch with GCC and ARM and IAR. All tests passed. Here's the result with GCC

mbedgt: all tests finished!
mbedgt: shuffle seed: 0.4961234123
mbedgt: test suite report:
+---------------------------+-------------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
| target                    | platform_name     | test suite                                                                           | result | elapsed_time (sec) | copy_method |
+---------------------------+-------------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-basic_test                        | OK     | 19.28              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-basic_test_default                | OK     | 19.28              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-case_async_validate               | OK     | 20.1               | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-case_control_async                | OK     | 24.0               | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-case_control_repeat               | OK     | 19.85              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-case_selection                    | OK     | 19.13              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-case_setup_failure                | OK     | 19.44              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-case_teardown_failure             | OK     | 19.53              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-control_type                      | OK     | 19.99              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-minimal_async_scheduler           | OK     | 19.86              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-minimal_scheduler                 | OK     | 19.62              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-test_assertion_failure_test_setup | OK     | 19.18              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-test_setup_case_selection_failure | OK     | 19.29              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-frameworks-utest-tests-unit_tests-test_setup_failure                | OK     | 19.18              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-tests-filesystem-heap_block_device                                  | OK     | 21.15              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-tests-filesystem-mbr_block_device                                   | OK     | 20.9               | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-features-tests-filesystem-util_block_device                                  | OK     | 20.01              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-rtos-target_cortex-rtx5-tests-memory-heap_and_stack                          | OK     | 20.02              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-events-queue                                                           | OK     | 25.2               | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-events-timing                                                          | OK     | 81.56              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-integration-basic                                                      | OK     | 18.26              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-c_strings                                                 | OK     | 19.88              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-dev_null                                                  | OK     | 21.95              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-echo                                                      | OK     | 23.93              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-flashiap                                                  | OK     | 19.8               | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-generic_tests                                             | OK     | 20.35              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-race_test                                                 | OK     | 20.62              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-rtc                                                       | OK     | 30.86              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-stl_features                                              | OK     | 20.18              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-ticker                                                    | OK     | 33.56              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_drivers-timeout                                                   | OK     | 26.62              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_functional-callback                                               | OK     | 20.84              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_functional-callback_big                                           | OK     | 20.5               | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_functional-callback_small                                         | OK     | 20.5               | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_functional-functionpointer                                        | OK     | 19.36              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-flash                                                         | OK     | 21.38              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-lp_us_tickers                                                 | OK     | 19.28              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-rtc_time                                                      | OK     | 247.76             | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbed_hal-ticker                                                        | OK     | 22.93              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-mbed-attributes                                              | OK     | 19.71              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-mbed-call_before_main                                        | OK     | 19.17              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-mbed-cpp                                                     | OK     | 19.24              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-mbed-div                                                     | OK     | 19.59              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-mbed-static_assert                                           | OK     | 18.98              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-rtos-mbed-basic                                              | OK     | 26.17              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-rtos-mbed-event_flags                                        | OK     | 23.85              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-rtos-mbed-isr                                                | OK     | 24.91              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-rtos-mbed-mail                                               | OK     | 21.63              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-rtos-mbed-malloc                                             | OK     | 33.79              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-rtos-mbed-mutex                                              | OK     | 22.3               | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-rtos-mbed-queue                                              | OK     | 20.55              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-rtos-mbed-semaphore                                          | OK     | 23.06              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-rtos-mbed-signals                                            | OK     | 24.75              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedmicro-rtos-mbed-threads                                            | OK     | 24.6               | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedtls-multi                                                          | OK     | 20.83              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-mbedtls-selftest                                                       | OK     | 50.82              | default     |
| REALTEK_RTL8195AM-GCC_ARM | REALTEK_RTL8195AM | mbed-os-tests-netsocket-ip_parsing                                                   | OK     | 21.14              | default     |
+---------------------------+-------------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
mbedgt: test suite results: 57 OK

@tung7970
Copy link
Contributor Author

tung7970 commented Sep 20, 2017

Like @Archcady mentioned, without this patch, ticker and timeout related greentea tests will fail.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 20, 2017

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1344

All builds and test passed!

@theotherjimmy theotherjimmy merged commit 617f410 into ARMmbed:master Sep 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants