cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32L151xx_KEIL, __asm(''wfi''); Inline assembler not permitted when generating Thumb Code.

ishmeetsinghis
Associate II
Posted on November 06, 2013 at 04:51

Hi All,

I am using the demo codes provided for stm32l151xx processor, from here --> 

http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1295/LN962/PF251642♯

In the keil projct, I am not able to use __asm(''wfi'');

It gives this error: &sharp1113: Inline assembler not permitted when generating Thumb code.

I also tried 

&sharppragma arm

__asm(''wfi'');

&sharppragma thumb

and adding c compiler options --apcs=/interwork

It gives error: &sharp1114: this feature not supported on target architecture/processor.

Note: on Stm32l151xx_IAR it is working fine.

Anyone have any ideas?

#stm32 #dma #discovery #stm32l
3 REPLIES 3
Posted on November 06, 2013 at 05:13

What version?

__WFI();
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ishmeetsinghis
Associate II
Posted on November 06, 2013 at 05:40

Thanks for the reply,

Did you mean version for KEIL? it is MDK-ARM Basic 4.22

my exact board number is stm32l151rct6a,

I tried using __WFI(); and it seems to compile the code,

Is using this instead of __asm(''wfi''); would create any problems? Please can you share some insights on this.

Posted on November 06, 2013 at 06:02

It's the CMSIS method provided by STM32L1xx_StdPeriph_Lib_V1.2.0\Libraries\CMSIS\Include\core_cmInstr.h and thus a more platform independent route.

In Keil it uses the

http://www.keil.com/support/man/docs/armccref/armccref_CJADIFCI.htm

 intrinsic
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..