Re: stm32f4 __wfi

2019-06-24 Thread Jython
this is the configure: #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER #define CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER #define CONFIGURE_MAXIMUM_TASKS 5 #define CONFIGURE_MAXIMUM_TIMERS3 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE

Re: stm32f4 __wfi

2019-06-24 Thread Jython
now i have changed to RTC wakeup, my key press can wake up the board, //rtems_stack_checker_report_usage(); > > PWR_EnterSTOPMode(1, 1); > > init_main_osc(); > usleep(10); > printf("RCC_CFGR %02x\n", RCC_CFGR & 0xff); > so i think sleep function can't be wake

Re: stm32f4 __wfi

2019-06-24 Thread Christian Mauderer
On 24/06/2019 02:47, Jython wrote: > that's to say EXTI wakes up from sleep function because interrupt > handler log out > but _CPU_Thread_Idle_body does not exit ?  want to know what is the > sleep/idle exit condition? The idle task is the task with the lowest priority. So it runs if no other

Re: stm32f4 __wfi

2019-06-21 Thread Christian Mauderer
On 21/06/2019 11:53, Jython wrote: > i got it ,  i have coded some low power applications with stm32cube last > year, > may i just want to know more about the sleep and why it does not stop by > EXTI , maybe i need to rewrite sleep function ? `sleep()` just suspends your current task. So you will

Re: stm32f4 __wfi

2019-06-21 Thread Jython
i got it , i have coded some low power applications with stm32cube last year, may i just want to know more about the sleep and why it does not stop by EXTI , maybe i need to rewrite sleep function ? On Fri, Jun 21, 2019 at 3:16 PM Christian Mauderer < christian.maude...@embedded-brains.de>

Re: stm32f4 __wfi

2019-06-21 Thread Christian Mauderer
On 21/06/2019 02:58, Jython wrote: > > handler https://gist.github.com/goog/7bf5ec55139a3ed43e36be5b2eee318b There are some things that I would strongly discourage in that interrupt handler (printk as long as it is not only a temporary debug output, delay, ...) but it shouldn't be the problem. I

Re: stm32f4 __wfi

2019-06-21 Thread groups
Jython, You may have better luck asking on the ST support forums. Your questions relate more to the inner workings of the STM32 sleep and interrupt facilities and less about RTEMS. A > On 2019-June-20, at 18:58, Jython wrote: > > > handler

Re: stm32f4 __wfi

2019-06-20 Thread Jython
handler https://gist.github.com/goog/7bf5ec55139a3ed43e36be5b2eee318b the main loop code https://gist.github.com/goog/d83786e0eb2c97ad3126ded1987b5078 when i pressed key, printf("loop begin\n"); does not print immediately so the sleep function does not break On Thu, Jun 20, 2019 at 10:47 PM

Re: stm32f4 __wfi

2019-06-20 Thread Christian Mauderer
On 20/06/2019 16:43, Jython wrote: > sleep function at the ending of loop, the loop did not begin intermediate So just that I understand it correctly: Your have a loop in a task that sends your processor to sleep at the end of the loop. Then you wake up the processor via an interrupt and the

Re: stm32f4 __wfi

2019-06-20 Thread Jython
sleep function at the ending of loop, the loop did not begin intermediate On Thursday, June 20, 2019, Christian Mauderer wrote: > On 20/06/2019 13:25, Jython wrote: > > do have service routine, handler can printk log, SLEEPONEXIT is 0 > > So your handler is called? But it seems that the

Re: stm32f4 __wfi

2019-06-20 Thread Christian Mauderer
On 20/06/2019 13:25, Jython wrote: > do have service routine,  handler can printk log,  SLEEPONEXIT is 0 So your handler is called? But it seems that the processor wakes up then. How does the "won't stop sleep mode" look like? > > On Thu, Jun 20, 2019 at 5:19 PM Christian Mauderer

Re: stm32f4 __wfi

2019-06-20 Thread Jython
do have service routine, handler can printk log, SLEEPONEXIT is 0 On Thu, Jun 20, 2019 at 5:19 PM Christian Mauderer wrote: > On 20/06/2019 10:57, Jython wrote: > > a GPIO EXTI line, > > rtems idle phrase called __wfi, does it make stm32 enter standby mode? > > so key can not wake up it from

Re: stm32f4 __wfi

