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

CYW43XXX Cordio HCI driver: fixed MCU deep-sleep locking flow #14982

Merged
merged 1 commit into from
Aug 13, 2021

Conversation

npal-cy
Copy link

@npal-cy npal-cy commented Aug 5, 2021

Summary of changes

Fixed MCU deep-sleep locking flow in CYW43XXX Cordio HCI driver. The CYW43XXX Cordio HCI driver incorrect handles lock/unlock deep-sleep entry, as results it allows to put PSoC6 in to deep-sleep when CYW43xx does not expect this (the host_wake_up pin in ACTIVE_LOW state, which means hat host must be in ACTIVE mode ).

Now, CYW43XXX Cordio HCI driver has the following MCU deep-sleep locking scenarios/flows:
a) A BT device or MCU does not support Low Power mode (MBED configuration does not include MBED_TICKLESS, DEVICE_SLEEP, DEVICE_LPTICKER or CYCFG_BT_LP_ENABLED features). In this case, CyH4TransportDriver locks deep-sleep in the initialize() function and unlocks the terminate() function.

b) A BT device and MCU support Low Power mode. In this case, the control of the unlock/lock of the deep-sleep functionality will be done in bt_host_wake_rise_irq_handler and bt_host_wake_fall_irq_handler handlers. Finally, CyH4TransportDriver unlocks the deep-sleep in terminate() function (if it was locked before) by checking the bt_host_wake_active flag.

Fixes #13076, #13700, #13295.

Impact of changes

Migration actions required

Documentation

None


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)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

Reviewers

@ARMmbed/team-cypress

CY8CKIT_062_WIFI_BT-ble-cordio-hci.pdf
CY8CKIT_062S2_43012-ble-cordio-hci.pdf
CY8CPROTO_062_4343W-ble-cordio-hci.pdf
CYW9P62S1_43012EVB_01-ble-cordio-hci.pdf
CYW9P62S1_43438EVB_01-full.pdf

@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Aug 5, 2021
@ciarmcom ciarmcom requested a review from a team August 5, 2021 21:00
@ciarmcom
Copy link
Member

ciarmcom commented Aug 5, 2021

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

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 6, 2021

Can you amend the first commit to include information provided in description here? it's useful to be there

…CYW43XXX Cordio HCI driver incorrect handles lock/unlock deep-sleep entry, as results it allows to put PSoC6 in to deep-sleep when CYW43xx does not expect this (the host_wake_up pin in ACTIVE_LOW state, which means hat host must be in ACTIVE mode ).

Now, CYW43XXX Cordio HCI driver has the following MCU deep-sleep locking scenarios/flows:
a) A BT device or MCU does not support Low Power mode (MBED configuration does not include MBED_TICKLESS, DEVICE_SLEEP, DEVICE_LPTICKER or CYCFG_BT_LP_ENABLED features). In this case, CyH4TransportDriver locks deep-sleep in the initialize() function and unlocks the terminate() function.

b) A BT device and MCU support Low Power mode. In this case, the control of the unlock/lock of the deep-sleep functionality will be done in bt_host_wake_rise_irq_handler and bt_host_wake_fall_irq_handler handlers. Finally, CyH4TransportDriver unlocks the deep-sleep in terminate() function (if it was locked before) by checking the bt_host_wake_active flag.

Fixes ARMmbed#13076, ARMmbed#13700, ARMmbed#13295.
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 9, 2021

CI started

@mergify mergify bot added needs: CI and removed needs: review labels Aug 9, 2021
@mbed-ci
Copy link

mbed-ci commented Aug 9, 2021

Jenkins CI Test : ✔️ SUCCESS

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

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-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_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-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 ✔️

@ifyall
Copy link

ifyall commented Aug 9, 2021

@0xc0170, is this ready for final approval from a maintainer?
Thank you in advance,
Ian

@npal-cy
Copy link
Author

npal-cy commented Aug 11, 2021

@0xc0170, i see we still have label needs: work. for now i do not expect more update here. Vincent's comment was resolved with out code changes. Looks like it ready for merge.

Regards,
Nazar

@0xc0170 0xc0170 merged commit df00ed4 into ARMmbed:master Aug 13, 2021
@mergify mergify bot removed the ready for merge label Aug 13, 2021
@mbedmain mbedmain added release-version: 6.14.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Aug 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.

CY8CKIT_062S2_43012 Test Fails
7 participants