Welcome, Guest

Author Topic: LPC2378-STK-examples  (Read 3683 times)


  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
« 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.


  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1642
  • Karma: +42/-2
Re: LPC2378-STK-examples
« Reply #1 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,
Technical support and documentation manager at Olimex


  • Newbie
  • *
  • Posts: 3
  • Karma: +1/-0
Re: LPC2378-STK-examples
« Reply #2 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)
« Last Edit: November 28, 2014, 10:09:45 PM by chapmanag »