2019-06-20 Thread Christian Mauderer
On 20/06/2019 10:57, Jython wrote: > a GPIO EXTI line, > rtems idle phrase called __wfi, does it make stm32 enter standby mode? > so key can not wake up it from sleep function Please take a look at the reference manual of your chip. Most likely it's "RM0090 Rev 18" but make sure that's the right

Re: stm32f4 __wfi

2019-06-20 Thread Jython
a GPIO EXTI line, rtems idle phrase called __wfi, does it make stm32 enter standby mode? so key can not wake up it from sleep function void keys_init() > { > // config gpio > stm32f4_gpio_set_config(_key1); // PA12 > stm32f4_gpio_set_config(_key2); > stm32f4_gpio_set_config(_key3); >

Re: stm32f4 __wfi

2019-06-20 Thread Christian Mauderer
On 20/06/2019 05:28, Jython wrote: > hi, it seems that exit key interrupt won't stop sleep mode, why? > > [...] > What do you mean by "exit key interrupt"? I don't know the STM32F4 that well. So please give some more details. I would expect that either only specific interrupt sources can wake

Re: stm32f4 __wfi

2019-04-24 Thread Christian Mauderer
The system tick is responsible for everything timing relevant in RTEMS. So if you want to use functions like sleep or rtems_task_wake_after, you need a tick. If you don't want to use anything timing relevant, you can disable that by (I think) using

Re: stm32f4 __wfi

2019-04-24 Thread Jython
Thanks for your quick reply! the system will wake up every tick, why? does it effect the RTC wakeup? i am also debugging the rtc wakeup, have posted a mail https://lists.rtems.org/pipermail/users/2019-April/033176.html On Wed, Apr 24, 2019 at 4:48 PM Christian Mauderer <

Re: stm32f4 __wfi

2019-04-24 Thread Christian Mauderer
There is the wfi in the Idle body. So as soon as all your tasks are sleeping (via sleep(), rtems_task_wake_after(), waiting for some signals or similar functions) wfi will be called. Note that there most likely is a lot of potential in the drivers to save power. Also note that the system will

Re: stm32f4 __wfi

2019-04-24 Thread Jython
i searched it by add -i 56794:d040 <_CPU_Thread_Idle_body>: 56795-#ifdef ARM_MULTILIB_HAS_WFI 56796- 56797:void *_CPU_Thread_Idle_body( uintptr_t ignored ) 56798-{ 56799- while ( true ) { 56800-__asm__ volatile ("wfi"); 56801-d040:bf30 wfi 56802- } 56803:d042:

Re: stm32f4 __wfi

2019-04-24 Thread Christian Mauderer
For some reason your grep hasn't found the _CPU_Thread_Idle_body. It's possible that the stm32f4 uses some other function for that also I don't know why. For example for the xilinx_zynq_a9_qemu BSP the disassembled idle body looks like follows: void *_CPU_Thread_Idle_body( uintptr_t ignored ) {

Re: stm32f4 __wfi

2019-04-24 Thread Jython
arm-rtems4.11-objdump -dS hello.exe | grep idle --color=auto -n -B 5 -A 12 there is no idle function which calls wfi command // log 508- 509- 510- 511-} 512- 513:if((*USART2_SR) & (1<<4)) // idle 514- 3aa:4b13 ldrr3, [pc, #76]; (3f8 ) 515- 3ac:681b

Re: stm32f4 __wfi

2019-04-24 Thread Christian Mauderer
Am 24.04.19 um 02:35 schrieb Jython: > yes, I need to do low power for stm32f4 > will this line work __asm__ volatile ("wfi");? That line should be correct. Please note that the instruction is already used in the armv7 idle thread:

Re: stm32f4 __wfi

2019-04-23 Thread Jython
yes, I need to do low power for stm32f4 will this line work __asm__ volatile ("wfi");? On Tue, Apr 23, 2019 at 10:28 PM Christian Mauderer < christian.maude...@embedded-brains.de> wrote: > Am 22.04.19 um 09:47 schrieb Jython: > > HI, ALL! > > wfi >

Re: stm32f4 __wfi

2019-04-23 Thread Christian Mauderer
Am 22.04.19 um 09:47 schrieb Jython: > HI, ALL! > wfi http://www.keil.com/support/man/docs/armcc/armcc_chr1359125004400.htm > how can i call the arm __wfi? > > ___ > users mailing list > users@rtems.org > http://lists.rtems.org/mailman/listinfo/users >