Preliminary F446 support

This commit is contained in:
Martin Budden 2017-02-22 09:24:42 +00:00
parent ddb25a9d5f
commit 9277a39dcf
7 changed files with 51 additions and 6 deletions

View File

@ -124,7 +124,7 @@ endif
# silently ignore if the file is not present. Allows for target specific. # silently ignore if the file is not present. Allows for target specific.
-include $(ROOT)/src/main/target/$(BASE_TARGET)/target.mk -include $(ROOT)/src/main/target/$(BASE_TARGET)/target.mk
F4_TARGETS = $(F405_TARGETS) $(F411_TARGETS) F4_TARGETS = $(F405_TARGETS) $(F411_TARGETS) $(F446_TARGETS)
F7_TARGETS = $(F7X2RE_TARGETS) $(F7X5XE_TARGETS) $(F7X5XG_TARGETS) $(F7X5XI_TARGETS) $(F7X6XG_TARGETS) F7_TARGETS = $(F7X2RE_TARGETS) $(F7X5XE_TARGETS) $(F7X5XG_TARGETS) $(F7X5XI_TARGETS) $(F7X6XG_TARGETS)
ifeq ($(filter $(TARGET),$(VALID_TARGETS)),) ifeq ($(filter $(TARGET),$(VALID_TARGETS)),)
@ -137,7 +137,7 @@ endif
128K_TARGETS = $(F1_TARGETS) 128K_TARGETS = $(F1_TARGETS)
256K_TARGETS = $(F3_TARGETS) 256K_TARGETS = $(F3_TARGETS)
512K_TARGETS = $(F411_TARGETS) $(F7X2RE_TARGETS) $(F7X5XE_TARGETS) 512K_TARGETS = $(F411_TARGETS) $(F446_TARGETS) $(F7X2RE_TARGETS) $(F7X5XE_TARGETS)
1024K_TARGETS = $(F405_TARGETS) $(F7X5XG_TARGETS) $(F7X6XG_TARGETS) 1024K_TARGETS = $(F405_TARGETS) $(F7X5XG_TARGETS) $(F7X6XG_TARGETS)
2048K_TARGETS = $(F7X5XI_TARGETS) 2048K_TARGETS = $(F7X5XI_TARGETS)
@ -171,6 +171,7 @@ CFLAGS += -DDEBUG_HARDFAULTS
endif endif
REVISION := $(shell git log -1 --format="%h") REVISION := $(shell git log -1 --format="%h")
GIT_TAG = $(shell git describe --tags)
FC_VER_MAJOR := $(shell grep " FC_VERSION_MAJOR" src/main/build/version.h | awk '{print $$3}' ) FC_VER_MAJOR := $(shell grep " FC_VERSION_MAJOR" src/main/build/version.h | awk '{print $$3}' )
FC_VER_MINOR := $(shell grep " FC_VERSION_MINOR" src/main/build/version.h | awk '{print $$3}' ) FC_VER_MINOR := $(shell grep " FC_VERSION_MINOR" src/main/build/version.h | awk '{print $$3}' )
@ -263,6 +264,10 @@ ifeq ($(TARGET),$(filter $(TARGET), $(F411_TARGETS)))
EXCLUDES += stm32f4xx_fsmc.c EXCLUDES += stm32f4xx_fsmc.c
endif endif
ifeq ($(TARGET),$(filter $(TARGET), $(F446_TARGETS)))
EXCLUDES += stm32f4xx_fsmc.c
endif
STDPERIPH_SRC := $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC)) STDPERIPH_SRC := $(filter-out ${EXCLUDES}, $(STDPERIPH_SRC))
#USB #USB
@ -319,6 +324,10 @@ else ifeq ($(TARGET),$(filter $(TARGET),$(F405_TARGETS)))
DEVICE_FLAGS = -DSTM32F40_41xxx DEVICE_FLAGS = -DSTM32F40_41xxx
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f405.ld LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f405.ld
STARTUP_SRC = startup_stm32f40xx.s STARTUP_SRC = startup_stm32f40xx.s
else ifeq ($(TARGET),$(filter $(TARGET),$(F446_TARGETS)))
DEVICE_FLAGS = -DSTM32F446xx
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f446.ld
STARTUP_SRC = startup_stm32f446xx.s
else else
$(error Unknown MCU for F4 target) $(error Unknown MCU for F4 target)
endif endif
@ -970,6 +979,7 @@ CFLAGS += $(ARCH_FLAGS) \
-D'__FORKNAME__="$(FORKNAME)"' \ -D'__FORKNAME__="$(FORKNAME)"' \
-D'__TARGET__="$(TARGET)"' \ -D'__TARGET__="$(TARGET)"' \
-D'__REVISION__="$(REVISION)"' \ -D'__REVISION__="$(REVISION)"' \
-D'__GIT_TAG__="$(GIT_TAG)"' \
-save-temps=obj \ -save-temps=obj \
-MMD -MP -MMD -MP

