From a4cef8ba42643736d94e4e0ede3b217739339ee3 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 29 Mar 2015 09:40:45 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7829 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/LPC21xx/RT-LPC214x-OLIMEX/Makefile | 26 ++++++----- demos/various/RT-ARM7-GENERIC/Makefile | 32 ++++++++++---- demos/various/RT-ARM7-GENERIC/ch.ld | 43 ------------------- .../ARM/compilers/GCC/mk/startup_lpc214x.mk | 9 ++++ .../ARM/compilers/GCC/mk/port_generic.mk | 4 +- .../ARM/compilers/GCC/mk/port_lpc214x.mk | 12 ------ test/hal/testbuild/Makefile | 33 +++++++------- test/nil/testbuild/Makefile | 41 ++++++++++-------- 8 files changed, 89 insertions(+), 111 deletions(-) delete mode 100644 demos/various/RT-ARM7-GENERIC/ch.ld create mode 100644 os/common/ports/ARM/compilers/GCC/mk/startup_lpc214x.mk delete mode 100644 os/rt/ports/ARM/compilers/GCC/mk/port_lpc214x.mk diff --git a/demos/LPC21xx/RT-LPC214x-OLIMEX/Makefile b/demos/LPC21xx/RT-LPC214x-OLIMEX/Makefile index cac35743f..d3a36d30b 100644 --- a/demos/LPC21xx/RT-LPC214x-OLIMEX/Makefile +++ b/demos/LPC21xx/RT-LPC214x-OLIMEX/Makefile @@ -30,7 +30,7 @@ endif # Enable this if you want link time optimizations (LTO) ifeq ($(USE_LTO),) - USE_LTO = no + USE_LTO = yes endif # If enabled, this option allows to compile the application in THUMB mode. @@ -105,26 +105,32 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../.. +# Startup files. +include $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/mk/startup_lpc214x.mk +# HAL-OSAL files (optional). include $(CHIBIOS)/os/hal/hal.mk -include $(CHIBIOS)/os/hal/boards/OLIMEX_LPC_P2148/board.mk include $(CHIBIOS)/os/hal/ports/LPC/LPC214x/platform.mk +include $(CHIBIOS)/os/hal/boards/OLIMEX_LPC_P2148/board.mk include $(CHIBIOS)/os/hal/osal/rt/osal.mk +# RTOS files (optional). include $(CHIBIOS)/os/rt/rt.mk -include $(CHIBIOS)/os/rt/ports/ARM/compilers/GCC/mk/port_lpc214x.mk +include $(CHIBIOS)/os/rt/ports/ARM/compilers/GCC/mk/port_generic.mk +# Other files (optional). include $(CHIBIOS)/test/rt/test.mk # Define linker script file here -LDSCRIPT = $(PORTLD)/LPC2148.ld +LDSCRIPT= $(STARTUPLD)/LPC2148.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CSRC = $(PORTSRC) \ +CSRC = $(STARTUPSRC) \ $(KERNSRC) \ - $(TESTSRC) \ - $(HALSRC) \ + $(PORTSRC) \ $(OSALSRC) \ + $(HALSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ + $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -152,10 +158,10 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = $(PORTASM) +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ - $(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \ +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ $(CHIBIOS)/os/various # diff --git a/demos/various/RT-ARM7-GENERIC/Makefile b/demos/various/RT-ARM7-GENERIC/Makefile index 4244d8c9f..88509cc81 100644 --- a/demos/various/RT-ARM7-GENERIC/Makefile +++ b/demos/various/RT-ARM7-GENERIC/Makefile @@ -35,7 +35,7 @@ endif # If enabled, this option allows to compile the application in THUMB mode. ifeq ($(USE_THUMB),) - USE_THUMB = yes + USE_THUMB = no endif # Enable this if you want to see the full log while compiling. @@ -105,16 +105,32 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../.. +# Startup files. +include $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/mk/startup_lpc214x.mk +# HAL-OSAL files (optional). +#include $(CHIBIOS)/os/hal/hal.mk +#include $(CHIBIOS)/os/hal/ports/LPC/LPC214x/platform.mk +#include $(CHIBIOS)/os/hal/boards/OLIMEX_LPC_P2148/board.mk +#include $(CHIBIOS)/os/hal/osal/rt/osal.mk +# RTOS files (optional). include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/rt/ports/ARM/compilers/GCC/mk/port_generic.mk +# Other files (optional). +#include $(CHIBIOS)/test/rt/test.mk # Define linker script file here -LDSCRIPT= ch.ld +LDSCRIPT= $(STARTUPLD)/LPC2148.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CSRC = $(PORTSRC) \ +CSRC = $(STARTUPSRC) \ $(KERNSRC) \ + $(PORTSRC) \ + $(OSALSRC) \ + $(HALSRC) \ + $(PLATFORMSRC) \ + $(BOARDSRC) \ + $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -142,13 +158,11 @@ TCSRC = TCPPSRC = # List ASM source files here -ASMSRC = $(PORTASM) +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) -# List of the standard inclusion directories. -INCDIR = $(PORTINC) $(KERNINC) - -# Make this point to your armparams.h header. -INCDIR += $(CHIBIOS)/os/common/ports/ARM/devices/LPC214x +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ + $(CHIBIOS)/os/various # # Project, sources and paths diff --git a/demos/various/RT-ARM7-GENERIC/ch.ld b/demos/various/RT-ARM7-GENERIC/ch.ld deleted file mode 100644 index 8b2521c20..000000000 --- a/demos/various/RT-ARM7-GENERIC/ch.ld +++ /dev/null @@ -1,43 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - * LPC2148 memory setup. - */ -MEMORY -{ - flash : org = 0x00000000, len = 512k - 12k - ram0 : org = 0x40000200, len = 32k - 0x200 - 288 - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 -} - -/* RAM region to be used for stacks. This stack accommodates the processing - of all exceptions and interrupts*/ -REGION_ALIAS("STACKS_RAM", ram0); - -/* RAM region to be used for data segment.*/ -REGION_ALIAS("DATA_RAM", ram0); - -/* RAM region to be used for BSS segment.*/ -REGION_ALIAS("BSS_RAM", ram0); - -INCLUDE rules.ld diff --git a/os/common/ports/ARM/compilers/GCC/mk/startup_lpc214x.mk b/os/common/ports/ARM/compilers/GCC/mk/startup_lpc214x.mk new file mode 100644 index 000000000..4927fd31d --- /dev/null +++ b/os/common/ports/ARM/compilers/GCC/mk/startup_lpc214x.mk @@ -0,0 +1,9 @@ +# List of the ChibiOS generic LPC214x file. +STARTUPSRC = + +STARTUPASM = $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/vectors.s \ + $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/crt0.s + +STARTUPINC = ${CHIBIOS}/os/common/ports/ARM/devices/LPC214x + +STARTUPLD = ${CHIBIOS}/os/common/ports/ARM/compilers/GCC/ld diff --git a/os/rt/ports/ARM/compilers/GCC/mk/port_generic.mk b/os/rt/ports/ARM/compilers/GCC/mk/port_generic.mk index 136e8a0ec..5fe0ef4a0 100644 --- a/os/rt/ports/ARM/compilers/GCC/mk/port_generic.mk +++ b/os/rt/ports/ARM/compilers/GCC/mk/port_generic.mk @@ -1,9 +1,7 @@ # List of the ChibiOS/RT ARM generic port files. PORTSRC = ${CHIBIOS}/os/rt/ports/ARM/chcore.c -PORTASM = $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/vectors.s \ - $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/crt0.s \ - $(CHIBIOS)/os/rt/ports/ARM/compilers/GCC/chcoreasm.s +PORTASM = $(CHIBIOS)/os/rt/ports/ARM/compilers/GCC/chcoreasm.s PORTINC = ${CHIBIOS}/os/rt/ports/ARM \ ${CHIBIOS}/os/rt/ports/ARM/compilers/GCC diff --git a/os/rt/ports/ARM/compilers/GCC/mk/port_lpc214x.mk b/os/rt/ports/ARM/compilers/GCC/mk/port_lpc214x.mk deleted file mode 100644 index 84db3c923..000000000 --- a/os/rt/ports/ARM/compilers/GCC/mk/port_lpc214x.mk +++ /dev/null @@ -1,12 +0,0 @@ -# List of the ChibiOS/RT ARM LPC214x port files. -PORTSRC = ${CHIBIOS}/os/rt/ports/ARM/chcore.c - -PORTASM = $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/vectors.s \ - $(CHIBIOS)/os/common/ports/ARM/compilers/GCC/crt0.s \ - $(CHIBIOS)/os/rt/ports/ARM/compilers/GCC/chcoreasm.s - -PORTINC = ${CHIBIOS}/os/common/ports/ARM/devices/LPC214x \ - ${CHIBIOS}/os/rt/ports/ARM \ - ${CHIBIOS}/os/rt/ports/ARM/compilers/GCC - -PORTLD = ${CHIBIOS}/os/common/ports/ARM/compilers/GCC/ld diff --git a/test/hal/testbuild/Makefile b/test/hal/testbuild/Makefile index 64a4c98fc..89214a8e4 100644 --- a/test/hal/testbuild/Makefile +++ b/test/hal/testbuild/Makefile @@ -65,7 +65,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -81,25 +81,32 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../.. +# Startup files. +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk +# HAL-OSAL files (optional). include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/hal/templates/platform.mk +#include $(CHIBIOS)/os/hal/boards/xxxxxxx/board.mk include $(CHIBIOS)/os/hal/templates/osal/osal.mk +# RTOS files (optional). +#include $(CHIBIOS)/os/rt/rt.mk +#include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk +# Other files (optional). +#include $(CHIBIOS)/test/rt/test.mk # Define linker script file here -PORTLD = ${CHIBIOS}/os/common/ports/ARMCMx/compilers/GCC/ld -LDSCRIPT= $(PORTLD)/STM32F407xG.ld +LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. -PORTSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0.c \ - $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/vectors.c -CSRC = $(PORTSRC) \ +CSRC = $(STARTUPSRC) \ $(KERNSRC) \ - $(TESTSRC) \ - $(HALSRC) \ + $(PORTSRC) \ $(OSALSRC) \ + $(HALSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ + $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -127,14 +134,10 @@ TCSRC = TCPPSRC = # List ASM source files here -PORTASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s -ASMSRC = $(PORTASM) +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) -PORTINC = ${CHIBIOS}/os/ext/CMSIS/include \ - ${CHIBIOS}/os/ext/CMSIS/ST \ - ${CHIBIOS}/os/common/ports/ARMCMx/devices/STM32F4xx -INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ - $(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \ +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ $(CHIBIOS)/os/various # diff --git a/test/nil/testbuild/Makefile b/test/nil/testbuild/Makefile index eb9cb7f3a..1de38a2a9 100644 --- a/test/nil/testbuild/Makefile +++ b/test/nil/testbuild/Makefile @@ -65,7 +65,7 @@ endif # Enables the use of FPU on Cortex-M4 (no, softfp, hard). ifeq ($(USE_FPU),) - USE_FPU = hard + USE_FPU = no endif # @@ -81,26 +81,32 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../.. +# Startup files. +include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f3xx.mk +# HAL-OSAL files (optional). +#include $(CHIBIOS)/os/hal/hal.mk +#include $(CHIBIOS)/os/hal/ports/STM32/STM32F3xx/platform.mk +#include $(CHIBIOS)/os/hal/boards/ST_STM32F3_DISCOVERY/board.mk +#include $(CHIBIOS)/os/hal/osal/nil/osal.mk +# RTOS files (optional). include $(CHIBIOS)/os/nil/nil.mk -include $(CHIBIOS)/os/nil/ports/ARMCMx/compilers/GCC/mk/port_generic_cm4.mk -include $(CHIBIOS)/os/hal/osal/nil/osal.mk +include $(CHIBIOS)/os/nil/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk +# Other files (optional). +#include $(CHIBIOS)/test/nil/test.mk # Define linker script file here -PORTLD = ${CHIBIOS}/os/common/ports/ARMCMx/compilers/GCC/ld -LDSCRIPT= $(PORTLD)/STM32F407xG.ld +LDSCRIPT= $(STARTUPLD)/STM32F303xC.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. -PORTSRC = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0.c \ - $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/vectors.c \ - $(CHIBIOS)/os/nil/templates/nilcore.c -CSRC = $(PORTSRC) \ +CSRC = $(STARTUPSRC) \ $(KERNSRC) \ - $(TESTSRC) \ - $(HALSRC) \ + $(PORTSRC) \ $(OSALSRC) \ + $(HALSRC) \ $(PLATFORMSRC) \ $(BOARDSRC) \ + $(TESTSRC) \ main.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -128,14 +134,11 @@ TCSRC = TCPPSRC = # List ASM source files here -PORTASM = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s -ASMSRC = $(PORTASM) +ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) -PORTINC = ${CHIBIOS}/os/ext/CMSIS/include \ - ${CHIBIOS}/os/ext/CMSIS/ST \ - ${CHIBIOS}/os/common/ports/ARMCMx/devices/STM32F4xx \ - $(CHIBIOS)/os/nil/templates -INCDIR = $(PORTINC) $(KERNINC) +INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ + $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ + $(CHIBIOS)/os/various # # Project, sources and paths @@ -185,7 +188,7 @@ CPPWARN = -Wall -Wextra # # List all user C define here, like -D_DEBUG=1 -UDEFS = -DSTM32F407xx +UDEFS = -DSTM32F303xC # Define ASM defines here UADEFS =