How to correctly use intrinsic function __enable_irq()/__disable_irq() on cortex M0 without causing compiler warnings

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to correctly use intrinsic function __enable_irq()/__disable_irq() on cortex M0 without causing compiler warnings

2,871 次查看
malcolmbeale
Contributor I

Hi,

Can anyone please tell me how to use the intrinsic functions __enable_irq() or __disable_irq() in MCUXpresso without having the IDE show an implicit declaration warning. Processor is Cortex M0 (LPC11Axx) and I've included the header core_cmFunc.h which appears to contain them.

Are there any more header files to be included in my source file or something special to be done in the project build settings? Please note the processor is in power up and not running with any privilege settings as far as I can tell.

These global enable and disable interrupt functions earlier used to be in core_cm0.h but don't appear there in the new MCUXpresso IDE.

Thanks in advance.

Regards

Malcolm

0 项奖励
回复
4 回复数

2,462 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Malcolm,

What about your project ?

On my side , It seems we can also find it on the core_cm0.h file :

pastedImage_1.png

Hope it helps


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

2,462 次查看
malcolmbeale
Contributor I

Hi Alice,

Thanks for getting back and I appreciate the feed back. Apologies for the slow response but the warning seemed to have disappeared when I deleted the project and started again from scratch. Its quite likely that it may have been caused by selecting a standard C project and then attempting to build up from that point; when using a MCUXpresso project it appears to have gone.

To my understanding I should be able to build up an embedded project even with a standard C configuration by correctly configuring the project settings manually, I've done such things in the past. Its possible that something goes on (xml?) in selecting a MCXpresso project that's not visible to me. Since it fixed itself I didn't investigate further; I will if it does show up again and post comments here.

Lastly, the __enable_irq(), etc. appear in the "core_cmFunc.h" for me and not in "core_cm0.h" where it used to be earlier. I did see the functions you mention above in the "core_cm0.h" file and tried to use them as well. So if its any help to others, starting over from scratch might clear their problem for now.

Thanks and regards

Malcolm

0 项奖励
回复

2,462 次查看
lpcxpresso_supp
NXP Employee
NXP Employee

The location of these functions depends upon what version of CMSIS Core header files you are using.

For example, the simple LPC11A examples provided with MCUXpresso IDE (in /ide/Examples/Legacy/NXP/LPC1000/LPC11Axx), although based on what is now quite an old version of CMSIS do indeed include these functions in core_cmFunc.h. However if you simply include LPC11Axx.h, that should automatically include all required CMSIS headers.

Note that I believe that the example package Alice used in her screenshot (the LPCOpen package for LPC11 / LPC11C) is not generally suitable for the LPC11A family.

Regards,

MCUXpesso IDE Support.

0 项奖励
回复

2,462 次查看
malcolmbeale
Contributor I

Thanks MCUXpresso IDE support for the feedback, everything seems to be working good for now.

Regards

Malcolm

0 项奖励
回复