undefined reference to 'asm'

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

undefined reference to 'asm'

Jump to solution
6,012 Views
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

Labels (1)
0 Kudos
1 Solution
2,337 Views
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

View solution in original post

0 Kudos
1 Reply
2,338 Views
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 Kudos