AnsweredAssumed Answered

undefined reference to 'asm'

Question asked by Michel Hebert on Jul 22, 2014
Latest reply on Jul 22, 2014 by Jorge_Gonzalez

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()


  #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;  }


  #ifdef __CC_ARM

  #define USB_lock()                           __disable_irq();

  #define USB_unlock()                         __enable_irq();



// I actually end up in this define

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

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






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!