View File

@ -42,6 +42,8 @@ extern uint8_t __config_end;
# define FLASH_PAGE_SIZE ((uint32_t)0x20000) # define FLASH_PAGE_SIZE ((uint32_t)0x20000)
# elif defined(STM32F427_437xx) # elif defined(STM32F427_437xx)
# define FLASH_PAGE_SIZE ((uint32_t)0x20000) // 128K sectors # define FLASH_PAGE_SIZE ((uint32_t)0x20000) // 128K sectors
# elif defined (STM32F446xx)
# define FLASH_PAGE_SIZE ((uint32_t)0x20000)
// F7 // F7
#elif defined(STM32F722xx) #elif defined(STM32F722xx)
# define FLASH_PAGE_SIZE ((uint32_t)0x20000) # define FLASH_PAGE_SIZE ((uint32_t)0x20000)

View File

@ -31,7 +31,7 @@ const timerDef_t timerDefinitions[HARDWARE_TIMER_DEFINITION_COUNT] = {
{ .TIMx = TIM5, .rcc = RCC_APB1(TIM5), .inputIrq = TIM5_IRQn}, { .TIMx = TIM5, .rcc = RCC_APB1(TIM5), .inputIrq = TIM5_IRQn},
{ .TIMx = TIM6, .rcc = RCC_APB1(TIM6), .inputIrq = 0}, { .TIMx = TIM6, .rcc = RCC_APB1(TIM6), .inputIrq = 0},
{ .TIMx = TIM7, .rcc = RCC_APB1(TIM7), .inputIrq = 0}, { .TIMx = TIM7, .rcc = RCC_APB1(TIM7), .inputIrq = 0},
#ifndef STM32F411xE #if !defined(STM32F411xE) && !defined(STM32F446xx)
{ .TIMx = TIM8, .rcc = RCC_APB2(TIM8), .inputIrq = TIM8_CC_IRQn}, { .TIMx = TIM8, .rcc = RCC_APB2(TIM8), .inputIrq = TIM8_CC_IRQn},
#endif #endif
{ .TIMx = TIM9, .rcc = RCC_APB2(TIM9), .inputIrq = TIM1_BRK_TIM9_IRQn}, { .TIMx = TIM9, .rcc = RCC_APB2(TIM9), .inputIrq = TIM1_BRK_TIM9_IRQn},

View File

@ -28,7 +28,7 @@
#define STM32F7 #define STM32F7
#elif defined(STM32F40_41xxx) || defined (STM32F411xE) #elif defined(STM32F40_41xxx) || defined (STM32F411xE) || defined (STM32F446xx)
#include "stm32f4xx_conf.h" #include "stm32f4xx_conf.h"
#include "stm32f4xx_rcc.h" #include "stm32f4xx_rcc.h"

View File

@ -3,7 +3,7 @@
** **
** File : stm32_flash_f411.ld ** File : stm32_flash_f411.ld
** **
** Abstract : Linker script for STM32F11 Device with ** Abstract : Linker script for STM32F411 Device with
** 512KByte FLASH, 128KByte RAM ** 512KByte FLASH, 128KByte RAM
** **
***************************************************************************** *****************************************************************************

View File

@ -1,7 +1,7 @@
/* /*
***************************************************************************** *****************************************************************************
** **
** File : stm32_flash_f411.ld ** File : stm32_flash_f411_opbl.ld
** **
** Abstract : Linker script for STM32F411 Device with ** Abstract : Linker script for STM32F411 Device with
** 512KByte FLASH, 128KByte RAM ** 512KByte FLASH, 128KByte RAM

View File

@ -0,0 +1,33 @@
/*
*****************************************************************************
**
** File : stm32_flash_f446.ld
**
** Abstract : Linker script for STM32F446 Device with
** 512KByte FLASH, 128KByte RAM
**
*****************************************************************************
*/
/* Entry Point */
ENTRY(Reset_Handler)
/*
0x08000000 to 0x08080000 512K full flash,
0x08000000 to 0x0805FFFF 384K firmware,
0x08060000 to 0x08080000 128K config,
*/
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 384K
FLASH_CONFIG (r) : ORIGIN = 0x08060000, LENGTH = 128K
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
}
REGION_ALIAS("STACKRAM", RAM)
INCLUDE "stm32_flash.ld"