Crossworks compiler error

Everything ARM and LPC

Moderator: phalanx

Post Reply
Mahmoud899
Posts: 2
Joined: Thu Jul 14, 2011 12:15 pm

Crossworks compiler error

Post by Mahmoud899 » Fri Aug 14, 2015 2:49 pm

Hello I am new to the Crossworks ARM complier and the the ARM Microcontrollers. I decided to use the NXP LPC2101 microcontroller and learn it. I downloaded the Crossworks ARM Compiler. I downloaded the following packages:

A) Crossworks Tasking Library Package.

B) NXP LPC2000 CPU Support Package.

I created a new project using the following steps:

1) File -> New Project

2) Choose: An Executable for NXP LPC2100 and Next

3) Choose: Additional Output Format: .hex and Target Processor: LPC2101 and Finish

4) In the sources folder I created main.c file and wrote the following code in it:

Code: Select all

#include <targets/LPC2000.h>
#include <targets/liblpc2000.h>

void main()
{
  GPIO0_IODIR |= (1<<10);
  GPIO0_IOSET |= (1<<10);
}
I get the following errors when I build the project:

" 'GPIO0_IODIR' undeclared (first use in this function) "

" each undeclared identifier is reported only once for each function it appears in "

" 'GPIO0_IOSET' undeclared (first use in this function) "


I have the following questions. First am I using the correct header files that include the names of the registers of the LPC2101? How can I solve the compiler error.


Thank You

cfb
Posts: 214
Joined: Sat Aug 30, 2008 11:50 pm
Contact:

Re: Crossworks compiler error

Post by cfb » Fri Aug 14, 2015 5:54 pm

If you are using Crossworks (or any other commercial development tool) I recommend that you contact the tool developers first as they are most likely to be able to help you with questions related to the use of their tools. Their support URL is:

https://rowley.zendesk.com/home
Chris Burrows
Astrobe: ARM Cortex-M3, Cortex-M4 and Xilinx FPGA Development System
http://www.astrobe.com

gm
Posts: 203
Joined: Fri May 04, 2007 3:08 pm

Re: Crossworks compiler error

Post by gm » Mon Aug 17, 2015 7:16 am

Looking at LPC2010.h, I did not see a definition of GPIO0_IODIR, but I did see IO0DIR defined. Changing your code to

Code: Select all

#include <targets/LPC2000.h>
#include <targets/liblpc2000.h>

void main()
{
  IO0DIR |= (1<<10);
  IO0SET |= (1<<10);
}
got it past the error but then I got an error saying there wasn't enough RAM for the stack. Looking at the project properties I saw the heap using 1024 bytes. Reducing it down to 128 byte allowed me to compile.

Post Reply