Reply by ghetto_shinobi March 21, 20082008-03-21
--- In l..., "profdc9" wrote:
>
> Okay, to make life easier on everyone (except unfortunately for the
> moderator), I uploaded my entire LPC2148 Demo tree with libraries to
> the Files section. It should just work with "make clean/make" under
> WinARM.
>
> It is at
>
> "LPC2148_Demo_compiled_with_WinARM.zip"
> Dan

Thanks Dan i will for sure check your package but right now i'm still
struggling with my build.Once more i tried to build it with libc
obtained from your minibasic port.After first build i still receive
bunch of errors and so after second time.Issuing a make for third time
gives no errors and i can see .hex file in project folder.Any idea
what's going on?

Regards.
=======================================================================Groups related to lpc2000
=======================================================================
msp430 (388 common members)
http://groups.yahoo.com/group/msp430?v=1&t=ipt&ch=email&pub=groups&slktr0&sec=recg
Computers & Internet/Hardware: Welcome to the MSP430 User's Group! The purpose of...

AVR-Chat (177 common members)
http://groups.yahoo.com/group/AVR-Chat?v=1&t=ipt&ch=email&pub=groups&slktr1&sec=recg
Microprocessors/Microcontrollers: A place for Atmel AVR Microcontroller users to sha...

LTspice (165 common members)
http://groups.yahoo.com/group/LTspice?v=1&t=ipt&ch=email&pub=groups&slktr2&sec=recg
Engineering/Electrical: Dedicated to the exchange of information about LTs...

Homebrew_PCBs (157 common members)
http://groups.yahoo.com/group/Homebrew_PCBs?v=1&t=ipt&ch=email&pub=groups&slktr3&sec=recg
Engineering/Electrical: Designing, making, etching, soldering, printed cir...

e-embedded (151 common members)
http://groups.yahoo.com/group/e-embedded?v=1&t=ipt&ch=email&pub=groups&slktr4&sec=recg
Internet/Internet Appliances: Open-membership mailing list for embedded system d...

An Engineer's Guide to the LPC2100 Series

Reply by ghetto_shinobi March 21, 20082008-03-21
--- In l..., "J.C. Wren" wrote:
>
> Don't apologize. In the next release, I'll be sure to mention that
> for you folks that have to suffer working in a Windoze environment.
>
> --jc
>
> On Thu, Mar 20, 2008 at 9:21 PM, Carlos Santos wrote:
> >
> >
> >
> >
> >
> >
> > Hello again,
> >
> > Nevermind the questions about makefiles� It was a problem with
the windoze
> > PATH environment variable� It was because of the openocd entry in
the PATH
> > E.V. (conflicts between cygwin and openocd sh.exe � inside the
"C:\Program
> > Files\openocd-r423\utils\bin" directory). Just removed the 2
entries of the
> > openocd in the PATH and everything compiled at the first time�
> >
> > Sorry for the previous posts about this ;)
> >
> >
> > Regards,
> >
> > Carlos.

I still can't get it to work on windows.There seems to be a problem
with lib.Here's what i get :

c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(freer.o):
In function `_malloc_trim_r':
mallocr.c:(.text+0x48): undefined reference to `_sbrk_r'
mallocr.c:(.text+0x64): undefined reference to `_sbrk_r'
mallocr.c:(.text+0x84): undefined reference to `_sbrk_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(mallocr.o)
: In function `_malloc_r':
mallocr.c:(.text+0x424): undefined reference to `_sbrk_r'
mallocr.c:(.text+0x4cc): undefined reference to `_sbrk_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(stdio.o):
In function `__sclose':
stdio.c:(.text+0xc): undefined reference to `_close_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(stdio.o):
In function `__sseek':
stdio.c:(.text+0x30): undefined reference to `_lseek_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(stdio.o):
In function `__swrite':
stdio.c:(.text+0x84): undefined reference to `_lseek_r'
stdio.c:(.text+0xac): undefined reference to `_write_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(stdio.o):
In function `__sread':
stdio.c:(.text+0xd0): undefined reference to `_read_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(sysclose.o
): In function `close':
sysclose.c:(.text+0xc): undefined reference to `_close_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(sysgettod.
o): In function `gettimeofday':
sysgettod.c:(.text+0x14): undefined reference to `_gettimeofday_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(sysopen.o)
: In function `open':
sysopen.c:(.text+0x2c): undefined reference to `_open_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(sysread.o)
: In function `read':
sysread.c:(.text+0x24): undefined reference to `_read_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(syssbrk.o)
: In function `sbrk':
syssbrk.c:(.text+0xc): undefined reference to `_sbrk_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(systimes.o
): In function `times':
systimes.c:(.text+0xc): undefined reference to `_times_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(sysunlink.
o): In function `unlink':
sysunlink.c:(.text+0xc): undefined reference to `_unlink_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(syswrite.o
): In function `write':
syswrite.c:(.text+0x24): undefined reference to `_write_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(time.o):
I
n function `time':
time.c:(.text+0x1c): undefined reference to `_gettimeofday_r'
c:/winarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/lib\libg.a(makebuf.o)
: In function `__smakebuf':
makebuf.c:(.text+0x3c): undefined reference to `_fstat_r'
collect2: ld returned 1 exit status
make[1]: *** [lpc2148.elf] Error 1
make: *** [all] Error 2

I've also tried to use library from minibasic as mentioned in Dan's
post but that also gave me a bunch of errors.

