git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12385 110e8d01-0319-4d1e-a829-52ad28d1bb01

This commit is contained in:
Giovanni Di Sirio 2018-10-21 18:48:24 +00:00
parent 368d449f42
commit b3fe2fa43b
20 changed files with 160 additions and 249 deletions

View File

@ -60,7 +60,7 @@
<folderInfo id="0.1570569554.1629784558." name="/" resourcePath=""> <folderInfo id="0.1570569554.1629784558." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1578189045" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain"> <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1578189045" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.1578189045.328762513" name=""/> <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.1578189045.328762513" name=""/>
<builder arguments="-f Makefile-stm32f746_discovery" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.339968776" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.settings.default.builder"/> <builder arguments="-f make/stm32f746_discovery.make" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.339968776" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1142929379" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/> <tool id="org.eclipse.cdt.build.core.settings.holder.libs.1142929379" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.1147455862" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder"> <tool id="org.eclipse.cdt.build.core.settings.holder.1147455862" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1688616224" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths"/> <option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1688616224" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths"/>
@ -101,7 +101,7 @@
<folderInfo id="0.1570569554.95389811." name="/" resourcePath=""> <folderInfo id="0.1570569554.95389811." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1439667896" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain"> <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1439667896" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.1439667896.2962069" name=""/> <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.1439667896.2962069" name=""/>
<builder arguments="-f Makefile-stm32f407_olimex" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.199921010" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.settings.default.builder"/> <builder arguments="-f make/stm32f407_olimex.make" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.199921010" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1938739117" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/> <tool id="org.eclipse.cdt.build.core.settings.holder.libs.1938739117" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.2059891059" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder"> <tool id="org.eclipse.cdt.build.core.settings.holder.2059891059" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1405585713" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths"/> <option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1405585713" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths"/>
@ -142,7 +142,7 @@
<folderInfo id="0.1570569554.95389811.2077839933." name="/" resourcePath=""> <folderInfo id="0.1570569554.95389811.2077839933." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.316395724" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain"> <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.316395724" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.316395724.1527335111" name=""/> <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.316395724.1527335111" name=""/>
<builder arguments="-f Makefile-stm32f107_goldbull" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.2066535313" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.settings.default.builder"/> <builder arguments="-f make/stm32f107_goldbull.make" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.2066535313" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1773244460" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/> <tool id="org.eclipse.cdt.build.core.settings.holder.libs.1773244460" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.107545100" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder"> <tool id="org.eclipse.cdt.build.core.settings.holder.107545100" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1947257683" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths"/> <option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1947257683" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths"/>

View File

@ -5,25 +5,25 @@
all: all:
@echo @echo
@echo === Building for STM32F407-Olimex ================================== @echo === Building for STM32F407-Olimex ==================================
+@make --no-print-directory -f Makefile-stm32f407_olimex all +@make --no-print-directory -f make/stm32f407_olimex.make all
@echo ==================================================================== @echo ====================================================================
@echo @echo
@echo === Building for STM32F746-Discovery =============================== @echo === Building for STM32F746-Discovery ===============================
+@make --no-print-directory -f Makefile-stm32f746_discovery all +@make --no-print-directory -f make/stm32f746_discovery.make all
@echo ==================================================================== @echo ====================================================================
@echo @echo
@echo === Building for STM32F107-GoldBull ================================ @echo === Building for STM32F107-GoldBull ================================
+@make --no-print-directory -f Makefile-stm32f107_goldbull all +@make --no-print-directory -f make/stm32f107_goldbull.make all
@echo ==================================================================== @echo ====================================================================
@echo @echo
clean: clean:
@echo @echo
+@make --no-print-directory -f Makefile-stm32f407_olimex clean +@make --no-print-directory -f make/stm32f407_olimex.make clean
@echo @echo
+@make --no-print-directory -f Makefile-stm32f746_discovery clean +@make --no-print-directory -f make/stm32f746_discovery.make clean
@echo @echo
+@make --no-print-directory -f Makefile-stm32f107_goldbull clean +@make --no-print-directory -f make/stm32f107_goldbull.make clean
@echo @echo
# #
############################################################################## ##############################################################################

View File

