Skip to content
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

wait_us without usticker #9896

Merged
merged 1 commit into from
Mar 14, 2019
Merged

wait_us without usticker #9896

merged 1 commit into from
Mar 14, 2019

Conversation

mikisch81
Copy link
Contributor

@mikisch81 mikisch81 commented Feb 28, 2019

Description

Some targets (Mainly PSA secure targets running TF-M) have no usticker.
In order to support wait_us() in these targets (mbed_die() uses it for example), wait_us() is implemented using wait_ns() which does software-loop based delays.

Fixes #9853

Depends on #9812

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@kjbracey-arm

Release Notes

Some targets have no usticker. Fallback to use busy loop wait_ns() for cases like this.

@mikisch81
Copy link
Contributor Author

@jeromecoutant

@ciarmcom ciarmcom requested review from kjbracey, Ronny-Liu and a team February 28, 2019 22:00
@ciarmcom
Copy link
Member

@mikisch81, thank you for your changes.
@kjbracey-arm @Ronny-Liu @ARMmbed/mbed-os-test @ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@deepikabhavnani
Copy link

@mikisch81 - Please note #9812 is not verified for Cortex-M33 devices and #9853 issue is for Cortex-M33 devices

#9812 (comment)

Copy link
Contributor

@kjbracey kjbracey left a comment

Choose a reason for hiding this comment

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

If you are actually working on an M33, it would be awesome if you could confirm the timing.

I was about to suggest using the wait_ns test, but I now realise that it actually also assumes that you have USTICKER - it tests against us_ticker unconditionally and against lp_ticker if available.

Might have to use a stopwatch...

@mikisch81
Copy link
Contributor Author

@kjbracey-arm do you have a cm33 device to test it?
I can try and run the tests on the Musca_a1.
@jeromecoutant can you test it on the L5 port?

@kjbracey
Copy link
Contributor

kjbracey commented Mar 1, 2019

do you have a cm33 device to test it?

No.

@mikisch81
Copy link
Contributor Author

I was about to suggest using the wait_ns test, but I now realise that it actually also assumes that you have USTICKER - it tests against us_ticker unconditionally and against lp_ticker if available.

Might have to use a stopwatch...

The greentea tests are running in the non-secure part which has usticker.

@kjbracey
Copy link
Contributor

kjbracey commented Mar 1, 2019

Okay, tolerances are set very high (45%) on the test as checked in - to allow for flash wait states etc, so a "pass" isn't tight enough to show whether the scaling number is definitely correct. If you just reduce those numbers right down to a couple of percent, you should be able to confirm how tight it is - tell if the 5 cycles is correct.

@kjbracey
Copy link
Contributor

kjbracey commented Mar 1, 2019

You probably need to rebase this now that the wait_ns PR is in - the commits are still showing up here.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 1, 2019

Rebased

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 8, 2019

Anyone from @ARMmbed/mbed-os-core for review?

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 8, 2019

Set to needs: CI to execute tests (will come most likely after reviews)

Copy link

@deepikabhavnani deepikabhavnani left a comment

Choose a reason for hiding this comment

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

Change looks good, only concern was for M33 which is fixed in LPC PR.
Not sure if this needs rebase

We might need to document somewhere that this change is only for secure side and US_TICKER is still needed for all targets

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 8, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 9, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit 943254c into ARMmbed:master Mar 14, 2019
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.

7 participants