From 1137ed6ee76251180dc12b8db59768382fdd3023 Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 10 Jul 2015 18:11:36 +1000 Subject: [PATCH 1/2] Makefile additions for stm32m7 and raw32 --- tools/gmake_scripts/cpu_stm32m7.mk | 24 ++++++++++++++++++++++++ tools/gmake_scripts/os_raw32.mk | 13 +++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tools/gmake_scripts/cpu_stm32m7.mk create mode 100644 tools/gmake_scripts/os_raw32.mk diff --git a/tools/gmake_scripts/cpu_stm32m7.mk b/tools/gmake_scripts/cpu_stm32m7.mk new file mode 100644 index 00000000..0a59e24f --- /dev/null +++ b/tools/gmake_scripts/cpu_stm32m7.mk @@ -0,0 +1,24 @@ +# +# This file is subject to the terms of the GFX License. If a copy of +# the license was not distributed with this file, you can obtain one at: +# +# http://ugfx.org/license.html +# + +# +# See readme.txt for the make API +# + +# Requirements: +# +# NONE +# + +#SRCFLAGS += -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -falign-functions=16 +#LDFLAGS += -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -falign-functions=16 +#DEFS += CORTEX_USE_FPU=TRUE +#LIBS += m +SRCFLAGS += -mcpu=cortex-m7 -falign-functions=16 +LDFLAGS += -mcpu=cortex-m7 +DEFS += CORTEX_USE_FPU=FALSE + diff --git a/tools/gmake_scripts/os_raw32.mk b/tools/gmake_scripts/os_raw32.mk new file mode 100644 index 00000000..1c96c8ec --- /dev/null +++ b/tools/gmake_scripts/os_raw32.mk @@ -0,0 +1,13 @@ +# +# This file is subject to the terms of the GFX License. If a copy of +# the license was not distributed with this file, you can obtain one at: +# +# http://ugfx.org/license.html +# + +# See readme.txt for the make API + +# Requirements: +# +# NONE +# From dbeb320fd3bf884a6c88f5183e66a91790bc98a6 Mon Sep 17 00:00:00 2001 From: inmarket Date: Fri, 10 Jul 2015 18:12:52 +1000 Subject: [PATCH 2/2] Example make for stm32m7 using ugfx make system (not complete) Changes to some stm32f746 files --- .../Example RAW32/Makefile | 95 +++++++++++++++++++ ...STM32F746Discovery.h => board_STM32LTDC.h} | 0 .../stm32f746g_discovery_sdram.c | 1 + .../STM32F746-Discovery/stm32f7xx_ll_fmc.h | 1 + 4 files changed, 97 insertions(+) create mode 100644 boards/base/STM32F746-Discovery/Example RAW32/Makefile rename boards/base/STM32F746-Discovery/{board_STM32F746Discovery.h => board_STM32LTDC.h} (100%) diff --git a/boards/base/STM32F746-Discovery/Example RAW32/Makefile b/boards/base/STM32F746-Discovery/Example RAW32/Makefile new file mode 100644 index 00000000..48283ebb --- /dev/null +++ b/boards/base/STM32F746-Discovery/Example RAW32/Makefile @@ -0,0 +1,95 @@ +# Possible Targets: all clean Debug cleanDebug Release cleanRelease + +############################################################################################## +# Settings +# + +# General settings + # See $(GFXLIB)/tools/gmake_scripts/readme.txt for the list of variables + OPT_OS = raw32 + OPT_THUMB = yes + OPT_LINK_OPTIMIZE = yes + OPT_CPU = stm32m7 + +# uGFX settings + # See $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk for the list of variables + GFXLIB = ../uGFX + GFXBOARD = STM32F746-Discovery + GFXDEMO = modules/gwin/widgets + #GFXDRIVERS = + +# ChibiOS settings +ifeq ($(OPT_OS),chibios) + # See $(GFXLIB)/tools/gmake_scripts/os_chibios.mk for the list of variables + CHIBIOS = ../ChibiOS + CHIBIOS_BOARD = ST_STM32F429I_DISCOVERY + CHIBIOS_PLATFORM = STM32F4xx + CHIBIOS_PORT = GCC/ARMCMx/STM32F4xx + CHIBIOS_LDSCRIPT = STM32F407xG.ld + + #CHIBIOS = ../ChibiOS3 + #CHIBIOS_VERSION = 3 + #CHIBIOS_BOARD = ST_STM32F429I_DISCOVERY + #CHIBIOS_CPUCLASS = ARMCMx + #CHIBIOS_PLATFORM = STM32/STM32F4xx + #CHIBIOS_PORT = stm32f4xx + #CHIBIOS_LDSCRIPT = STM32F407xG.ld +endif + +CMSIS = CMSIS +HAL = STM32F7xx_HAL_Driver +CONTROLLER = STM32F746xx + +############################################################################################## +# Set these for your project +# + +ARCH = arm-none-eabi- +SRCFLAGS = -ggdb -O0 +CFLAGS = +CXXFLAGS = -fno-rtti +ASFLAGS = +LDFLAGS = + +#SRC = $(HAL)/Src/stm32f7xx_hal.c \ + $(HAL)/Src/stm32f7xx_hal_cortex.c \ + $(HAL)/Src/stm32f7xx_hal_flash.c \ + $(HAL)/Src/stm32f7xx_hal_flash_ex.c \ + $(HAL)/Src/stm32f7xx_hal_rcc.c \ + $(HAL)/Src/stm32f7xx_hal_rcc_ex.h \ + $(HAL)/Src/stm32f7xx_hal_gpio.c \ + $(HAL)/Src/stm32f7xx_hal_pwr.c \ + $(HAL)/Src/stm32f7xx_hal_pwr_ex.c \ + $(HAL)/Src/stm32f7xx_hal_ltdc.c \ + STM32746G-Discovery/stm32746g_discovery.c \ + stm32f7xx_hal_msp.c \ + stm32f7xx_it.c \ + system_stm32f7xx.c \ + ugfx_raw32_implementations.c \ + main.c \ + startup_stm32f746xx.s + +OBJS = +DEFS = +LIBS = +INCPATH = $(CMSIS)/Device/ST/STM32F7xx/Include \ + $(CMSIS)/Include \ + $(HAL)/Inc \ + STM32746G-Discovery + +LIBPATH = +LDSCRIPT = stm32f746nghx_flash.ld + +############################################################################################## +# These should be at the end +# + +include $(GFXLIB)/tools/gmake_scripts/library_ugfx.mk +include $(GFXLIB)/tools/gmake_scripts/os_$(OPT_OS).mk +include $(GFXLIB)/tools/gmake_scripts/compiler_gcc.mk +# *** EOF *** + +#ASFLAGS = -ggdb -Wall +#CFLAGS = -ggdb -g3 -Wall -std=c99 -O0 +#CPPFLAGS = -ggdb -Wall +#LDFLAGS = -fdata-sections diff --git a/boards/base/STM32F746-Discovery/board_STM32F746Discovery.h b/boards/base/STM32F746-Discovery/board_STM32LTDC.h similarity index 100% rename from boards/base/STM32F746-Discovery/board_STM32F746Discovery.h rename to boards/base/STM32F746-Discovery/board_STM32LTDC.h diff --git a/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c b/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c index 0ef2d634..5fc5e559 100644 --- a/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c +++ b/boards/base/STM32F746-Discovery/stm32f746g_discovery_sdram.c @@ -76,6 +76,7 @@ */ /* Includes ------------------------------------------------------------------*/ +#include "gfx.h" #include "stm32f746g_discovery_sdram.h" /** @addtogroup BSP diff --git a/boards/base/STM32F746-Discovery/stm32f7xx_ll_fmc.h b/boards/base/STM32F746-Discovery/stm32f7xx_ll_fmc.h index 019ec064..85e8bedf 100644 --- a/boards/base/STM32F746-Discovery/stm32f7xx_ll_fmc.h +++ b/boards/base/STM32F746-Discovery/stm32f7xx_ll_fmc.h @@ -44,6 +44,7 @@ #endif /* Includes ------------------------------------------------------------------*/ +#include "gfx.h" #include "stm32f7xx_hal_def.h" /** @addtogroup STM32F7xx_HAL_Driver