LPC11Uxx undefined ref. __ROR

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

LPC11Uxx undefined ref. __ROR

846 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hansLPC on Wed Feb 20 03:19:23 MST 2013
Hi!

I try compile a sample file using the __ROR (rotate right) command. The linker gives me the error: undefined reference to `__ROR'.

Then i have seen that the core function __ROR is not defined in "core_cmInstr.h" (CMSISv2p00_LPC11Uxx) and so I added it by my own:

__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
{

  __ASM volatile ("ror %0, %0, %1" : "+r" (op1) : "r" (op2) );
  return(op1);
}
but i still get the same linker error.

µC: LPC11U14F
LPCExpr: v5.1.0 [Build 2048] [2013-02-05]

Hm, it should be a core instruction:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/BABJCCDH.html

Any suggestions?

Regards hans
0 Kudos
Reply
2 Replies

802 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hansLPC on Wed Feb 20 05:58:26 MST 2013

Quote: Zero

#2 Add it[COLOR=Red] inside GNU[/COLOR] (#elif (defined (__GNUC__)) of "core_cmInstr.h" :eek:



Indeed i was in the "wrong" section!

Works like charm!
Thank you...
0 Kudos
Reply

802 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Feb 20 03:51:00 MST 2013
#1 Try
__attribute__( ( always_inline ) ) static __INLINE uint32_t __ROR(uint32_t op1, uint32_t op2)
{

  __ASM volatile ("ror %0, %0, %1" : "+r" (op1) : "r" (op2) );
  return(op1);
}
#2 Add it[COLOR=Red] inside GNU[/COLOR] (#elif (defined (__GNUC__)) of "core_cmInstr.h" :eek:

#3 Compile your CMSIS (both, Debug and Release)
0 Kudos
Reply