stm32f4 __wfi

Jython googcheng at gmail.com
Thu Jun 20 08:57:32 UTC 2019


 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(&io_key1);  // PA12
> stm32f4_gpio_set_config(&io_key2);
>     stm32f4_gpio_set_config(&io_key3);
> stm32f4_gpio_set_config(&io_key4);
>
>
>     //  SYSCFGEN and exit map
> (*(uint32_t*)0x40023844) |= 1<<14;
>
>     SYSCFG_EXTICR3 = 0;
>     SYSCFG_EXTICR4 = 0;
>
>
>
>     // EXIT INIT
> EXTI_IMR |= (1<<12);
> EXTI_RTSR |= (1<<12);
>
>     EXTI_IMR |= (1<<11);
> EXTI_RTSR |= (1<<11);
>
>     EXTI_IMR |= (1<<10);
> EXTI_RTSR |= (1<<10);
>
>     EXTI_IMR |= (1<<9);
> EXTI_RTSR |= (1<<9);
>
>
>     //NVIC_Init
>     //NVIC it group2
>
> SCB_AIRCR = 0x05FA0000 | 0x500;
> // ip Interrupt priority register x
>
> //(*(volatile uint8_t*)0xE000E417) = 0xe0;  //23
>     //(*(volatile uint8_t*)0xE000E428) = 0xe0;  // 40
>     (*(volatile uint8_t*)0xE000E417) = 0x50;  //23
>     (*(volatile uint8_t*)0xE000E428) = 0x50;  // 40
>
>
>
> // 23 40 Interrupt set-enable register x (NVIC_ISERx)
>     // nvic enable interrupter number
>     // 0xE000E100
>     (*(volatile uint32_t*)0xE000E100) |= (1<<23);
>     (*(volatile uint32_t *)0xE000E104) |= (1<< (40%32));
> }
>

On Thu, Jun 20, 2019 at 4:05 PM Christian Mauderer <list at c-mauderer.de>
wrote:

> 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 up
> the processor from a deep sleep mode or that you can configure which
> peripherals are still active. If your "exit key" is a GPIO line with
> interrupt capability you should have a look at whether the module is
> still active.
>
> Best regards
>
> Christian
>
> _______________________________________________
> users mailing list
> users at rtems.org
> http://lists.rtems.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20190620/255924f1/attachment.html>


More information about the users mailing list