Regards!
Reply by "J.C. Wren" March 20, 20082008-03-20
Don't apologize. In the next release, I'll be sure to mention that
for you folks that have to suffer working in a Windoze environment.

--jc

On Thu, Mar 20, 2008 at 9:21 PM, Carlos Santos wrote:
> Hello again,
>
> Nevermind the questions about makefiles It was a problem with the windoze
> PATH environment variable It was because of the openocd entry in the PATH
> E.V. (conflicts between cygwin and openocd sh.exe inside the "C:\Program
> Files\openocd-r423\utils\bin" directory). Just removed the 2 entries of the
> openocd in the PATH and everything compiled at the first time
>
> Sorry for the previous posts about this ;)
> Regards,
>
> Carlos.
>
> De: l... [mailto:l...] Em nome de
> ghetto_shinobi
> Enviada: sexta-feira, 21 de Mar de 2008 0:40
> Para: l...
> Assunto: [lpc2000] Re: "LPC2148_Demo_v120" build under windows with gnuarm
> and cygwin
>
> --- In l... , "Carlos
>
> Santos" wrote:
> >
> > Hello,
> >
> >
> >
> > Dan, I used your makefile with the following modifications:
> >
> > export ROOT=G:/LPC2148_Demo # <-- this is the dir where I have my files
> >
> >
> >
> > and exchanged
> >
> > $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
> -nostdlib
> > lib/libc.a lib/libgcc.a
> >
> > by
> >
> > $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0)
> > $(LINKER_FLAGS)
> >
> > (like in the original Makefile that came with the examples)
> >
> >
> >
> > I�m getting the same kind of links like before, after compiling
> all
> the
> > files. The problem is in the linking phase. Here�s some of the
> errors I get:
> > I am also having problems with building your demo under Windows with
> WinArm installed.
>
> Regards!
>
>
>
>

Reply by Carlos Santos March 20, 20082008-03-20
Hello again,



Nevermind the questions about makefiles It was a problem with the windoze
PATH environment variable It was because of the openocd entry in the PATH
E.V. (conflicts between cygwin and openocd sh.exe inside the C:\Program
Files\openocd-r423\utils\bin directory). Just removed the 2 entries of the
openocd in the PATH and everything compiled at the first time



Sorry for the previous posts about this ;)



Regards,

Carlos.



De: l... [mailto:l...] Em nome de
ghetto_shinobi
Enviada: sexta-feira, 21 de Mar de 2008 0:40
Para: l...
Assunto: [lpc2000] Re: "LPC2148_Demo_v120" build under windows with gnuarm
and cygwin



--- In l... , "Carlos
Santos" wrote:
>
> Hello,
>
>
>
> Dan, I used your makefile with the following modifications:
>
> export ROOT=G:/LPC2148_Demo # <-- this is the dir where I have my files
>
>
>
> and exchanged
>
> $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
-nostdlib
> lib/libc.a lib/libgcc.a
>
> by
>
> $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0)
> $(LINKER_FLAGS)
>
> (like in the original Makefile that came with the examples)
>
>
>
> I�m getting the same kind of links like before, after compiling all
the
> files. The problem is in the linking phase. Here�s some of the
errors I get:
>

I am also having problems with building your demo under Windows with
WinArm installed.

Regards!




Reply by ghetto_shinobi March 20, 20082008-03-20
--- In l..., "Carlos Santos" wrote:
>
> Hello,
>
>
>
> Dan, I used your makefile with the following modifications:
>
> export ROOT=G:/LPC2148_Demo # <-- this is the dir where I have my files
>
>
>
> and exchanged
>
> $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
-nostdlib
> lib/libc.a lib/libgcc.a
>
> by
>
> $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0)
> $(LINKER_FLAGS)
>
> (like in the original Makefile that came with the examples)
>
>
>
> I�m getting the same kind of links like before, after compiling all the
> files. The problem is in the linking phase. Here�s some of the
errors I get:
>

I am also having problems with building your demo under Windows with
WinArm installed.

Regards!
Reply by Carlos Santos March 20, 20082008-03-20
Hello,



Dan, I used your makefile with the following modifications:

export ROOT=G:/LPC2148_Demo # <-- this is the dir where I have my files



and exchanged

$(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS) -nostdlib
lib/libc.a lib/libgcc.a

by

$(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0)
$(LINKER_FLAGS)

(like in the original Makefile that came with the examples)



Im getting the same kind of links like before, after compiling all the
files. The problem is in the linking phase. Heres some of the errors I get:



arm-elf-gcc -Wall -Wextra -Wshadow -Wpointer-arith -Wbad-function-cast
-Wcast-align -Wsign-compare -Waggregate-return -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-declarations -Wunused -D
RUN_MODE=RUN_FROM_ROM -D GCC_ARM7 -IG:/LPC2148_Demo
-IG:/LPC2148_Demo/FreeRTOS/include -mcpu=arm7tdmi -Tlpc2148-rom.ld -g -O3
-fomit-frame-pointer -D CFG_CONSOLE_UART0 main.o -nostartfiles boot.s
G:/LPC2148_Demo/common/common.a -Xlinker -olpc2148.elf -Xlinker -M -Xlinker
-Map=lpc2148.map

G:/LPC2148_Demo/common/common.a(tasks.o): In function
`ulTaskEndTrace':/cygdrive/g/LPC2148_Demo/FreeRTOS/tasks.c:1311: undefined
reference to `vPortEnterCritical'

