Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Sponsor

controlSUITE™ software
Comprehensive.
Intuitive.
Optimized.

Real-world software for real-time control. Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | LPC2000 | Compiling for lpc on linux system


Advertise Here

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

Compiling for lpc on linux system - Aditya Bankar - Jan 31 5:07:45 2009

Hi,

I want to know how to compile programs written in C and in assembly on Linux based host system. I don't want to use linux on my microcontroller. I saw that uClibc document. It seems that this library is for compiling software for ARM microcontroller running Linux on it.
Say I just want to assemble the instruction: MOV R0, #10H
And say I just want to compile the program:
main()
{
int a,b,c;
a=3,b=5;
c=a+b;
}

How can I do it with as (gcc assembler) and gcc compiler respectively?

Thanks,
Aditya

Bring your gang together. Do your thing. Find your favourite Yahoo! group at http://in.promos.yahoo.com/groups/

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


Re: Compiling for lpc on linux system - Alexey Vyskubov - Feb 1 8:56:02 2009

> I want to know how to compile programs written in C and in assembly
> on Linux based host system. I don't want to use linux on my
> microcontroller. I saw that uClibc document. It seems that this
> library is for compiling software for ARM microcontroller running
> Linux on it.
> Say I just want to assemble the instruction: MOV R0, #10H
> And say I just want to compile the program:
> main()
> {
> int a,b,c;
> a=3,b=5;
> c=a+b;
> }
>
> How can I do it with as (gcc assembler) and gcc compiler respectively?

You need to have toolchain, startup file and linker script. Toolchain
you can compile yourself (I documented my own experience here: http://only.mawhrin.net/~alexey/prg/lpc2103/toolchain/)
. Startup file and linker script are board-specific. When you have all
three components, you just do the compilation; see http://only.mawhrin.net/~alexey/prg/lpc2103/tutorial-hello/
for an example of doing something with the board without C library.

--
Alexey

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Compiling for lpc on linux system - rtstofer - Feb 1 9:46:46 2009

--- In l...@yahoogroups.com, Alexey Vyskubov wrote:
>
> > I want to know how to compile programs written in C and in assembly
> > on Linux based host system. I don't want to use linux on my
> > microcontroller. I saw that uClibc document. It seems that this
> > library is for compiling software for ARM microcontroller running
> > Linux on it.
> > Say I just want to assemble the instruction: MOV R0, #10H
> > And say I just want to compile the program:
> > main()
> > {
> > int a,b,c;
> > a=3,b=5;
> > c=a+b;
> > }
> >
> > How can I do it with as (gcc assembler) and gcc compiler respectively?
>
> You need to have toolchain, startup file and linker script. Toolchain
> you can compile yourself (I documented my own experience here:
http://only.mawhrin.net/~alexey/prg/lpc2103/toolchain/)
> . Startup file and linker script are board-specific. When you have all
> three components, you just do the compilation; see
http://only.mawhrin.net/~alexey/prg/lpc2103/tutorial-hello/
> for an example of doing something with the board without C library.
>
> --
> Alexey
>

Eventually, you will need a C library. Newlib is the easiest to use.

Grab all of the latest toolchain from www.gnuarm.org (NOT
www.gnuarm.com) and follow the build instructions on the Support tab.
You need to build the toolchain with these instructions for it to be
aware of the library. This part of the configure command enables
newlib: --with-newlib --with-headers=[newlib-source]/newlib/libc/include

Newlib provides stubs for IO and memory management code that you have
to provide. After all, newlib can't possibly know who to send bytes
out the serial port. Heap management is another nightmare. For
examples of the stub code look at www.jcwren.com/arm Grab the Linux
download and look in the newlib subdirectory of the archive.

It is possible to build applications without using the C library but
you have to provide all of the get & put functions as well as all of
the string functions. But it can be done...

You will also want an IDE See http://www.eclipse.org/downloads/ and
grab the version for C/C++ Development

The GNU documentation is here: http://www.gnu.org/manual/

Richard

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

RE: Re: Compiling for lpc on linux system - "FreeRTOS.org Info" - Feb 1 12:05:59 2009

> Grab all of the latest toolchain from www.gnuarm.org (NOT
> www.gnuarm.com) and follow the build instructions on the Support tab.

...or download a pre-built version.
http://www.codesourcery.com/gnu_toolchains/arm/portal/release642

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.FreeRTOS.org/Documentation
New FreeRTOS eBook - learn how to use an RTOS.

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Re: Compiling for lpc on linux system - Aditya Bankar - Feb 2 1:40:28 2009

Thanks for help. I will try this in evening time today.

________________________________
From: FreeRTOS.org Info
To: l...@yahoogroups.com
Sent: Sunday, 1 February, 2009 10:35:45 PM
Subject: RE: [lpc2000] Re: Compiling for lpc on linux system
> Grab all of the latest toolchain from www.gnuarm.org (NOT
> www.gnuarm.com) and follow the build instructions on the Support tab.

...or download a pre-built version.
http://www.codesour cery.com/ gnu_toolchains/ arm/portal/ release642

Regards,
Richard.

+ http://www.FreeRTOS .org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.FreeRTOS .org/Documentati on
New FreeRTOS eBook - learn how to use an RTOS.

Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )