lpcware

Building emWin library

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by amlwwalker on Tue Aug 27 07:51:21 MST 2013
Hi
So I'm progressing with a makefile for a simple program to use the hello world example of emWin. Before I add anything emWin related, my board running a LPC1788 succesfully outputs to serial, blinks an led and FreeRTOS works.

I needed to add the config files from the library, so I added this to my makefile
MYSOURCES += $(wildcard $(EMWIN)/emWin522_library/Config/*.c)
MYOBJS_DIR = build/$(CHIP)/obj
OBJS = $(MYSOURCES) $(MYOBJS_DIR)/$(STARTUP).o $(EXTRA_OBJS)

I then got an error saying that it cant find I2C.h
I2C.h and others are in the HW folder from the emWin522BSP folder, so I copy them to another location and add that also to my make file:
MYSOURCES += $(wildcard $(EMWIN)/emWin522_library/HW/*.c)
I also added that folder to my includes, although Im not sure that was the right thing to do:
INCLUDES += -I$(EMWIN)/emWin522_library/HW

This gets rid of the error about I2C succesffully. My HW folder now contains:
HWConf.c  HWConf.h  I2C.c  I2C.h  I2C_PCA9532.c  I2C_PCA9532.h  LPC177x_8x.h  system_LPC177x_8x.h

I think Im getting there.
Im getting a bunch of errors though, that are probably because there are still files that I need to include, however I cant quite tell what the mistake is.

Can anyone point me as to what is causing these errors:


../emWin522/emWin522_library/Config/LCDConf.c: In function '_SSP_Send':
../emWin522/emWin522_library/Config/LCDConf.c:566:16: warning: variable 'Dummy' set but not used [-Wunused-but-set-variable]
../emWin522/emWin522_library/HW/HWConf.c: In function '_EMC_Init':
../emWin522/emWin522_library/HW/HWConf.c:331:16: warning: variable 'Dummy' set but not used [-Wunused-but-set-variable]
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o: In function `__StackTop':
(.stack+0x200): multiple definition of `__StackTop'
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o:(.stack+0x200): first defined here
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o: In function `__StackLimit':
/home/amlwwalker/Documents/lpcopen-make/main/../startup_ARMCM3.S:277: multiple definition of `__StackLimit'
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o:/home/amlwwalker/Documents/lpcopen-make/main/../startup_ARMCM3.S:277: first defined here
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o: In function `__HeapBase':
/home/amlwwalker/Documents/lpcopen-make/main/../startup_ARMCM3.S:277: multiple definition of `__HeapBase'
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o:/home/amlwwalker/Documents/lpcopen-make/main/../startup_ARMCM3.S:277: first defined here
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o: In function `__HeapLimit':
(.heap+0x400): multiple definition of `__HeapLimit'
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o:(.heap+0x400): first defined here
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o: In function `__isr_vector':
/home/amlwwalker/Documents/lpcopen-make/main/../startup_ARMCM3.S:277: multiple definition of `__isr_vector'
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o:/home/amlwwalker/Documents/lpcopen-make/main/../startup_ARMCM3.S:277: first defined here
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o: In function `Reset_Handler':
/home/amlwwalker/Documents/lpcopen-make/main/../startup_ARMCM3.S:277: multiple definition of `Reset_Handler'
build/CHIP_LPC177X_8X/obj/startup_ARMCM3.o:/home/amlwwalker/Documents/lpcopen-make/main/../startup_ARMCM3.S:277: first defined here
/opt/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/bin/ld: world.elf section `.GUI_RAM' will not fit in region `RAM'
/opt/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/bin/ld: region RAM overflowed with stack
/opt/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/bin/ld: region `RAM' overflowed by 13288996 bytes
/tmp/ccqyi4Me.o: In function `_InitSSP':
/home/amlwwalker/Documents/lpcopen-make/main/../emWin522/emWin522_library/Config/LCDConf.c:553: undefined reference to `PeripheralClock'
/tmp/ccqyi4Me.o: In function `LCD_X_Config':
/home/amlwwalker/Documents/lpcopen-make/main/../emWin522/emWin522_library/Config/LCDConf.c:1463: undefined reference to `PeripheralClock'
/tmp/ccqyi4Me.o: In function `_ExecutePCA9532Cmd':
/home/amlwwalker/Documents/lpcopen-make/main/../emWin522/emWin522_library/Config/LCDConf.c:939: undefined reference to `PeripheralClock'
/tmp/ccSk6ChG.o: In function `HW_X_Config':
/home/amlwwalker/Documents/lpcopen-make/main/../emWin522/emWin522_library/HW/HWConf.c:108: undefined reference to `SystemCoreClockUpdate'
/tmp/ccSk6ChG.o: In function `__low_level_init':
/home/amlwwalker/Documents/lpcopen-make/main/../emWin522/emWin522_library/HW/HWConf.c:486: undefined reference to `SystemCoreClockUpdate'
collect2: error: ld returned 1 exit status
make: *** [world.elf] Error 1



Thanks
Alex

Outcomes