undefined reference to 'asm'

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

undefined reference to 'asm'

跳至解决方案
6,717 次查看
mevon
Contributor II

Hello everyone,

 

I'm trying to switch a project that worked in CW_IDE 10.6 to KDS beta and I have the following error that I cannot find an explanation for:

 

" undefined reference to 'asm' "

 

It comes from the usb stack 4.1.1 in a ProcessorExpert component with a USB_lock() and USB_unlock() define that is like this:

 

#if (defined _MCF51MM256_H) || (defined _MCF51JE256_H)

  #include "usb_lock.h"

  #define USB_lock()   usb_int_dis()

  #define USB_unlock() usb_int_en()

#else

  #ifndef _MK_xxx_H_

  #define USB_lock()                           asm { move.w SR,D0; ori.l #0x0700,D0; move.w D0,SR;  }

  #define USB_unlock()                         asm { move.w SR,D0; andi.l #0xF8FF,D0; move.w D0,SR;  }

  #else

  #ifdef __CC_ARM

  #define USB_lock()                           __disable_irq();

  #define USB_unlock()                         __enable_irq();

  #else

 

// I actually end up in this define

  #define USB_lock()                           asm(" CPSID i");

  #define USB_unlock()                         asm(" CPSIE i");

 

  #endif

  #endif

#endif

 

As I said, it use to work in CodeWarrior now seems KDS as troubles with assambly calls. Is there something special to do to support ASM calls in KDS? I find it really odd, even if I compare the Project Properties, in the Assembler portion, I don't see major differences from CodeWarrior settings to KDS ones. Could it be that I'm missing an ENV variable or a PATH variable that points to support for such assambly calls?

 

Please advise, thank you very much!

Mike

标签 (1)
0 项奖励
回复
1 解答
3,042 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Michel:

This problem is mentioned in Kinetis Design Studio FAQs (under Building):

KDS Frequently Asked Questions (FAQ)

The error is related to language settings. You may also refer to other thread about this:

Sorting out asm(); in KDS: How to change your compiler language to GNU ISO90

Regards!

Jorge Gonzalez

在原帖中查看解决方案

0 项奖励
回复
1 回复
3,043 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Michel:

This problem is mentioned in Kinetis Design Studio FAQs (under Building):

KDS Frequently Asked Questions (FAQ)

The error is related to language settings. You may also refer to other thread about this:

Sorting out asm(); in KDS: How to change your compiler language to GNU ISO90

Regards!

Jorge Gonzalez

0 项奖励
回复