From 75d0dbad440f8a2a0bfe6938e957b8254149d16a Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 22 Sep 2019 16:49:00 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13018 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- demos/STM32/RT-STM32G474RE-NUCLEO64/.project | 2 +- demos/STM32/RT-STM32G474RE-NUCLEO64/Makefile | 18 ++++----- os/hal/ports/STM32/STM32G4xx/platform.mk | 42 ++++++++++++++++++++ 3 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 os/hal/ports/STM32/STM32G4xx/platform.mk diff --git a/demos/STM32/RT-STM32G474RE-NUCLEO64/.project b/demos/STM32/RT-STM32G474RE-NUCLEO64/.project index fb2b59531..3e03f8e72 100644 --- a/demos/STM32/RT-STM32G474RE-NUCLEO64/.project +++ b/demos/STM32/RT-STM32G474RE-NUCLEO64/.project @@ -27,7 +27,7 @@ board 2 - CHIBIOS/os/hal/boards/ST_NUCLEO64_G747RE + CHIBIOS/os/hal/boards/ST_NUCLEO64_G474RE os diff --git a/demos/STM32/RT-STM32G474RE-NUCLEO64/Makefile b/demos/STM32/RT-STM32G474RE-NUCLEO64/Makefile index 351f420e9..34a9a38ca 100644 --- a/demos/STM32/RT-STM32G474RE-NUCLEO64/Makefile +++ b/demos/STM32/RT-STM32G474RE-NUCLEO64/Makefile @@ -99,13 +99,13 @@ include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32g4xx.mk # HAL-OSAL files (optional). -#include $(CHIBIOS)/os/hal/hal.mk -#include $(CHIBIOS)/os/hal/ports/STM32/STM32G0xx/platform.mk -#include $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_G071RB/board.mk -#include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk +include $(CHIBIOS)/os/hal/hal.mk +include $(CHIBIOS)/os/hal/ports/STM32/STM32G4xx/platform.mk +include $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_G474RE/board.mk +include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk # RTOS files (optional). -#include $(CHIBIOS)/os/rt/rt.mk -#include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk +include $(CHIBIOS)/os/rt/rt.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). @@ -114,7 +114,7 @@ include $(CHIBIOS)/tools/mk/autobuild.mk #include $(CHIBIOS)/test/oslib/oslib_test.mk # Define linker script file here -LDSCRIPT= $(STARTUPLD)/STM32G071xB.ld +LDSCRIPT= $(STARTUPLD)/STM32G474xE.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. @@ -150,10 +150,10 @@ CPPWARN = -Wall -Wextra -Wundef # # List all user C define here, like -D_DEBUG=1 -UDEFS = -DSTM32G474xx +UDEFS = # Define ASM defines here -UADEFS = -DSTM32G474xx +UADEFS = # List all user directories here UINCDIR = diff --git a/os/hal/ports/STM32/STM32G4xx/platform.mk b/os/hal/ports/STM32/STM32G4xx/platform.mk new file mode 100644 index 000000000..a65c5176c --- /dev/null +++ b/os/hal/ports/STM32/STM32G4xx/platform.mk @@ -0,0 +1,42 @@ +# Required platform files. +PLATFORMSRC := $(CHIBIOS)/os/hal/ports/common/ARMCMx/nvic.c \ + $(CHIBIOS)/os/hal/ports/STM32/STM32G4xx/stm32_isr.c \ + $(CHIBIOS)/os/hal/ports/STM32/STM32G4xx/hal_lld.c + +# Required include directories. +PLATFORMINC := $(CHIBIOS)/os/hal/ports/common/ARMCMx \ + $(CHIBIOS)/os/hal/ports/STM32/STM32G4xx + +# Optional platform files. +ifeq ($(USE_SMART_BUILD),yes) + +# Configuration files directory +ifeq ($(HALCONFDIR),) + ifeq ($(CONFDIR),) + HALCONFDIR = . + else + HALCONFDIR := $(CONFDIR) + endif +endif + +HALCONF := $(strip $(shell cat $(HALCONFDIR)/halconf.h | egrep -e "\#define")) + +else +endif + +# Drivers compatible with the platform. +#include $(CHIBIOS)/os/hal/ports/STM32/LLD/ADCv1/driver.mk +#include $(CHIBIOS)/os/hal/ports/STM32/LLD/DACv1/driver.mk +#include $(CHIBIOS)/os/hal/ports/STM32/LLD/DMAv1/driver.mk +include $(CHIBIOS)/os/hal/ports/STM32/LLD/EXTIv1/driver.mk +include $(CHIBIOS)/os/hal/ports/STM32/LLD/GPIOv2/driver.mk +#include $(CHIBIOS)/os/hal/ports/STM32/LLD/I2Cv2/driver.mk +#include $(CHIBIOS)/os/hal/ports/STM32/LLD/RTCv2/driver.mk +#include $(CHIBIOS)/os/hal/ports/STM32/LLD/SPIv2/driver.mk +#include $(CHIBIOS)/os/hal/ports/STM32/LLD/TIMv1/driver.mk +include $(CHIBIOS)/os/hal/ports/STM32/LLD/USARTv2/driver.mk +#include $(CHIBIOS)/os/hal/ports/STM32/LLD/xWDGv1/driver.mk + +# Shared variables +ALLCSRC += $(PLATFORMSRC) +ALLINC += $(PLATFORMINC)