November 22, 2024, 11:53:42 PM

LPC2378-STK-examples

Started by wjw67, June 16, 2013, 05:08:57 AM

Previous topic - Next topic

wjw67

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.

LubOlimex

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
Technical support and documentation manager at Olimex

chapmanag

#2
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)