EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

"LPC2148_Demo_v120" build under windows with gnuarm and cygwin

Started by acarlosss1 March 19, 2008
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.

An Engineer's Guide to the LPC2100 Series

--- 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

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
> >
>
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
> > > >
> > > >
> > >
> >

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...
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
>
>

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
> > > >
> > > >
> > >
> >




--- 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!
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!




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!
>
>
>
>


The 2024 Embedded Online Conference