Skip to content

NUC472: Workaround for unknown error with power-down #10436

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
Apr 26, 2019

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented Apr 18, 2019

Description

On NUC472, on wake-up from power-down mode, we may meet hard fault or some other unknown error. Before its cause is found, this PR tries to give a workaround by entering idle mode instead. To simulate power-down mode with idle mode, us_ticker clock is also disabled during power-down period.

Pull request type

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

On NUC472, on wake-up from power-down mode, we may meet hard fault or some other
unknown error. Before its cause is found, we enter idle mode instead for a workaround.
To simulate power-down mode with idle mode, we also disable us_ticker during
power-down period.
@ciarmcom ciarmcom requested review from Ronny-Liu and a team April 18, 2019 03:00
@ciarmcom
Copy link
Member

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

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.

Is there tracking issue for this fault during startup?

@ccli8
Copy link
Contributor Author

ccli8 commented Apr 18, 2019

s there tracking issue for this fault during startup?

@0xc0170 what do you mean by "startup"?

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 18, 2019

On NUC472, on wake-up from power-down mode

Sorry, wake-up I meant

@ccli8
Copy link
Contributor Author

ccli8 commented Apr 18, 2019

@0xc0170 This issue was checked before, but conclude nothing. Currently, we can only use the workaround. The side effect is power consumption.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 18, 2019

I am just after: "Where is this issue being tracked" so we do not forget about it.

@ccli8
Copy link
Contributor Author

ccli8 commented Apr 19, 2019

Where is this issue being tracked

@0xc0170 It is tracked internally.

@@ -49,9 +56,11 @@ void hal_deepsleep(void)
}
#endif

CLK_DisableModuleClock(nu_us_ticker_modinit()->clkidx);
Copy link
Contributor

Choose a reason for hiding this comment

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

How about free us_ticker instead here? So that you don't risk receiving unwanted interrupt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Ronny-Liu The sequence of us_ticker_free() > CLK_Idle() > us_ticker_init() in hal_deepsleep() will reset us_ticker counter. Some tests like mbed-os-tests-mbed_hal-sleep and mbed-os-tests-mbed_hal-sleep_manager require us_ticker counter to continue on wake-up from power-down. Besides, hal_deepsleep() is called in interrupt-disabled context by sleep_manager_sleep_auto(), so the unwanted interrupt can be avoided.

@adbridge
Copy link
Contributor

ci started

@mbed-ci
Copy link

mbed-ci commented Apr 26, 2019

Test run: SUCCESS

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

@adbridge adbridge merged commit 4020c6d into ARMmbed:master Apr 26, 2019
@cyliangtw cyliangtw deleted the nuvoton_nuc472_fix_power-down branch March 9, 2023 05:26
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