Skip to content

Fixed a problem that the STOP2 was falling back to STOP1 #3663

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 2 commits into from
Feb 13, 2017
Merged

Fixed a problem that the STOP2 was falling back to STOP1 #3663

merged 2 commits into from
Feb 13, 2017

Conversation

helmut64
Copy link
Contributor

The LPR was not turned on when entering into STOP2. Now the deepsleep mode on the STM32L4 Nucleo board needs only 1.6uA instead of 10uA.

This is described in the STM RM0351 Reference manual, Section PWR registers BIT-14
Note: Stop 2 mode cannot be entered when LPR bit is set. Stop 1 is entered instead.

I am pretty happy that I figured this out.

Regards Helmut

the LPR was not turned on. Now the deepsleep mode only needs 1.6uA
instead of 10uA.
@0xc0170
Copy link
Contributor

0xc0170 commented Jan 31, 2017

@helmut64
Copy link
Contributor Author

stm32l4 stromverbrauch

@bcostm
Copy link
Contributor

bcostm commented Jan 31, 2017

Thanks Helmut to have found this 😄

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 1, 2017

/morph test

@mbed-bot
Copy link

mbed-bot commented Feb 1, 2017

Result: SUCCESS

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

/morph test

Output

mbed Build Number: 1490

All builds and test passed!

Copy link
Contributor

@sg- sg- left a comment

Choose a reason for hiding this comment

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

Please update code style

int pwrClockEnabled = __HAL_RCC_PWR_IS_CLK_ENABLED();
int lowPowerModeEnabled = PWR->CR1 & PWR_CR1_LPR;

if (!pwrClockEnabled)
Copy link
Contributor

Choose a reason for hiding this comment

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

code style violation needs '{'

__HAL_RCC_PWR_CLK_ENABLE();
HAL_PWREx_EnableLowPowerRunMode();
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
if (lowPowerModeEnabled)
Copy link
Contributor

Choose a reason for hiding this comment

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

code style violation needs '{'


HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

if (lowPowerModeEnabled)
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto


if (lowPowerModeEnabled)
HAL_PWREx_EnableLowPowerRunMode();
if (!pwrClockEnabled)
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@sg-
Copy link
Contributor

sg- commented Feb 9, 2017

/morph test

@mbed-bot
Copy link

mbed-bot commented Feb 9, 2017

Result: SUCCESS

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

/morph test

Output

mbed Build Number: 1545

All builds and test passed!

@sg- sg- merged commit e22f26f into ARMmbed:master Feb 13, 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.

5 participants