diff options
author | Bobby Casey <bobbycasey@google.com> | 2021-02-22 10:42:20 -0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-07-01 00:02:59 +0000 |
commit | b325538a3dedb7b89680e0d9385899638afd529e (patch) | |
tree | 7f7fcb615611a7525adb9c2d59c737ebdc90e79b /core/cortex-m/task.c | |
parent | 3bdfeba224ba2f64a77d13fd0079d2f185f9cc87 (diff) | |
download | chrome-ec-b325538a3dedb7b89680e0d9385899638afd529e.tar.gz |
cortex-m: Don't execute WFI instruction if debugging
Allowing the processor to sleep causes the debugger to stop working.
BRANCH=none
BUG=b:180144572
TEST=Monitor power per go/cros-fpmcu-source-code-docs#dragonclaw-v0_2
TEST=Icetower (pp3300_dx_mcu_mw) with no debugger connected
Idle: ~44 mW
Low Power Mode: ~5.5 mW
TEST=Icetower (pp3300_dx_mcu_mw) with debugger connected
Idle: ~75 mW
Low Power Mode: ~70 mW
TEST=Dragonclaw (pp3300_dx_mcu_mw) with no debugger connected
Idle: ~22 mW
Low Power Mode: ~1.5 mW
TEST=Dragonclaw (pp3300_dx_mcu_mw) with debugger connected
Idle: ~64 mW
Low Power Mode: ~19 mW
Signed-off-by: Bobby Casey <bobbycasey@google.com>
Change-Id: I48d58395b168dc3bb0932348cd8f5ce088fc0ac9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2713754
Commit-Queue: Tom Hughes <tomhughes@chromium.org>
Tested-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'core/cortex-m/task.c')
-rw-r--r-- | core/cortex-m/task.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index 2ec1ec1dc2..0747978f7e 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -9,6 +9,7 @@ #include "common.h" #include "console.h" #include "cpu.h" +#include "debug.h" #include "link_defs.h" #include "panic.h" #include "task.h" @@ -105,7 +106,7 @@ void __idle(void) * Wait for the next irq event. This stops the CPU clock * (sleep / deep sleep, depending on chip config). */ - asm("wfi"); + cpu_enter_suspend_mode(); #endif } } |