Olimex Support Forum

ARM => NXP => Topic started by: wjw67 on June 16, 2013, 05:08:57 AM

Title: LPC2378-STK-examples
Post by: wjw67 on June 16, 2013, 05:08:57 AM
I'm trying to compile the examples for the NXP LPC2378.  IAR embedded workbench gives me errors on the first line of the following:

inline __arm ExtCritSection(Save)
{
unsigned long tmp;
  tmp = __get_CPSR();
  __set_CPSR(tmp & (Save | ~IRQ_FLAG));
}

I don't normally use inline functions, but this doesn't seem right.  I get 26 errors when I try to rebuild the uip_webserver example.
Title: Re: LPC2378-STK-examples
Post by: LubOlimex on June 20, 2013, 11:02:13 AM
Hey wjw67,

Which IAR EW for ARM version do you use?

The example on the web is for the fairly old 5.40 and the example is not directly usable in IAR EW v6.xxx.

Best regards,
Lub/OLIMEX
Title: Re: LPC2378-STK-examples
Post by: chapmanag on November 28, 2014, 09:59:34 PM
I know thia is an old topic but I have just started using an LPC-2378-STK and had the same issue when trying to compile the old examples using a recent (version 7) of IAR embedded workbench

Compilation failures involving methods similar to:
inline __arm ExtCritSection(Save)

Can be solved by modifying your code to be:
inline __arm void ExtCritSection(unsigned long Save)

i.e. Later versions of the compiler expect a return type (void if nothing is returned) and the parameter type is defined (In the code example given by wjw67 parameter "Save" is and'ed with unsigned long variable "tmp" - so it seems logical to declare "Save" as an unsigned long)