aboutsummaryrefslogtreecommitdiffstats
path: root/demos/various
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-28 09:12:09 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-28 09:12:09 +0000
commit4cd975affe635e7e635a76eafd2b0f9b4b747e07 (patch)
tree03c899a1876ca8b058e8ba1fa5c43f60e8645886 /demos/various
parent746736f9ca4f97a0dd60eeb4b3d0da6ef178f98c (diff)
downloadChibiOS-4cd975affe635e7e635a76eafd2b0f9b4b747e07.tar.gz
ChibiOS-4cd975affe635e7e635a76eafd2b0f9b4b747e07.tar.bz2
ChibiOS-4cd975affe635e7e635a76eafd2b0f9b4b747e07.zip
Improved makefiles on STM32F4xx.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7823 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/various')
-rw-r--r--demos/various/NIL-ARMCM4-GENERIC/Makefile40
-rw-r--r--demos/various/RT-ARMCM4-GENERIC/Makefile41
-rw-r--r--demos/various/RT-ARMCM4-GENERIC/ch.ld47
3 files changed, 48 insertions, 80 deletions
diff --git a/demos/various/NIL-ARMCM4-GENERIC/Makefile b/demos/various/NIL-ARMCM4-GENERIC/Makefile
index 4a21e8cbc..7f1879aa5 100644
--- a/demos/various/NIL-ARMCM4-GENERIC/Makefile
+++ b/demos/various/NIL-ARMCM4-GENERIC/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,16 +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/ports/STM32/STM32F4xx/platform.mk
+#include $(CHIBIOS)/os/hal/boards/ST_STM32F4_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/nil/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
+# Other files (optional).
+#include $(CHIBIOS)/test/nil/test.mk
# Define linker script file here
-LDSCRIPT = ch.ld
+LDSCRIPT= $(STARTUPLD)/STM32F407xG.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
@@ -118,13 +134,11 @@ TCSRC =
TCPPSRC =
# List ASM source files here
-ASMSRC = $(PORTASM)
+ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
-INCDIR = $(PORTINC) $(KERNINC)
-
-# Make this point to your CMSIS and chparams.h headers.
-INCDIR += $(CHIBIOS)/os/ext/CMSIS/ST \
- $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F4xx
+INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
+ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
+ $(CHIBIOS)/os/various
#
# Project, sources and paths
@@ -194,9 +208,3 @@ ULIBS =
RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
include $(RULESPATH)/rules.mk
-
-##############################################################################
-# MISRA check rule, requires PCLint and the setup files, not provided.
-#
-misra:
- @lint-nt -v -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(CSRC) &> misra.txt
diff --git a/demos/various/RT-ARMCM4-GENERIC/Makefile b/demos/various/RT-ARMCM4-GENERIC/Makefile
index 719585ddc..cbfde6f61 100644
--- a/demos/various/RT-ARMCM4-GENERIC/Makefile
+++ b/demos/various/RT-ARMCM4-GENERIC/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,16 +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/ports/STM32/STM32F4xx/platform.mk
+#include $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY/board.mk
+#include $(CHIBIOS)/os/hal/osal/rt/osal.mk
+# RTOS files (optional).
include $(CHIBIOS)/os/rt/rt.mk
-include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_generic_cm4.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
-LDSCRIPT= ch.ld
+LDSCRIPT= $(STARTUPLD)/STM32F407xG.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
@@ -118,14 +134,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 CMSIS and chparams.h headers.
-INCDIR += $(CHIBIOS)/os/ext/CMSIS/ST \
- $(CHIBIOS)/os/common/ports/ARMCMx/devices/STM32F4xx
+INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
+ $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
+ $(CHIBIOS)/os/various
#
# Project, sources and paths
@@ -195,9 +208,3 @@ ULIBS =
RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
include $(RULESPATH)/rules.mk
-
-##############################################################################
-# MISRA check rule, requires PCLint and the setup files, not provided.
-#
-misra:
- @lint-nt -v -w3 $(DEFS) pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(CSRC) &> misra.txt
diff --git a/demos/various/RT-ARMCM4-GENERIC/ch.ld b/demos/various/RT-ARMCM4-GENERIC/ch.ld
deleted file mode 100644
index d04a6c4ed..000000000
--- a/demos/various/RT-ARMCM4-GENERIC/ch.ld
+++ /dev/null
@@ -1,47 +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.
-*/
-
-/*
- * Generic device memory setup, customize it for your device.
- */
-MEMORY
-{
- flash : org = 0x08000000, len = 64k
- ram0 : org = 0x20000000, len = 8k
- 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 Main stack. This stack accommodates the processing
- of all exceptions and interrupts*/
-REGION_ALIAS("MAIN_STACK_RAM", ram0);
-
-/* RAM region to be used for the process stack. This is the stack used by
- the main() function.*/
-REGION_ALIAS("PROCESS_STACK_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