@ -64,6 +64,24 @@
#define STM32_PLS STM32_PLS_LEV0 #define STM32_PLS STM32_PLS_LEV0
#define STM32_BKPRAM_ENABLE FALSE #define STM32_BKPRAM_ENABLE FALSE
/*
* IRQ system settings.
*/
#define STM32_IRQ_EXTI0_PRIORITY 6
#define STM32_IRQ_EXTI1_PRIORITY 6
#define STM32_IRQ_EXTI2_PRIORITY 6
#define STM32_IRQ_EXTI3_PRIORITY 6
#define STM32_IRQ_EXTI4_PRIORITY 6
#define STM32_IRQ_EXTI5_9_PRIORITY 6
#define STM32_IRQ_EXTI10_15_PRIORITY 6
#define STM32_IRQ_EXTI16_PRIORITY 6
#define STM32_IRQ_EXTI17_PRIORITY 15
#define STM32_IRQ_EXTI18_PRIORITY 6
#define STM32_IRQ_EXTI19_PRIORITY 6
#define STM32_IRQ_EXTI20_PRIORITY 6
#define STM32_IRQ_EXTI21_PRIORITY 15
#define STM32_IRQ_EXTI22_PRIORITY 15
/* /*
* ADC driver system settings. * ADC driver system settings.
*/ */
@ -103,24 +121,6 @@
#define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) #define STM32_DAC_DAC1_CH1_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
#define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) #define STM32_DAC_DAC1_CH2_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
/*
* EXT driver system settings.
*/
#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
#define STM32_EXT_EXTI17_IRQ_PRIORITY 15
#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
#define STM32_EXT_EXTI20_IRQ_PRIORITY 6
#define STM32_EXT_EXTI21_IRQ_PRIORITY 15
#define STM32_EXT_EXTI22_IRQ_PRIORITY 15
/* /*
* GPT driver system settings. * GPT driver system settings.
*/ */

View File

@ -18,7 +18,7 @@ ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti USE_CPPOPT = -fno-rtti
endif endif
# Enable this if you want the linker to remove unused code and data # Enable this if you want the linker to remove unused code and data.
ifeq ($(USE_LINK_GC),) ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes USE_LINK_GC = yes
endif endif
@ -28,16 +28,11 @@ ifeq ($(USE_LDOPT),)
USE_LDOPT = USE_LDOPT =
endif endif
# Enable this if you want link time optimizations (LTO) # Enable this if you want link time optimizations (LTO).
ifeq ($(USE_LTO),) ifeq ($(USE_LTO),)
USE_LTO = yes USE_LTO = yes
endif endif
# If enabled, this option allows to compile the application in THUMB mode.
ifeq ($(USE_THUMB),)
USE_THUMB = yes
endif
# Enable this if you want to see the full log while compiling. # Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),) ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = no USE_VERBOSE_COMPILE = no
@ -74,22 +69,30 @@ ifeq ($(USE_FPU),)
USE_FPU = no USE_FPU = no
endif endif
# FPU-related options.
ifeq ($(USE_FPU_OPT),)
USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16
endif
# #
# Architecture or project specific options # Architecture or project specific options
############################################################################## ##############################################################################
############################################################################## ##############################################################################
# Project, sources and paths # Project, target, sources and paths
# #
# Define project name here # Define project name here
PROJECT = ch PROJECT = ch
CONFDIR := ./cfg-stm32f107_goldbull
BUILDDIR := ./build-stm32f107_goldbull
DEPDIR := ./.dep-stm32f107_goldbull
# Imported source files and paths # Target settings.
CHIBIOS = ../../.. MCU = cortex-m3
# Imported source files and paths.
CHIBIOS := ../../..
CONFDIR := ./cfg/stm32f107_goldbull
BUILDDIR := ./build/stm32f107_goldbull
DEPDIR := ./.dep/stm32f107_goldbull
# Licensing files. # Licensing files.
include $(CHIBIOS)/os/license/license.mk include $(CHIBIOS)/os/license/license.mk
@ -103,6 +106,8 @@ include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional). # RTOS files (optional).
include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
# Auto-build files in ./source recursively.
include $(CHIBIOS)/tools/mk/autobuild.mk
# Other files (optional). # Other files (optional).
include $(CHIBIOS)/test/lib/test.mk include $(CHIBIOS)/test/lib/test.mk
include $(CHIBIOS)/test/rt/rt_test.mk include $(CHIBIOS)/test/rt/rt_test.mk
@ -121,79 +126,29 @@ CSRC = $(ALLCSRC) \
$(TESTSRC) \ $(TESTSRC) \
$(CHIBIOS)/os/various/evtimer.c \ $(CHIBIOS)/os/various/evtimer.c \
$(CONFDIR)/portab.c \ $(CONFDIR)/portab.c \
src/usbcfg.c main.c main.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global # C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting. # setting.
CPPSRC = CPPSRC = $(ALLCPPSRC)
# C sources to be compiled in ARM mode regardless of the global setting. # List ASM source files here.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACSRC =
# C++ sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACPPSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCPPSRC =
# List ASM source files here
ASMSRC = $(ALLASMSRC) ASMSRC = $(ALLASMSRC)
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
INCDIR = $(ALLINC) $(TESTINC) $(CONFDIR) ./cfg ./src # List ASM with preprocessor source files here.
ASMXSRC = $(ALLXASMSRC)
# # Inclusion directories.
# Project, sources and paths INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) ./cfg
##############################################################################
############################################################################## # Define C warning options here.
# Compiler settings
#
MCU = cortex-m3
#TRGT = arm-elf-
TRGT = arm-none-eabi-
CC = $(TRGT)gcc
CPPC = $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support.
# NOTE: You can use C++ even without C++ support if you are careful. C++
# runtime support makes code size explode.
LD = $(TRGT)gcc
#LD = $(TRGT)g++
CP = $(TRGT)objcopy
AS = $(TRGT)gcc -x assembler-with-cpp
AR = $(TRGT)ar
OD = $(TRGT)objdump
SZ = $(TRGT)size
HEX = $(CP) -O ihex
BIN = $(CP) -O binary
# ARM-specific options here
AOPT =
# THUMB-specific options here
TOPT = -mthumb -DTHUMB
# Define C warning options here
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
# Define C++ warning options here # Define C++ warning options here.
CPPWARN = -Wall -Wextra -Wundef CPPWARN = -Wall -Wextra -Wundef
# #
# Compiler settings # Project, target, sources and paths
############################################################################## ##############################################################################
############################################################################## ##############################################################################
@ -216,8 +171,25 @@ ULIBDIR =
ULIBS = ULIBS =
# #
# End of user defines # End of user section
############################################################################## ##############################################################################
##############################################################################
# Common rules
#
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk
include $(RULESPATH)/arm-none-eabi.mk
include $(RULESPATH)/rules.mk include $(RULESPATH)/rules.mk
#
# Common rules
##############################################################################
##############################################################################
# Custom rules
#
#
# Custom rules
##############################################################################

