Skip to content

allow rtos idle loop to call sleep(); #3019

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

Closed
wants to merge 1 commit into from
Closed

allow rtos idle loop to call sleep(); #3019

wants to merge 1 commit into from

Conversation

maclobdell
Copy link
Contributor

Description

To enable power efficiency, the rtos loop should call sleep(). To my knowledge, this can be done regardless if the debugger interface is connected (at least it can on the Kinetis MCUs). If the debugger interface is connected, the device may not achieve as great of power savings, but it still can enter low power mode. Something is better than nothing.

Entering low power mode when idle is fundamental to low power / battery powered applications.

Status

Needs CI

Migrations

NO

Related PRs

Same as #2443. Submitting this separate PR due to unknown/unrelated issue preventing the last one to pass CI.

branch PR

N/A

Todos

N/A

Deploy notes

N/A

Steps to test or reproduce

When RTOS idle executes, it will call sleep(), which is implementation specific to the platform. In general, sleep is a very light low power mode, thus should not disrupt anything.

To enable power efficiency, the rtos loop should call sleep().  To my knowledge, this can be done regardless if the debugger interface is connected (at least it can on the Kinetis MCUs).  If the debugger interface is connected, the device may not achieve as great of power savings, but it still can enter low power mode.  Something is better than nothing.
@bulislaw
Copy link
Member

I think it wouldn't hurt us and can save some power even if we wake up every 1ms. We can replace it with tickles mode when we finally get our story together.

@bridadan
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: FAILURE

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

/morph test

Output

mbed Build Number: 0

Build failed!

@bridadan
Copy link
Contributor

Looks like there were some issues with the RZ_A1H and VK_RZ_A1H:

11:10:12 Building project stats (RZ_A1H, ARM)
11:10:12 Scan: ARM
11:10:12 Scan: FEATURE_LWIP
11:10:12 Scan: stats
11:10:12 Compile [100.0%]: main.cpp
11:10:12 Link: stats
11:10:14 Error: L6218E: Undefined symbol sleep (referred from rtos_idle.o).
11:10:14 Finished: 0 information, 0 warning and 1 error messages.

@bulislaw
Copy link
Member

Ah, sleep is not mandatory. You should add #if DEVICE_SLEEP around it.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2016

Ah, sleep is not mandatory. You should add #if DEVICE_SLEEP around it.

@maclobdell Can you respond? And rebase if possible

@sg-
Copy link
Contributor

sg- commented Nov 1, 2016

@maclobdell can you make changes based on feedback?

@sg-
Copy link
Contributor

sg- commented Nov 7, 2016

@maclobdell please reopen when feedback from comments are addressed.

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