Hello,
can not get idle task work correctly with ARM_ENABLE_WFI_IDLE = TRUE and STM32L1 low power sleep mode.
It works fine with modified _idle_thread function:
static void _idle_thread(void *p) {
(void)p;
while (true) {
/*lint -save -e522 [2.2] Apparently no side effects because it contains
an asm instruction.*/
__WFI();
// port_wait_for_interrupt();
// /*lint -restore*/
// CH_CFG_IDLE_LOOP_HOOK();
}
}
Chibios version 16.1.5
Thanks in advance!
--
Vitaly
Idle task and WFI Topic is solved
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Idle task and WFI
Hi,
I am unable to replicate the problem, by setting CORTEX_ENABLE_WFI_IDLE to TRUE a WFI instruction is placed inside the idle loop.
Giovanni
I am unable to replicate the problem, by setting CORTEX_ENABLE_WFI_IDLE to TRUE a WFI instruction is placed inside the idle loop.
Giovanni
Re: Idle task and WFI
Hi,
the problem is in different current consumption:
1. lowest current consumption with __WFI() directly put in while loop. It is about 5uA with one active timer for systick.
2. it is about 30-40uA using inline function port_wait_for_interrupt
compiled with gcc-arm-none-eabi-5_4-2016q3
--
Vitaly
the problem is in different current consumption:
1. lowest current consumption with __WFI() directly put in while loop. It is about 5uA with one active timer for systick.
2. it is about 30-40uA using inline function port_wait_for_interrupt
compiled with gcc-arm-none-eabi-5_4-2016q3
--
Vitaly
Vitaly
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Idle task and WFI
Hi,
In my case WFI is inlined in the idle loop, there is no function call, what compiler options are you using?
Giovanni
In my case WFI is inlined in the idle loop, there is no function call, what compiler options are you using?
Giovanni
Re: Idle task and WFI
# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT =
endif
ifeq ($(USE_OPT),)
USE_OPT = -O0 -ggdb -fomit-frame-pointer -falign-functions=16
endif
# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT =
endif
Vitaly
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Idle task and WFI
Hi,
It is because -O0 (no optimizations), that disables inlining, if you are concerned by consumption you should really use at least -O2.
Giovanni
It is because -O0 (no optimizations), that disables inlining, if you are concerned by consumption you should really use at least -O2.
Giovanni
Who is online
Users browsing this forum: No registered users and 7 guests