View File

@ -18,7 +18,7 @@ ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti USE_CPPOPT = -fno-rtti
endif endif
# Enable this if you want the linker to remove unused code and data # Enable this if you want the linker to remove unused code and data.
ifeq ($(USE_LINK_GC),) ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes USE_LINK_GC = yes
endif endif
@ -28,16 +28,11 @@ ifeq ($(USE_LDOPT),)
USE_LDOPT = USE_LDOPT =
endif endif
# Enable this if you want link time optimizations (LTO) # Enable this if you want link time optimizations (LTO).
ifeq ($(USE_LTO),) ifeq ($(USE_LTO),)
USE_LTO = yes USE_LTO = yes
endif endif
# If enabled, this option allows to compile the application in THUMB mode.
ifeq ($(USE_THUMB),)
USE_THUMB = yes
endif
# Enable this if you want to see the full log while compiling. # Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),) ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = no USE_VERBOSE_COMPILE = no
@ -74,22 +69,30 @@ ifeq ($(USE_FPU),)
USE_FPU = no USE_FPU = no
endif endif
# FPU-related options.
ifeq ($(USE_FPU_OPT),)
USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16
endif
# #
# Architecture or project specific options # Architecture or project specific options
############################################################################## ##############################################################################
############################################################################## ##############################################################################
# Project, sources and paths # Project, target, sources and paths
# #
# Define project name here # Define project name here
PROJECT = ch PROJECT = ch
CONFDIR := ./cfg-stm32f407_olimex
BUILDDIR := ./build-stm32f407_olimex
DEPDIR := ./.dep-stm32f407_olimex
# Imported source files and paths # Target settings.
CHIBIOS = ../../.. MCU = cortex-m4
# Imported source files and paths.
CHIBIOS := ../../..
CONFDIR := ./cfg/stm32f407_olimex
BUILDDIR := ./build/stm32f407_olimex
DEPDIR := ./.dep/stm32f407_olimex
# Licensing files. # Licensing files.
include $(CHIBIOS)/os/license/license.mk include $(CHIBIOS)/os/license/license.mk
@ -98,11 +101,13 @@ include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.m
# HAL-OSAL files (optional). # HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk include $(CHIBIOS)/os/hal/ports/STM32/STM32F4xx/platform.mk
include $(CHIBIOS)/os/hal/boards/OLIMEX_STM32_E407_REV_D/board.mk include $(CHIBIOS)/os/hal/boards/OLIMEX_STM32_E407/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional). # RTOS files (optional).
include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
# Auto-build files in ./source recursively.
include $(CHIBIOS)/tools/mk/autobuild.mk
# Other files (optional). # Other files (optional).
include $(CHIBIOS)/test/lib/test.mk include $(CHIBIOS)/test/lib/test.mk
include $(CHIBIOS)/test/rt/rt_test.mk include $(CHIBIOS)/test/rt/rt_test.mk
@ -121,79 +126,29 @@ CSRC = $(ALLCSRC) \
$(TESTSRC) \ $(TESTSRC) \
$(CHIBIOS)/os/various/evtimer.c \ $(CHIBIOS)/os/various/evtimer.c \
$(CONFDIR)/portab.c \ $(CONFDIR)/portab.c \
src/usbcfg.c main.c main.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global # C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting. # setting.
CPPSRC = $(ALLCPPSRC) CPPSRC = $(ALLCPPSRC)
# C sources to be compiled in ARM mode regardless of the global setting. # List ASM source files here.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACSRC =
# C++ sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACPPSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCPPSRC =
# List ASM source files here
ASMSRC = $(ALLASMSRC) ASMSRC = $(ALLASMSRC)
# List ASM with preprocessor source files here.
ASMXSRC = $(ALLXASMSRC) ASMXSRC = $(ALLXASMSRC)
INCDIR = $(ALLINC) $(TESTINC) $(CONFDIR) ./cfg ./src # Inclusion directories.
INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) ./cfg
# # Define C warning options here.
# Project, sources and paths
##############################################################################
##############################################################################
# Compiler settings
#
MCU = cortex-m4
#TRGT = arm-elf-
TRGT = arm-none-eabi-
CC = $(TRGT)gcc
CPPC = $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support.
# NOTE: You can use C++ even without C++ support if you are careful. C++
# runtime support makes code size explode.
LD = $(TRGT)gcc
#LD = $(TRGT)g++
CP = $(TRGT)objcopy
AS = $(TRGT)gcc -x assembler-with-cpp
AR = $(TRGT)ar
OD = $(TRGT)objdump
SZ = $(TRGT)size
HEX = $(CP) -O ihex
BIN = $(CP) -O binary
# ARM-specific options here
AOPT =
# THUMB-specific options here
TOPT = -mthumb -DTHUMB
# Define C warning options here
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
# Define C++ warning options here # Define C++ warning options here.
CPPWARN = -Wall -Wextra -Wundef CPPWARN = -Wall -Wextra -Wundef
# #
# Compiler settings # Project, target, sources and paths
############################################################################## ##############################################################################
############################################################################## ##############################################################################
@ -216,8 +171,25 @@ ULIBDIR =
ULIBS = ULIBS =
# #
# End of user defines # End of user section
############################################################################## ##############################################################################
##############################################################################
# Common rules
#
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk
include $(RULESPATH)/arm-none-eabi.mk
include $(RULESPATH)/rules.mk include $(RULESPATH)/rules.mk
#
# Common rules
##############################################################################
##############################################################################
# Custom rules
#
#
# Custom rules
##############################################################################

