Updated with new makefiles, added Systick priority initialization.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12035 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
parent
b228e17215
commit
30cd967c17
|
@ -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,7 +28,7 @@ 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
|
||||||
|
@ -87,12 +87,18 @@ PROJECT = ch
|
||||||
|
|
||||||
# Imported source files and paths
|
# Imported source files and paths
|
||||||
CHIBIOS = ../../..
|
CHIBIOS = ../../..
|
||||||
|
CONFDIR := ./cfg
|
||||||
|
BUILDDIR := ./build
|
||||||
|
DEPDIR := ./.dep
|
||||||
|
|
||||||
|
# Licensing files.
|
||||||
|
include $(CHIBIOS)/os/license/license.mk
|
||||||
# Startup files.
|
# Startup files.
|
||||||
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk
|
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk
|
||||||
# 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/STM32F0xx/platform.mk
|
#include $(CHIBIOS)/os/hal/ports/STM32/STM32F0xx/platform.mk
|
||||||
#include $(CHIBIOS)/os/hal/boards/ST_STM32F072B_DISCOVERY/board.mk
|
#include $(CHIBIOS)/os/hal/boards/ST_STM32F0_DISCOVERY/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
|
||||||
|
@ -107,19 +113,13 @@ LDSCRIPT= $(STARTUPLD)/STM32F051x8.ld
|
||||||
|
|
||||||
# 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.
|
||||||
CSRC = $(STARTUPSRC) \
|
CSRC = $(ALLCSRC) \
|
||||||
$(KERNSRC) \
|
|
||||||
$(PORTSRC) \
|
|
||||||
$(OSALSRC) \
|
|
||||||
$(HALSRC) \
|
|
||||||
$(PLATFORMSRC) \
|
|
||||||
$(BOARDSRC) \
|
|
||||||
$(TESTSRC) \
|
$(TESTSRC) \
|
||||||
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.
|
# C sources to be compiled in ARM mode regardless of the global setting.
|
||||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
||||||
|
@ -141,24 +141,44 @@ TCSRC =
|
||||||
# option that results in lower performance and larger code size.
|
# option that results in lower performance and larger code size.
|
||||||
TCPPSRC =
|
TCPPSRC =
|
||||||
|
|
||||||
# List ASM source files here
|
# List ASM source files here.
|
||||||
ASMSRC =
|
ASMSRC = $(ALLASMSRC)
|
||||||
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
ASMXSRC = $(ALLXASMSRC)
|
||||||
|
|
||||||
INCDIR = $(CHIBIOS)/os/license \
|
INCDIR = $(CONFDIR) $(ALLINC) $(TESTINC)
|
||||||
$(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
|
|
||||||
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
|
|
||||||
$(CHIBIOS)/os/various
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Project, sources and paths
|
# Project, sources and paths
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Start of user section
|
||||||
|
#
|
||||||
|
|
||||||
|
# List all user C define here, like -D_DEBUG=1
|
||||||
|
UDEFS = -DSTM32F051x8
|
||||||
|
|
||||||
|
# Define ASM defines here
|
||||||
|
UADEFS = -DSTM32F051x8
|
||||||
|
|
||||||
|
# List all user directories here
|
||||||
|
UINCDIR =
|
||||||
|
|
||||||
|
# List the user directory to look for the libraries here
|
||||||
|
ULIBDIR =
|
||||||
|
|
||||||
|
# List all user libraries here
|
||||||
|
ULIBS =
|
||||||
|
|
||||||
|
#
|
||||||
|
# End of user section
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Compiler settings
|
# Compiler settings
|
||||||
#
|
#
|
||||||
|
|
||||||
MCU = cortex-m0
|
MCU = cortex-m4
|
||||||
|
|
||||||
#TRGT = arm-elf-
|
#TRGT = arm-elf-
|
||||||
TRGT = arm-none-eabi-
|
TRGT = arm-none-eabi-
|
||||||
|
@ -193,29 +213,6 @@ CPPWARN = -Wall -Wextra -Wundef
|
||||||
# Compiler settings
|
# Compiler settings
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
# Start of user section
|
|
||||||
#
|
|
||||||
|
|
||||||
# List all user C define here, like -D_DEBUG=1
|
|
||||||
UDEFS = -DSTM32F051x8
|
|
||||||
|
|
||||||
# Define ASM defines here
|
|
||||||
UADEFS =
|
|
||||||
|
|
||||||
# List all user directories here
|
|
||||||
UINCDIR =
|
|
||||||
|
|
||||||
# List the user directory to look for the libraries here
|
|
||||||
ULIBDIR =
|
|
||||||
|
|
||||||
# List all user libraries here
|
|
||||||
ULIBS =
|
|
||||||
|
|
||||||
#
|
|
||||||
# End of user defines
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
|
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
|
||||||
include $(RULESPATH)/rules.mk
|
include $(RULESPATH)/rules.mk
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,9 @@ int main(void) {
|
||||||
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk |
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk |
|
||||||
SysTick_CTRL_TICKINT_Msk;
|
SysTick_CTRL_TICKINT_Msk;
|
||||||
|
|
||||||
|
/* IRQ enabled.*/
|
||||||
|
NVIC_SetPriority(SysTick_IRQn, 1);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* System initializations.
|
* System initializations.
|
||||||
* - Kernel initialization, the main() function becomes a thread and the
|
* - Kernel initialization, the main() function becomes a thread and the
|
||||||
|
|
Loading…
Reference in New Issue