stm32f4 __wfi

Christian Mauderer christian.mauderer at embedded-brains.de
Wed Apr 24 06:59:24 UTC 2019


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:

https://git.rtems.org/rtems/tree/cpukit/score/cpu/arm/armv7-thread-idle.c#n32

The stm32f4 is a Cortex-M4 so it's quite likely that this routine is
used. You can check by doing an "arm-rtems5-objdump -dS" on your file
and search for the idle body.

With kind regards

Christian

> 
> 
> On Tue, Apr 23, 2019 at 10:28 PM Christian Mauderer
> <christian.mauderer at embedded-brains.de
> <mailto:christian.mauderer at embedded-brains.de>> wrote:
> 
>     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 at rtems.org <mailto:users at rtems.org>
>     > http://lists.rtems.org/mailman/listinfo/users
>     >
> 
>     Hello Jython,
> 
>     WFI is an assembler instruction. The Keil wrapper isn't available in
>     gcc. I know of no direct replacement. Most likely you need a gcc inline
>     assembly for that.
> 
>     May I ask why you would need "wfi"? If you use a operating system, the
>     system typically handles such low level stuff for you. The only
>     application that springs to mind for that instruction is overwriting the
>     idle loop to save energy.
> 
>     Best regards
> 
>     Christian
> 
>     -- 
>     --------------------------------------------
>     embedded brains GmbH
>     Herr Christian Mauderer
>     Dornierstr. 4
>     D-82178 Puchheim
>     Germany
>     email: christian.mauderer at embedded-brains.de
>     <mailto:christian.mauderer at embedded-brains.de>
>     Phone: +49-89-18 94 741 - 18
>     Fax:   +49-89-18 94 741 - 08
>     PGP: Public key available on request.
> 
>     Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
> 

-- 
--------------------------------------------
embedded brains GmbH
Herr Christian Mauderer
Dornierstr. 4
D-82178 Puchheim
Germany
email: christian.mauderer at embedded-brains.de
Phone: +49-89-18 94 741 - 18
Fax:   +49-89-18 94 741 - 08
PGP: Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list