Some fixes for STM32F2xx

This commit is contained in:
Raphael Coeffic
2022-03-20 16:22:13 +01:00
parent 346de7ece4
commit 661e12b7e9
3 changed files with 19 additions and 2 deletions
@@ -27,6 +27,12 @@ extern "C" {
#include "STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_tim.h"
#include "STM32F4xx_HAL_Driver/Inc/stm32f4xx_ll_dma.h"
#elif defined(STM32F2)
// Workaround to prevent the other CMSIS header to be included
// and fix some missing items in the old one
#include "thirdparty/CMSIS/Include/cmsis_compiler.h"
#define __CORE_CM3_H_GENERIC
#include "CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h"
#include "STM32F2xx_HAL_Driver/Inc/stm32f2xx_ll_gpio.h"
#include "STM32F2xx_HAL_Driver/Inc/stm32f2xx_ll_tim.h"
@@ -1,7 +1,6 @@
set(CPU_FAMILY STM32)
set(MCU cortex-m3)
set(FPU_FLAGS "")
set(STM32LIB_DIR ${THIRDPARTY_DIR}/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries)
# STM32 HAL/LL library
set(STM32CUBE_DIR ${THIRDPARTY_DIR}/STM32F2xx_HAL_Driver)
@@ -21,9 +20,10 @@ target_include_directories(stm32cube_ll PRIVATE
set(FIRMWARE_SRC ${FIRMWARE_SRC} $<TARGET_OBJECTS:stm32cube_ll>)
# StdPeriph library
set(STM32LIB_DIR ${THIRDPARTY_DIR}/STM32F2xx_StdPeriph_Lib_V1.1.0/Libraries)
include_directories(${STM32LIB_DIR}/STM32F2xx_StdPeriph_Driver/inc)
include_directories(${STM32LIB_DIR}/CMSIS/Device/ST/STM32F2xx/Include)
include_directories(${STM32LIB_DIR}/CMSIS/include)
include_directories(${STM32LIB_DIR}/CMSIS/Include)
add_definitions(-DSTM32F2)
+11
View File
@@ -88,6 +88,7 @@ elseif(PCB STREQUAL X9D+)
set(FLAVOUR x9d+)
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
set(AUX_SERIAL_DRIVER ../common/arm/stm32/aux_serial_driver.cpp)
set(STATUS_LEDS NO)
@@ -97,6 +98,7 @@ elseif(PCB STREQUAL X9D)
set(FLAVOUR x9d)
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
option(HAPTIC "Haptic support" OFF)
set(LUA_EXPORT lua_export_x9d)
@@ -132,6 +134,7 @@ elseif(PCB STREQUAL X7)
set(NAVIGATION_TYPE 9x)
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
set(LUA_EXPORT lua_export_t12)
add_definitions(-DRADIO_T12)
@@ -161,6 +164,7 @@ elseif(PCB STREQUAL X7)
set(NAVIGATION_TYPE 9x)
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
set(LUA_EXPORT lua_export_tlite)
add_definitions(-DRADIO_TLITE)
@@ -174,6 +178,7 @@ elseif(PCB STREQUAL X7)
set(NAVIGATION_TYPE x7)
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
set(ROTARY_ENCODER YES)
set(LUA_EXPORT lua_export_tx12)
@@ -215,6 +220,7 @@ elseif(PCB STREQUAL X7)
set(NAVIGATION_TYPE x7)
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
set(ROTARY_ENCODER NO)
set(LUA_EXPORT lua_export_t8)
@@ -255,6 +261,7 @@ elseif(PCB STREQUAL X7)
set(NAVIGATION_TYPE x7)
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
set(LUA_EXPORT lua_export_x7)
add_definitions(-DRADIO_X7)
@@ -279,6 +286,7 @@ elseif(PCB STREQUAL X9LITE)
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
set(HAPTIC YES)
set(LUA_EXPORT lua_export_x9lite)
@@ -305,6 +313,7 @@ elseif(PCB STREQUAL X9LITES)
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
set(HAPTIC YES)
set(LUA_EXPORT lua_export_x9lites)
@@ -332,6 +341,7 @@ elseif(PCB STREQUAL XLITE)
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
set(HAPTIC YES)
set(LUA_EXPORT lua_export_xlite)
@@ -357,6 +367,7 @@ elseif(PCB STREQUAL XLITES)
set(PWR_BUTTON "PRESS" CACHE STRING "Pwr button type (PRESS/SWITCH)")
set(CPU_TYPE STM32F2)
set(CPU_TYPE_FULL STM32F205xE) # for size report
add_definitions(-DSTM32F205xx)
set(LINKER_SCRIPT targets/taranis/stm32f2_flash.ld)
set(HAPTIC YES)
set(LUA_EXPORT lua_export_xlites)