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

Nuvoton: Enable no HXT/LXT configurability #14721

Merged
merged 3 commits into from
Jun 7, 2021

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented Jun 2, 2021

Summary of changes

This PR tries to enable no HXT/LXT capability of being configurable. LXT/HXT are external crystal oscillator and can be absent on custom board.

  1. By default, HXT is configured to not present in case the substitute HIRC can pass Greentea tests with accuracy.
  2. By default, LXT is configured to present. This is to enable RTC.
  3. When LXT is configured to not present, lp_ticker/watchdog will clock by LIRC instead.
  4. Limitations without HXT/LXT:
    1. On all targets, LIRC-clocked lp_ticker's accuracy is lower than LXT-clocked lp_ticker's.
    2. On all targets, HIRC-clocked PLL-clocked us_ticker's accuracy is lower than HIRC-clocked PLL-clocked us_ticker's.
    3. On NUC472/M453, HIRC-clocked PLL doesn't output 1MHz-aligned frequency. us_ticker's accuracy gets lower with it.
    4. On all targets, LIRC-clocked RTC is not supported.
    5. On M263, TRNG's clock source defaults to LXT and needs special handling without LXT.

Impact of changes

On M252, target.hxt-enable is replaced with target.hxt-present for consistent with other targets.

Migration actions required

  1. On M252, in mbed_app.json, if target.hxt-enable is defined, replace with target.hxt-present.
  2. On all targets, in mbed_app.json, if target.lxt-present is false, also remove RTC device adding target.device_has_remove: ["RTC"].

Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

ccli8 added 3 commits June 2, 2021 09:02
LXT/HXT are external crystl oscillator and can be absent on custom board.
This enables configuring LXT/HXT presence:
1.  By default, LXT/HXT are configured to be present, except M252 which has no HXT.
2.  When LXT is configured to not present, lp_ticker/watchdog will clock by LIRC instead.
3.  Limitations:
    (1) On all targets, LIRC-clocked lp_ticker gets inaccurate and fails to pass tests.
    (2) On NUC472/M453, HIRC-clocked PLL doesn't output 1MHz-aligned frequency. us_ticker gets slight inaccurate.
    (3) On all targets, LIRC-clocked RTC is not supported due to no H/W path/RTC clock source reset to LXT on reset/RTC not trimmed for other clock rates.
4.  On M263, TRNG's clock source defaults to LXT and needs special handling without LXT.
5.  On M252, replace target.hxt-enable with target.hxt-present for consistency.
This is to guard from BSP driver which cannot see this configuration and still uses HXT/LXT.
This is to spare one HXT component in case the substitute HIRC can pass Greentea test with accuracy.
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Jun 2, 2021
@ciarmcom
Copy link
Member

ciarmcom commented Jun 2, 2021

@ccli8, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@ciarmcom ciarmcom requested a review from a team June 2, 2021 03:00
@ciarmcom
Copy link
Member

ciarmcom commented Jun 7, 2021

This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-maintainers, please complete review of the changes to move the PR forward. Thank you for your contributions.

@mergify mergify bot added needs: CI and removed needs: review labels Jun 7, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Jun 7, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented Jun 7, 2021

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@0xc0170 0xc0170 merged commit 1fe0650 into ARMmbed:master Jun 7, 2021
@mergify mergify bot removed ready for merge stale Stale Pull Request labels Jun 7, 2021
@ccli8 ccli8 deleted the nuvoton_no-hxt-lxt branch June 8, 2021 01:19
@mbedmain mbedmain added release-version: 6.12.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Jun 18, 2021
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.

None yet

5 participants