/cygdrive/g/LPC2148_Demo/FreeRTOS/tasks.c:1313: undefined reference to
`vPortExitCritical'

G:/LPC2148_Demo/common/common.a(tasks.o): In function
`vTaskStartTrace':/cygdrive/g/LPC2148_Demo/FreeRTOS/tasks.c:1292: undefined
reference to `vPortEnterCritical'



Im almost getting to the point of compiling this in linux, but I have to
install and setup the arm toolchain and didnt want to go trough this

Can someone give advice here?



Regards,

Carlos.





De: l... [mailto:l...] Em nome de J.C.
Wren
Enviada: quinta-feira, 20 de Mar de 2008 2:56
Para: l...
Assunto: Re: [lpc2000] Re: "LPC2148_Demo_v120" build under windows with
gnuarm and cygwin



Ah, cool. I'll have to load up the Winders version of the tool chain
and try it out. The newlib I use is the one that the Gentoo
'crossdev' tool selects.

Thanks,
--kc

On Wed, Mar 19, 2008 at 10:45 PM, profdc9 > wrote:
> One more thing.... your demo requires the version of newlib without
> the syscall stubs and without reentrant syscalls. WinARM and most
> distributions don't have this. I compiled a newlib with this. It
> should be in the distribution of
>
> minibasic-arm-0.5e.zip
>
> in the LPC2000 Group files section. There is a libc.a, libm.a, and
> libg.a in there that should work with the LPC 2148 demo. I had to
> include "-nostartfiles" in the linker line so it would use my stripped
> down newlib rather than the full version. You can distribute this
> library with your code if you wish (it's just a customized newlib).
>
> Dan
> --- In l... ,
"profdc9" wrote:
> >
> > No problem, your LPC2148 demo is awesome, please go ahead. I have
> > referred to it extensively in building my latest project, which I hope
> > to unveil soon.
> >
> >
> > Dan
> >
> > --- In l... ,
"J.C. Wren" wrote:
> > >
> > > Dan, if you don't mind, I'd like to include your Makefile in my next
> > > release. I've made a handful of changes to the codebase for another
> > > project, and have plans in the next couple weeks to backport them into
> > > the demo code.
> > >
> > > --jc
> > >
> > > On Wed, Mar 19, 2008 at 10:32 PM, profdc9 wrote:
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --- In l... ,
"acarlosss1" wrote:
> > > > >
> > > > > Hello all,
> > > > >
> > > > > Has anybody managed to build this "demo package" from "J.C.
> > Wren" in
> > > > > windows with cygwin/gnuarm ?
> > > > > I'm getting a lot of errors... All files compile OK (with some
> > minor
> > > > > warnings), but the linking won't work. I think it's because of
> > > > > cygwin's handling of windows directories... I.E.,
> > "G:\LPC2148_Demo" is
> > > > > translated by cygwin by "/cygdrive/g/LPC2148_Demo", as you can
> > see in
> > > > > the "pwd" command answer below:
> > > > > "
> > > > > G:\LPC2148_Demo>pwd
> > > > > /cygdrive/g/LPC2148_Demo
> > > > > "
> > > > >
> > > > > I've modified the root Makefile in the "ROOT" environment
> variable
> > > > > from "export ROOT=$(shell pwd)" to "export
> > ROOT=G:/LPC2148_Demo" and
> > > > > all files compile OK, but in the linking I get *a lot* of errors,
> > > > > because (i guess) of the "common.a" file that has references
> to the
> > > > > "/cygdrive/g/LPC2148_Demo" notation instead of
> > "G:\LPC2148_Demo" used
> > > > > by windows.
> > > > >
> > > > > So, has someone successfully built this package under
> > > > > windows/gnuarm/cygwin ?
> > > > >
> > > > > Best regards,
> > > > > Carlos Santos.
> > > > >
> > > >
> > > > Yup, here's my Makefile for WinARM:
> > > >
> > > > .SILENT:
> > > >
> > > > #
> > > > # -D CFG_CONSOLE_USB for console on USB
> > > > # -D CFG_CONSOLE_UART0 for console on UART0
> > > > # -D CFG_CONSOLE_UART1 for console on UART1 instead of USB
> (disables
> > > > GPS task, baud rate set to 115200)
> > > > # -D CFG_USB_MSC to use SD/MMC as a mass storage class device
> > > > over USB
> > > > #
> > > > export LPC2148DEMO_OPTS=-D CFG_CONSOLE_UART0
> > > >
> > > > #
> > > > # These shouldn't need to be changed
> > > > #
> > > > export CC=arm-elf-gcc
> > > > export AR=arm-elf-ar
> > > > export OBJCOPY=arm-elf-objcopy
> > > > export OBJDUMP=arm-elf-objdump
> > > > export CRT0=boot.s
> > > > export WARNINGS=-Wall -Wextra -Wshadow -Wpointer-arith
> > > > -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return
> > > > -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
> > -Wunused
> > > > export CFLAGS=$(WARNINGS) -D RUN_MODE=RUN_FROM_ROM -D GCC_ARM7
> > > > $(INCLUDES) $(BASEINCLUDE) -mcpu=arm7tdmi -T$(LDSCRIPT) -g -O3
> > > > -fomit-frame-pointer $(LPC2148DEMO_OPTS)
> > > > export LDSCRIPT=lpc2148-rom.ld
> > > > export LINKER_FLAGS=$(COMMON)/common.a -Xlinker -olpc2148.elf
> > -Xlinker
> > > > -M -Xlinker -Map=lpc2148.map
> > > > export ROOT=c:/lpc2148/LPC2148_Demo
> > > > export BASEINCLUDE=-I$(ROOT) -I$(ROOT)/FreeRTOS/include
> > > > export COMMON=$(ROOT)/common
> > > >
> > > > #
> > > > # Project sub-directories
> > > > #
> > > > SUBDIRS=FreeRTOS adc cpu dac eints fatfs fiq gps i2c iap leds
> monitor
> > > > newlib rtc sensors swi uart usb usbmass usbser
> > > >
> > > > SRC_FILES = main.c
> > > >
> > > > ARM_OBJ = $(SRC_FILES:.c=.o)
> > > >
> > > > .PHONY: all
> > > > all :
> > > > @for i in $(SUBDIRS); do \
> > > > (cd $$i; $(MAKE) $(MFLAGS) $(MYMAKEFLAGS) all); done
> > > > make lpc2148.hex
> > > >
> > > > lpc2148.hex : .depend Makefile lpc2148.elf
> > > > $(OBJCOPY) lpc2148.elf -O ihex lpc2148.hex
> > > > # @echo "Length is " `grep __"end_of_text__ = ." *.map | cut -b
> > 17-35`
> > > > "bytes"
> > > >
> > > > lpc2148.elf : .depend Makefile $(ARM_OBJ) $(COMMON)/common.a
> $(CRT0)
> > > > $(LDSCRIPT)
> > > > $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
> > > > -nostdlib lib/libc.a lib/libgcc.a
> > > > $(OBJDUMP) -d -S lpc2148.elf >lpc2148.lst
> > > >
> > > > $(ARM_OBJ) : %.o : %.c Makefile .depend
> > > > $(CC) -c $(CFLAGS) $< -o $@
> > > >
> > > > #
> > > > # The .depend files contains the list of header files that the
> > > > # various source files depend on. By doing this, we'll only
> > > > # rebuild the .o's that are affected by header files changing.
> > > > #
> > > > .depend:
> > > > $(CC) $(CFLAGS) -M $(SRC_FILES) > .depend
> > > >
> > > > ifeq (.depend,$(wildcard .depend))
> > > > include .depend
> > > > endif
> > > >
> > > > ---
> > > > Dan
> > > >
> > > >
> > >
> >




Reply by "J.C. Wren" March 20, 20082008-03-20
Dan, if you don't mind, I'd like to include your Makefile in my next
release. I've made a handful of changes to the codebase for another
project, and have plans in the next couple weeks to backport them into
the demo code.

--jc

On Wed, Mar 19, 2008 at 10:32 PM, profdc9 wrote:
> --- In l..., "acarlosss1" wrote:
> >
> > Hello all,
> >
> > Has anybody managed to build this "demo package" from "J.C. Wren" in
> > windows with cygwin/gnuarm ?
> > I'm getting a lot of errors... All files compile OK (with some minor
> > warnings), but the linking won't work. I think it's because of
> > cygwin's handling of windows directories... I.E., "G:\LPC2148_Demo" is
> > translated by cygwin by "/cygdrive/g/LPC2148_Demo", as you can see in
> > the "pwd" command answer below:
> > "
> > G:\LPC2148_Demo>pwd
> > /cygdrive/g/LPC2148_Demo
> > "
> >
> > I've modified the root Makefile in the "ROOT" environment variable
> > from "export ROOT=$(shell pwd)" to "export ROOT=G:/LPC2148_Demo" and
> > all files compile OK, but in the linking I get *a lot* of errors,
> > because (i guess) of the "common.a" file that has references to the
> > "/cygdrive/g/LPC2148_Demo" notation instead of "G:\LPC2148_Demo" used
> > by windows.
> >
> > So, has someone successfully built this package under
> > windows/gnuarm/cygwin ?
> >
> > Best regards,
> > Carlos Santos.
> > Yup, here's my Makefile for WinARM:
>
> .SILENT:
>
> #
> # -D CFG_CONSOLE_USB for console on USB
> # -D CFG_CONSOLE_UART0 for console on UART0
> # -D CFG_CONSOLE_UART1 for console on UART1 instead of USB (disables
> GPS task, baud rate set to 115200)
> # -D CFG_USB_MSC to use SD/MMC as a mass storage class device
> over USB
> #
> export LPC2148DEMO_OPTS=-D CFG_CONSOLE_UART0
>
> #
> # These shouldn't need to be changed
> #
> export CC=arm-elf-gcc
> export AR=arm-elf-ar
> export OBJCOPY=arm-elf-objcopy
> export OBJDUMP=arm-elf-objdump
> export CRT0=boot.s
> export WARNINGS=-Wall -Wextra -Wshadow -Wpointer-arith
> -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return
> -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wunused
> export CFLAGS=$(WARNINGS) -D RUN_MODE=RUN_FROM_ROM -D GCC_ARM7
> $(INCLUDES) $(BASEINCLUDE) -mcpu=arm7tdmi -T$(LDSCRIPT) -g -O3
> -fomit-frame-pointer $(LPC2148DEMO_OPTS)
> export LDSCRIPT=lpc2148-rom.ld
> export LINKER_FLAGS=$(COMMON)/common.a -Xlinker -olpc2148.elf -Xlinker
> -M -Xlinker -Map=lpc2148.map
> export ROOT=c:/lpc2148/LPC2148_Demo
> export BASEINCLUDE=-I$(ROOT) -I$(ROOT)/FreeRTOS/include
> export COMMON=$(ROOT)/common
>
> #
> # Project sub-directories
> #
> SUBDIRS=FreeRTOS adc cpu dac eints fatfs fiq gps i2c iap leds monitor
> newlib rtc sensors swi uart usb usbmass usbser
>
> SRC_FILES = main.c
>
> ARM_OBJ = $(SRC_FILES:.c=.o)
>
> .PHONY: all
> all :
> @for i in $(SUBDIRS); do \
> (cd $$i; $(MAKE) $(MFLAGS) $(MYMAKEFLAGS) all); done
> make lpc2148.hex
>
> lpc2148.hex : .depend Makefile lpc2148.elf
> $(OBJCOPY) lpc2148.elf -O ihex lpc2148.hex
> # @echo "Length is " `grep __"end_of_text__ = ." *.map | cut -b 17-35`
> "bytes"
>
> lpc2148.elf : .depend Makefile $(ARM_OBJ) $(COMMON)/common.a $(CRT0)
> $(LDSCRIPT)
> $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
> -nostdlib lib/libc.a lib/libgcc.a
> $(OBJDUMP) -d -S lpc2148.elf >lpc2148.lst
>
> $(ARM_OBJ) : %.o : %.c Makefile .depend
> $(CC) -c $(CFLAGS) $< -o $@
>
> #
> # The .depend files contains the list of header files that the
> # various source files depend on. By doing this, we'll only
> # rebuild the .o's that are affected by header files changing.
> #
> .depend:
> $(CC) $(CFLAGS) -M $(SRC_FILES) > .depend
>
> ifeq (.depend,$(wildcard .depend))
> include .depend
> endif
>
> ---
> Dan
>
>

Reply by profdc9 March 20, 20082008-03-20
One more thing.... your demo requires the version of newlib without
the syscall stubs and without reentrant syscalls. WinARM and most
distributions don't have this. I compiled a newlib with this. It
should be in the distribution of

minibasic-arm-0.5e.zip

in the LPC2000 Group files section. There is a libc.a, libm.a, and
libg.a in there that should work with the LPC 2148 demo. I had to
include "-nostartfiles" in the linker line so it would use my stripped
down newlib rather than the full version. You can distribute this
library with your code if you wish (it's just a customized newlib).

Dan

--- In l..., "profdc9" wrote:
>
> No problem, your LPC2148 demo is awesome, please go ahead. I have
> referred to it extensively in building my latest project, which I hope
> to unveil soon.
> Dan
>
> --- In l..., "J.C. Wren" wrote:
> >
> > Dan, if you don't mind, I'd like to include your Makefile in my next
> > release. I've made a handful of changes to the codebase for another
> > project, and have plans in the next couple weeks to backport them into
> > the demo code.
> >
> > --jc
> >
> > On Wed, Mar 19, 2008 at 10:32 PM, profdc9 wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > --- In l..., "acarlosss1" wrote:
> > > >
> > > > Hello all,
> > > >
> > > > Has anybody managed to build this "demo package" from "J.C.
> Wren" in
> > > > windows with cygwin/gnuarm ?
> > > > I'm getting a lot of errors... All files compile OK (with some
> minor
> > > > warnings), but the linking won't work. I think it's because of
> > > > cygwin's handling of windows directories... I.E.,
> "G:\LPC2148_Demo" is
> > > > translated by cygwin by "/cygdrive/g/LPC2148_Demo", as you can
> see in
> > > > the "pwd" command answer below:
> > > > "
> > > > G:\LPC2148_Demo>pwd
> > > > /cygdrive/g/LPC2148_Demo
> > > > "
> > > >
> > > > I've modified the root Makefile in the "ROOT" environment
variable
> > > > from "export ROOT=$(shell pwd)" to "export
> ROOT=G:/LPC2148_Demo" and
> > > > all files compile OK, but in the linking I get *a lot* of errors,
> > > > because (i guess) of the "common.a" file that has references
to the
> > > > "/cygdrive/g/LPC2148_Demo" notation instead of
> "G:\LPC2148_Demo" used
> > > > by windows.
> > > >
> > > > So, has someone successfully built this package under
> > > > windows/gnuarm/cygwin ?
> > > >
> > > > Best regards,
> > > > Carlos Santos.
> > > >
> > >
> > > Yup, here's my Makefile for WinARM:
> > >
> > > .SILENT:
> > >
> > > #
> > > # -D CFG_CONSOLE_USB for console on USB
> > > # -D CFG_CONSOLE_UART0 for console on UART0
> > > # -D CFG_CONSOLE_UART1 for console on UART1 instead of USB
(disables
> > > GPS task, baud rate set to 115200)
> > > # -D CFG_USB_MSC to use SD/MMC as a mass storage class device
> > > over USB
> > > #
> > > export LPC2148DEMO_OPTS=-D CFG_CONSOLE_UART0
> > >
> > > #
> > > # These shouldn't need to be changed
> > > #
> > > export CC=arm-elf-gcc
> > > export AR=arm-elf-ar
> > > export OBJCOPY=arm-elf-objcopy
> > > export OBJDUMP=arm-elf-objdump
> > > export CRT0=boot.s
> > > export WARNINGS=-Wall -Wextra -Wshadow -Wpointer-arith
> > > -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return
> > > -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
> -Wunused
> > > export CFLAGS=$(WARNINGS) -D RUN_MODE=RUN_FROM_ROM -D GCC_ARM7
> > > $(INCLUDES) $(BASEINCLUDE) -mcpu=arm7tdmi -T$(LDSCRIPT) -g -O3
> > > -fomit-frame-pointer $(LPC2148DEMO_OPTS)
> > > export LDSCRIPT=lpc2148-rom.ld
> > > export LINKER_FLAGS=$(COMMON)/common.a -Xlinker -olpc2148.elf
> -Xlinker
> > > -M -Xlinker -Map=lpc2148.map
> > > export ROOT=c:/lpc2148/LPC2148_Demo
> > > export BASEINCLUDE=-I$(ROOT) -I$(ROOT)/FreeRTOS/include
> > > export COMMON=$(ROOT)/common
> > >
> > > #
> > > # Project sub-directories
> > > #
> > > SUBDIRS=FreeRTOS adc cpu dac eints fatfs fiq gps i2c iap leds
monitor
> > > newlib rtc sensors swi uart usb usbmass usbser
> > >
> > > SRC_FILES = main.c
> > >
> > > ARM_OBJ = $(SRC_FILES:.c=.o)
> > >
> > > .PHONY: all
> > > all :
> > > @for i in $(SUBDIRS); do \
> > > (cd $$i; $(MAKE) $(MFLAGS) $(MYMAKEFLAGS) all); done
> > > make lpc2148.hex
> > >
> > > lpc2148.hex : .depend Makefile lpc2148.elf
> > > $(OBJCOPY) lpc2148.elf -O ihex lpc2148.hex
> > > # @echo "Length is " `grep __"end_of_text__ = ." *.map | cut -b
> 17-35`
> > > "bytes"
> > >
> > > lpc2148.elf : .depend Makefile $(ARM_OBJ) $(COMMON)/common.a
$(CRT0)
> > > $(LDSCRIPT)
> > > $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
> > > -nostdlib lib/libc.a lib/libgcc.a
> > > $(OBJDUMP) -d -S lpc2148.elf >lpc2148.lst
> > >
> > > $(ARM_OBJ) : %.o : %.c Makefile .depend
> > > $(CC) -c $(CFLAGS) $< -o $@
> > >
> > > #
> > > # The .depend files contains the list of header files that the
> > > # various source files depend on. By doing this, we'll only
> > > # rebuild the .o's that are affected by header files changing.
> > > #
> > > .depend:
> > > $(CC) $(CFLAGS) -M $(SRC_FILES) > .depend
> > >
> > > ifeq (.depend,$(wildcard .depend))
> > > include .depend
> > > endif
> > >
> > > ---
> > > Dan
> > >
> > >
>
=======================================================================Groups related to lpc2000
=======================================================================
msp430 (388 common members)
http://groups.yahoo.com/group/msp430?v=1&t=ipt&ch=email&pub=groups&slktr0&sec=recg
Computers & Internet/Hardware: Welcome to the MSP430 User's Group! The purpose of...

AVR-Chat (177 common members)
http://groups.yahoo.com/group/AVR-Chat?v=1&t=ipt&ch=email&pub=groups&slktr1&sec=recg
Microprocessors/Microcontrollers: A place for Atmel AVR Microcontroller users to sha...

LTspice (165 common members)
http://groups.yahoo.com/group/LTspice?v=1&t=ipt&ch=email&pub=groups&slktr2&sec=recg
Engineering/Electrical: Dedicated to the exchange of information about LTs...

Homebrew_PCBs (157 common members)
http://groups.yahoo.com/group/Homebrew_PCBs?v=1&t=ipt&ch=email&pub=groups&slktr3&sec=recg
Engineering/Electrical: Designing, making, etching, soldering, printed cir...

e-embedded (151 common members)
http://groups.yahoo.com/group/e-embedded?v=1&t=ipt&ch=email&pub=groups&slktr4&sec=recg
Internet/Internet Appliances: Open-membership mailing list for embedded system d...
Reply by "J.C. Wren" March 20, 20082008-03-20
Ah, cool. I'll have to load up the Winders version of the tool chain
and try it out. The newlib I use is the one that the Gentoo
'crossdev' tool selects.

Thanks,
--kc

On Wed, Mar 19, 2008 at 10:45 PM, profdc9 wrote:
> One more thing.... your demo requires the version of newlib without
> the syscall stubs and without reentrant syscalls. WinARM and most
> distributions don't have this. I compiled a newlib with this. It
> should be in the distribution of
>
> minibasic-arm-0.5e.zip
>
> in the LPC2000 Group files section. There is a libc.a, libm.a, and
> libg.a in there that should work with the LPC 2148 demo. I had to
> include "-nostartfiles" in the linker line so it would use my stripped
> down newlib rather than the full version. You can distribute this
> library with your code if you wish (it's just a customized newlib).
>
> Dan
> --- In l..., "profdc9" wrote:
> >
> > No problem, your LPC2148 demo is awesome, please go ahead. I have
> > referred to it extensively in building my latest project, which I hope
> > to unveil soon.
> >
> >
> > Dan
> >
> > --- In l..., "J.C. Wren" wrote:
> > >
> > > Dan, if you don't mind, I'd like to include your Makefile in my next
> > > release. I've made a handful of changes to the codebase for another
> > > project, and have plans in the next couple weeks to backport them into
> > > the demo code.
> > >
> > > --jc
> > >
> > > On Wed, Mar 19, 2008 at 10:32 PM, profdc9 wrote:
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --- In l..., "acarlosss1" wrote:
> > > > >
> > > > > Hello all,
> > > > >
> > > > > Has anybody managed to build this "demo package" from "J.C.
> > Wren" in
> > > > > windows with cygwin/gnuarm ?
> > > > > I'm getting a lot of errors... All files compile OK (with some
> > minor
> > > > > warnings), but the linking won't work. I think it's because of
> > > > > cygwin's handling of windows directories... I.E.,
> > "G:\LPC2148_Demo" is
> > > > > translated by cygwin by "/cygdrive/g/LPC2148_Demo", as you can
> > see in
> > > > > the "pwd" command answer below:
> > > > > "
> > > > > G:\LPC2148_Demo>pwd
> > > > > /cygdrive/g/LPC2148_Demo
> > > > > "
> > > > >
> > > > > I've modified the root Makefile in the "ROOT" environment
> variable
> > > > > from "export ROOT=$(shell pwd)" to "export
> > ROOT=G:/LPC2148_Demo" and
> > > > > all files compile OK, but in the linking I get *a lot* of errors,
> > > > > because (i guess) of the "common.a" file that has references
> to the
> > > > > "/cygdrive/g/LPC2148_Demo" notation instead of
> > "G:\LPC2148_Demo" used
> > > > > by windows.
> > > > >
> > > > > So, has someone successfully built this package under
> > > > > windows/gnuarm/cygwin ?
> > > > >
> > > > > Best regards,
> > > > > Carlos Santos.
> > > > >
> > > >
> > > > Yup, here's my Makefile for WinARM:
> > > >
> > > > .SILENT:
> > > >
> > > > #
> > > > # -D CFG_CONSOLE_USB for console on USB
> > > > # -D CFG_CONSOLE_UART0 for console on UART0
> > > > # -D CFG_CONSOLE_UART1 for console on UART1 instead of USB
> (disables
> > > > GPS task, baud rate set to 115200)
> > > > # -D CFG_USB_MSC to use SD/MMC as a mass storage class device
> > > > over USB
> > > > #
> > > > export LPC2148DEMO_OPTS=-D CFG_CONSOLE_UART0
> > > >
> > > > #
> > > > # These shouldn't need to be changed
> > > > #
> > > > export CC=arm-elf-gcc
> > > > export AR=arm-elf-ar
> > > > export OBJCOPY=arm-elf-objcopy
> > > > export OBJDUMP=arm-elf-objdump
> > > > export CRT0=boot.s
> > > > export WARNINGS=-Wall -Wextra -Wshadow -Wpointer-arith
> > > > -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return
> > > > -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
> > -Wunused
> > > > export CFLAGS=$(WARNINGS) -D RUN_MODE=RUN_FROM_ROM -D GCC_ARM7
> > > > $(INCLUDES) $(BASEINCLUDE) -mcpu=arm7tdmi -T$(LDSCRIPT) -g -O3
> > > > -fomit-frame-pointer $(LPC2148DEMO_OPTS)
> > > > export LDSCRIPT=lpc2148-rom.ld
> > > > export LINKER_FLAGS=$(COMMON)/common.a -Xlinker -olpc2148.elf
> > -Xlinker
> > > > -M -Xlinker -Map=lpc2148.map
> > > > export ROOT=c:/lpc2148/LPC2148_Demo
> > > > export BASEINCLUDE=-I$(ROOT) -I$(ROOT)/FreeRTOS/include
> > > > export COMMON=$(ROOT)/common
> > > >
> > > > #
> > > > # Project sub-directories
> > > > #
> > > > SUBDIRS=FreeRTOS adc cpu dac eints fatfs fiq gps i2c iap leds
> monitor
> > > > newlib rtc sensors swi uart usb usbmass usbser
> > > >
> > > > SRC_FILES = main.c
> > > >
> > > > ARM_OBJ = $(SRC_FILES:.c=.o)
> > > >
> > > > .PHONY: all
> > > > all :
> > > > @for i in $(SUBDIRS); do \
> > > > (cd $$i; $(MAKE) $(MFLAGS) $(MYMAKEFLAGS) all); done
> > > > make lpc2148.hex
> > > >
> > > > lpc2148.hex : .depend Makefile lpc2148.elf
> > > > $(OBJCOPY) lpc2148.elf -O ihex lpc2148.hex
> > > > # @echo "Length is " `grep __"end_of_text__ = ." *.map | cut -b
> > 17-35`
> > > > "bytes"
> > > >
> > > > lpc2148.elf : .depend Makefile $(ARM_OBJ) $(COMMON)/common.a
> $(CRT0)
> > > > $(LDSCRIPT)
> > > > $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
> > > > -nostdlib lib/libc.a lib/libgcc.a
> > > > $(OBJDUMP) -d -S lpc2148.elf >lpc2148.lst
> > > >
> > > > $(ARM_OBJ) : %.o : %.c Makefile .depend
> > > > $(CC) -c $(CFLAGS) $< -o $@
> > > >
> > > > #
> > > > # The .depend files contains the list of header files that the
> > > > # various source files depend on. By doing this, we'll only
> > > > # rebuild the .o's that are affected by header files changing.
> > > > #
> > > > .depend:
> > > > $(CC) $(CFLAGS) -M $(SRC_FILES) > .depend
> > > >
> > > > ifeq (.depend,$(wildcard .depend))
> > > > include .depend
> > > > endif
> > > >
> > > > ---
> > > > Dan
> > > >
> > > >
> > >
> >

Reply by profdc9 March 19, 20082008-03-19
No problem, your LPC2148 demo is awesome, please go ahead. I have
referred to it extensively in building my latest project, which I hope
to unveil soon.
Dan

--- In l..., "J.C. Wren" wrote:
>
> Dan, if you don't mind, I'd like to include your Makefile in my next
> release. I've made a handful of changes to the codebase for another
> project, and have plans in the next couple weeks to backport them into
> the demo code.
>
> --jc
>
> On Wed, Mar 19, 2008 at 10:32 PM, profdc9 wrote:
> >
> >
> >
> >
> >
> >
> > --- In l..., "acarlosss1" wrote:
> > >
> > > Hello all,
> > >
> > > Has anybody managed to build this "demo package" from "J.C.
Wren" in
> > > windows with cygwin/gnuarm ?
> > > I'm getting a lot of errors... All files compile OK (with some
minor
> > > warnings), but the linking won't work. I think it's because of
> > > cygwin's handling of windows directories... I.E.,
"G:\LPC2148_Demo" is
> > > translated by cygwin by "/cygdrive/g/LPC2148_Demo", as you can
see in
> > > the "pwd" command answer below:
> > > "
> > > G:\LPC2148_Demo>pwd
> > > /cygdrive/g/LPC2148_Demo
> > > "
> > >
> > > I've modified the root Makefile in the "ROOT" environment variable
> > > from "export ROOT=$(shell pwd)" to "export
ROOT=G:/LPC2148_Demo" and
> > > all files compile OK, but in the linking I get *a lot* of errors,
> > > because (i guess) of the "common.a" file that has references to the
> > > "/cygdrive/g/LPC2148_Demo" notation instead of
"G:\LPC2148_Demo" used
> > > by windows.
> > >
> > > So, has someone successfully built this package under
> > > windows/gnuarm/cygwin ?
> > >
> > > Best regards,
> > > Carlos Santos.
> > >
> >
> > Yup, here's my Makefile for WinARM:
> >
> > .SILENT:
> >
> > #
> > # -D CFG_CONSOLE_USB for console on USB
> > # -D CFG_CONSOLE_UART0 for console on UART0
> > # -D CFG_CONSOLE_UART1 for console on UART1 instead of USB (disables
> > GPS task, baud rate set to 115200)
> > # -D CFG_USB_MSC to use SD/MMC as a mass storage class device
> > over USB
> > #
> > export LPC2148DEMO_OPTS=-D CFG_CONSOLE_UART0
> >
> > #
> > # These shouldn't need to be changed
> > #
> > export CC=arm-elf-gcc
> > export AR=arm-elf-ar
> > export OBJCOPY=arm-elf-objcopy
> > export OBJDUMP=arm-elf-objdump
> > export CRT0=boot.s
> > export WARNINGS=-Wall -Wextra -Wshadow -Wpointer-arith
> > -Wbad-function-cast -Wcast-align -Wsign-compare -Waggregate-return
> > -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wunused
> > export CFLAGS=$(WARNINGS) -D RUN_MODE=RUN_FROM_ROM -D GCC_ARM7
> > $(INCLUDES) $(BASEINCLUDE) -mcpu=arm7tdmi -T$(LDSCRIPT) -g -O3
> > -fomit-frame-pointer $(LPC2148DEMO_OPTS)
> > export LDSCRIPT=lpc2148-rom.ld
> > export LINKER_FLAGS=$(COMMON)/common.a -Xlinker -olpc2148.elf
-Xlinker
> > -M -Xlinker -Map=lpc2148.map
> > export ROOT=c:/lpc2148/LPC2148_Demo
> > export BASEINCLUDE=-I$(ROOT) -I$(ROOT)/FreeRTOS/include
> > export COMMON=$(ROOT)/common
> >
> > #
> > # Project sub-directories
> > #
> > SUBDIRS=FreeRTOS adc cpu dac eints fatfs fiq gps i2c iap leds monitor
> > newlib rtc sensors swi uart usb usbmass usbser
> >
> > SRC_FILES = main.c
> >
> > ARM_OBJ = $(SRC_FILES:.c=.o)
> >
> > .PHONY: all
> > all :
> > @for i in $(SUBDIRS); do \
> > (cd $$i; $(MAKE) $(MFLAGS) $(MYMAKEFLAGS) all); done
> > make lpc2148.hex
> >
> > lpc2148.hex : .depend Makefile lpc2148.elf
> > $(OBJCOPY) lpc2148.elf -O ihex lpc2148.hex
> > # @echo "Length is " `grep __"end_of_text__ = ." *.map | cut -b
17-35`
> > "bytes"
> >
> > lpc2148.elf : .depend Makefile $(ARM_OBJ) $(COMMON)/common.a $(CRT0)
> > $(LDSCRIPT)
> > $(CC) $(CFLAGS) $(ARM_OBJ) -nostartfiles $(CRT0) $(LINKER_FLAGS)
> > -nostdlib lib/libc.a lib/libgcc.a
> > $(OBJDUMP) -d -S lpc2148.elf >lpc2148.lst
> >
> > $(ARM_OBJ) : %.o : %.c Makefile .depend
> > $(CC) -c $(CFLAGS) $< -o $@
> >
> > #
> > # The .depend files contains the list of header files that the
> > # various source files depend on. By doing this, we'll only
> > # rebuild the .o's that are affected by header files changing.
> > #
> > .depend:
> > $(CC) $(CFLAGS) -M $(SRC_FILES) > .depend
> >
> > ifeq (.depend,$(wildcard .depend))
> > include .depend
> > endif
> >
> > ---
> > Dan
> >
>