View File

@ -18,7 +18,7 @@ ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti USE_CPPOPT = -fno-rtti
endif endif
# Enable this if you want the linker to remove unused code and data # Enable this if you want the linker to remove unused code and data.
ifeq ($(USE_LINK_GC),) ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes USE_LINK_GC = yes
endif endif
@ -28,16 +28,11 @@ ifeq ($(USE_LDOPT),)
USE_LDOPT = USE_LDOPT =
endif endif
# Enable this if you want link time optimizations (LTO) # Enable this if you want link time optimizations (LTO).
ifeq ($(USE_LTO),) ifeq ($(USE_LTO),)
USE_LTO = yes USE_LTO = yes
endif endif
# If enabled, this option allows to compile the application in THUMB mode.
ifeq ($(USE_THUMB),)
USE_THUMB = yes
endif
# Enable this if you want to see the full log while compiling. # Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),) ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = no USE_VERBOSE_COMPILE = no
@ -76,7 +71,7 @@ endif
# FPU-related options. # FPU-related options.
ifeq ($(USE_FPU_OPT),) ifeq ($(USE_FPU_OPT),)
USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv5-sp-d16 -fsingle-precision-constant USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv5-sp-d16
endif endif
# #
@ -84,17 +79,20 @@ endif
############################################################################## ##############################################################################
############################################################################## ##############################################################################
# Project, sources and paths # Project, target, sources and paths
# #
# Define project name here # Define project name here
PROJECT = ch PROJECT = ch
CONFDIR := ./cfg-stm32f746_discovery
BUILDDIR := ./build-stm32f746_discovery
DEPDIR := ./.dep-stm32f746_discovery
# Imported source files and paths # Target settings.
CHIBIOS = ../../.. MCU = cortex-m4
# Imported source files and paths.
CHIBIOS := ../../..
CONFDIR := ./cfg/stm32f746_discovery
BUILDDIR := ./build/stm32f746_discovery
DEPDIR := ./.dep/stm32f746_discovery
# Licensing files. # Licensing files.
include $(CHIBIOS)/os/license/license.mk include $(CHIBIOS)/os/license/license.mk
@ -108,6 +106,8 @@ include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional). # RTOS files (optional).
include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
# Auto-build files in ./source recursively.
include $(CHIBIOS)/tools/mk/autobuild.mk
# Other files (optional). # Other files (optional).
include $(CHIBIOS)/test/lib/test.mk include $(CHIBIOS)/test/lib/test.mk
include $(CHIBIOS)/test/rt/rt_test.mk include $(CHIBIOS)/test/rt/rt_test.mk
@ -126,79 +126,29 @@ CSRC = $(ALLCSRC) \
$(TESTSRC) \ $(TESTSRC) \
$(CHIBIOS)/os/various/evtimer.c \ $(CHIBIOS)/os/various/evtimer.c \
$(CONFDIR)/portab.c \ $(CONFDIR)/portab.c \
src/usbcfg.c main.c main.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global # C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting. # setting.
CPPSRC = $(ALLCPPSRC) CPPSRC = $(ALLCPPSRC)
# C sources to be compiled in ARM mode regardless of the global setting. # List ASM source files here.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACSRC =
# C++ sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACPPSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCPPSRC =
# List ASM source files here
ASMSRC = $(ALLASMSRC) ASMSRC = $(ALLASMSRC)
# List ASM with preprocessor source files here.
ASMXSRC = $(ALLXASMSRC) ASMXSRC = $(ALLXASMSRC)
INCDIR = $(ALLINC) $(TESTINC) $(CONFDIR) ./cfg ./src # Inclusion directories.
INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC) ./cfg
# # Define C warning options here.
# Project, sources and paths
##############################################################################
##############################################################################
# Compiler settings
#
MCU = cortex-m7
#TRGT = arm-elf-
TRGT = arm-none-eabi-
CC = $(TRGT)gcc
CPPC = $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support.
# NOTE: You can use C++ even without C++ support if you are careful. C++
# runtime support makes code size explode.
LD = $(TRGT)gcc
#LD = $(TRGT)g++
CP = $(TRGT)objcopy
AS = $(TRGT)gcc -x assembler-with-cpp
AR = $(TRGT)ar
OD = $(TRGT)objdump
SZ = $(TRGT)size
HEX = $(CP) -O ihex
BIN = $(CP) -O binary
# ARM-specific options here
AOPT =
# THUMB-specific options here
TOPT = -mthumb -DTHUMB
# Define C warning options here
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
# Define C++ warning options here # Define C++ warning options here.
CPPWARN = -Wall -Wextra -Wundef CPPWARN = -Wall -Wextra -Wundef
# #
# Compiler settings # Project, target, sources and paths
############################################################################## ##############################################################################
############################################################################## ##############################################################################
@ -221,8 +171,25 @@ ULIBDIR =
ULIBS = ULIBS =
# #
# End of user defines # End of user section
############################################################################## ##############################################################################
##############################################################################
# Common rules
#
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk
include $(RULESPATH)/arm-none-eabi.mk
include $(RULESPATH)/rules.mk include $(RULESPATH)/rules.mk
#
# Common rules
##############################################################################
##############################################################################
# Custom rules
#
#
# Custom rules
##############################################################################