diff --git a/CMakeLists.txt b/CMakeLists.txt index 384edba562..781c072653 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/${TOOLCHAIN}.cmake") if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") set(IS_RELEASE_BUILD ON) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) endif() project(INAV VERSION 2.5.0) diff --git a/cmake/arm-none-eabi.cmake b/cmake/arm-none-eabi.cmake index 83cbe322b0..e86cb6a507 100644 --- a/cmake/arm-none-eabi.cmake +++ b/cmake/arm-none-eabi.cmake @@ -51,17 +51,17 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES set(arm_none_eabi_debug "-Og -g") # We set -Os or -O2 depending on the MCU family -set(arm_none_eabi_release "-DNDEBUG -flto -fuse-linker-plugin") +set(arm_none_eabi_release "-DNDEBUG") set(arm_none_eabi_relwithdebinfo "-ggdb3 ${arm_none_eabi_release}") -SET(CMAKE_C_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "c compiler flags debug") -SET(CMAKE_CXX_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "c++ compiler flags debug") -SET(CMAKE_ASM_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "asm compiler flags debug") +set(CMAKE_C_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "c compiler flags debug") +set(CMAKE_CXX_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "c++ compiler flags debug") +set(CMAKE_ASM_FLAGS_DEBUG ${arm_none_eabi_debug} CACHE INTERNAL "asm compiler flags debug") -SET(CMAKE_C_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "c compiler flags release") -SET(CMAKE_CXX_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "cxx compiler flags release") -SET(CMAKE_ASM_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "asm compiler flags release") +set(CMAKE_C_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "c compiler flags release") +set(CMAKE_CXX_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "cxx compiler flags release") +set(CMAKE_ASM_FLAGS_RELEASE ${arm_none_eabi_release} CACHE INTERNAL "asm compiler flags release") -SET(CMAKE_C_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "c compiler flags release") -SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "cxx compiler flags release") -SET(CMAKE_ASM_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "asm compiler flags release") +set(CMAKE_C_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "c compiler flags release") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "cxx compiler flags release") +set(CMAKE_ASM_FLAGS_RELWITHDEBINFO ${arm_none_eabi_relwithdebinfo} CACHE INTERNAL "asm compiler flags release") diff --git a/cmake/main.cmake b/cmake/main.cmake index ccf39b8514..b5f43099ed 100644 --- a/cmake/main.cmake +++ b/cmake/main.cmake @@ -39,23 +39,32 @@ macro(glob_except) # var-name pattern excludes-var exclude_basenames(${ARGV0} ${ARGV2}) endmacro() -function(setup_firmware_target name) - target_compile_options(${name} PRIVATE ${MAIN_COMPILE_OPTIONS}) - target_include_directories(${name} PRIVATE ${MAIN_INCLUDE_DIRS}) - target_compile_definitions(${name} PRIVATE ${MAIN_DEFINITIONS} __TARGET__="${name}" ${name}) - enable_settings(${name}) +function(get_generated_files_dir output target_name) + set(${output} ${CMAKE_CURRENT_BINARY_DIR}/${target_name} PARENT_SCOPE) +endfunction() + +function(setup_executable exe name) + get_generated_files_dir(generated_dir ${name}) + target_compile_options(${exe} PRIVATE ${MAIN_COMPILE_OPTIONS}) + target_include_directories(${exe} PRIVATE ${generated_dir} ${MAIN_INCLUDE_DIRS}) + target_compile_definitions(${exe} PRIVATE ${MAIN_DEFINITIONS} __TARGET__="${name}" ${name}) # XXX: Don't make SETTINGS_GENERATED_C part of the build, # since it's compiled via #include in settings.c. This will # change once we move off PGs - target_sources(${name} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${name}/${SETTINGS_GENERATED_H}") - set_target_properties(${name} PROPERTIES + target_sources(${exe} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/${name}/${SETTINGS_GENERATED_H}") + set_target_properties(${exe} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" ) +endfunction() + +function(setup_firmware_target exe name) + setup_executable(${exe} ${name}) + enable_settings(${exe} ${name}) get_property(targets GLOBAL PROPERTY VALID_TARGETS) list(APPEND targets ${name}) set_property(GLOBAL PROPERTY VALID_TARGETS "${targets}") - setup_openocd(${name}) - setup_svd(${name}) + setup_openocd(${exe} ${name}) + setup_svd(${exe} ${name}) endfunction() function(exclude_from_all target) diff --git a/cmake/openocd.cmake b/cmake/openocd.cmake index bfb0980615..a43a502c2a 100644 --- a/cmake/openocd.cmake +++ b/cmake/openocd.cmake @@ -34,13 +34,13 @@ if(OPENOCD_PATH) ) endif() -function(setup_openocd target_name) +function(setup_openocd target_exe target_name) if(OPENOCD_INTERFACE) set(openocd_interface ${OPENOCD_INTERFACE}) else() - get_property(openocd_interface TARGET ${target_name} PROPERTY OPENOCD_DEFAULT_INTERFACE) + get_property(openocd_interface TARGET ${target_exe} PROPERTY OPENOCD_DEFAULT_INTERFACE) endif() - get_property(openocd_target TARGET ${target_name} PROPERTY OPENOCD_TARGET) + get_property(openocd_target TARGET ${target_exe} PROPERTY OPENOCD_TARGET) if(OPENOCD_CFG OR (openocd_target AND openocd_interface)) set(openocd_run_target "openocd_${target_name}") if (OPENOCD_CFG AND NOT OPENOCD_CFG STREQUAL "") @@ -74,10 +74,10 @@ function(setup_openocd target_name) add_custom_target(${openocd_flash_target} ${CMAKE_COMMAND} -E env OPENOCD_CMD=${OPENOCD_PATH} ${MAIN_UTILS_DIR}/openocd_flash.py -f - ${openocd_cfg_path} $ + ${openocd_cfg_path} $ COMMENT "Flashing ${target_name} with openocd" - DEPENDS ${openocd_cfg_path} ${target_name} + DEPENDS ${openocd_cfg_path} ${target_exe} ) exclude_from_all(${openocd_flash_target}) endif() diff --git a/cmake/settings.cmake b/cmake/settings.cmake index 1521fbc8b9..d3e3db8f3a 100644 --- a/cmake/settings.cmake +++ b/cmake/settings.cmake @@ -4,13 +4,13 @@ set(SETTINGS_GENERATED_H "${SETTINGS_GENERATED}.h") set(SETTINGS_FILE "${MAIN_SRC_DIR}/fc/settings.yaml") set(SETTINGS_GENERATOR "${MAIN_UTILS_DIR}/settings.rb") -function(enable_settings target) - set(dir "${CMAKE_CURRENT_BINARY_DIR}/${target}") - target_include_directories(${target} PRIVATE ${dir}) - get_target_property(options ${target} COMPILE_OPTIONS) - get_target_property(includes ${target} INCLUDE_DIRECTORIES) + +function(enable_settings exe name) + get_generated_files_dir(dir ${name}) + get_target_property(options ${exe} COMPILE_OPTIONS) + get_target_property(includes ${exe} INCLUDE_DIRECTORIES) list(TRANSFORM includes PREPEND "-I") - get_target_property(defs ${target} COMPILE_DEFINITIONS) + get_target_property(defs ${exe} COMPILE_DEFINITIONS) list(TRANSFORM defs PREPEND "-D") list(APPEND cflags ${options}) list(APPEND cflags ${includes}) @@ -18,7 +18,7 @@ function(enable_settings target) add_custom_command( OUTPUT ${dir}/${SETTINGS_GENERATED_H} ${dir}/${SETTINGS_GENERATED_C} COMMAND - ${CMAKE_COMMAND} -E env CFLAGS="${cflags}" TARGET=${target} + ${CMAKE_COMMAND} -E env CFLAGS="${cflags}" TARGET=${name} ${RUBY_EXECUTABLE} ${SETTINGS_GENERATOR} ${MAIN_DIR} ${SETTINGS_FILE} -o "${dir}" DEPENDS ${SETTINGS_GENERATOR} ${SETTINGS_FILE} ) diff --git a/cmake/stm32-bootloader.cmake b/cmake/stm32-bootloader.cmake new file mode 100644 index 0000000000..3bb13ae1bf --- /dev/null +++ b/cmake/stm32-bootloader.cmake @@ -0,0 +1,30 @@ +main_sources(BOOTLOADER_SOURCES + common/log.c + common/log.h + common/printf.c + common/printf.h + common/string_light.c + common/string_light.h + common/typeconversion.c + common/typeconversion.h + + drivers/bus.c + drivers/bus_busdev_i2c.c + drivers/bus_busdev_spi.c + drivers/bus_i2c_soft.c + drivers/io.c + drivers/light_led.c + drivers/persistent.c + drivers/rcc.c + drivers/serial.c + drivers/system.c + drivers/time.c + drivers/timer.c + + fc/firmware_update_common.c + fc/firmware_update_common.h + + target/common_hardware.c +) + +list(APPEND BOOTLOADER_SOURCES ${MAIN_DIR}/src/bl/bl_main.c) diff --git a/cmake/stm32.cmake b/cmake/stm32.cmake index 213f3819d2..46c47f74de 100644 --- a/cmake/stm32.cmake +++ b/cmake/stm32.cmake @@ -1,4 +1,5 @@ include(arm-none-eabi) +include(stm32-bootloader) include(stm32f3) include(stm32f4) include(stm32f7) @@ -49,7 +50,6 @@ main_sources(STM32_ASYNCFATFS_SRC ) main_sources(STM32_MSC_SRC - msc/usbd_msc_desc.c msc/usbd_storage.c ) @@ -159,90 +159,284 @@ macro(get_stm32_target_features output_var dir target_name) endif() endmacro() -function(target_stm32 name startup ldscript) - set(target_definitions) +function(get_stm32_flash_size out size) + # 4: 16, 6: 32, 8: 64, B: 128, C: 256, D: 384, E: 512, F: 768, G: 1024, H: 1536, I: 2048 KiB + string(TOUPPER ${size} s) + if(${s} STREQUAL "4") + set(${out} 16 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "6") + set(${out} 32 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "8") + set(${out} 64 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "8") + set(${out} 64 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "B") + set(${out} 128 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "C") + set(${out} 256 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "D") + set(${out} 384 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "E") + set(${out} 512 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "F") + set(${out} 768 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "G") + set(${out} 1024 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "H") + set(${out} 1536 PARENT_SCOPE) + return() + endif() + if(${s} STREQUAL "I") + set(${out} 2048 PARENT_SCOPE) + return() + endif() +endfunction() + +function(add_hex_target name exe hex) + add_custom_target(${name} ALL + ${CMAKE_OBJCOPY} -Oihex $ ${hex} + BYPRODUCTS ${hex} + ) +endfunction() + +function(add_bin_target name exe bin) + add_custom_target(${name} ALL + ${CMAKE_OBJCOPY} -Obinary $ ${bin} + BYPRODUCTS ${bin} + ) +endfunction() + +function(generate_map_file target) + target_link_options(${target} PRIVATE "-Wl,-Map,$/$.map") +endfunction() + +function(set_linker_script target script) + set(script_path ${STM32_LINKER_DIR}/${args_LINKER_SCRIPT}.ld) + if(NOT EXISTS ${script_path}) + message(FATAL_ERROR "linker script ${script_path} doesn't exist") + endif() + set_target_properties(${target} PROPERTIES LINK_DEPENDS ${script_path}) + target_link_options(${elf_target} PRIVATE -T${script_path}) +endfunction() + +function(add_stm32_executable) + cmake_parse_arguments( + args + # Boolean arguments + "" + # Single value arguments + "FILENAME;NAME;OPTIMIZATION;OUTPUT_BIN_FILENAME;OUTPUT_HEX_FILENAME;OUTPUT_TARGET_NAME" + # Multi-value arguments + "COMPILE_DEFINITIONS;COMPILE_OPTIONS;INCLUDE_DIRECTORIES;LINK_OPTIONS;LINKER_SCRIPT;SOURCES" + # Start parsing after the known arguments + ${ARGN} + ) + set(elf_target ${args_NAME}.elf) + add_executable(${elf_target}) + set_target_properties(${elf_target} PROPERTIES OUTPUT_NAME ${args_NAME}) + target_sources(${elf_target} PRIVATE ${args_SOURCES}) + target_include_directories(${elf_target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${args_INCLUDE_DIRECTORIES} ${STM32_INCLUDE_DIRS}) + target_compile_definitions(${elf_target} PRIVATE ${args_COMPILE_DEFINITIONS}) + target_compile_options(${elf_target} PRIVATE ${STM32_COMPILE_OPTIONS} ${args_COMPILE_OPTIONS}) + if(WARNINGS_AS_ERRORS) + target_compile_options(${elf_target} PRIVATE -Werror) + endif() + if (IS_RELEASE_BUILD) + target_compile_options(${elf_target} PRIVATE ${args_OPTIMIZATION}) + target_link_options(${elf_target} PRIVATE ${args_OPTIMIZATION}) + endif() + target_link_libraries(${elf_target} PRIVATE ${STM32_LINK_LIBRARIES}) + target_link_options(${elf_target} PRIVATE ${STM32_LINK_OPTIONS} ${args_LINK_OPTIONS}) + generate_map_file(${elf_target}) + set_linker_script(${elf_target} ${args_LINKER_SCRIPT}) + if(args_FILENAME) + set(basename ${CMAKE_BINARY_DIR}/${args_FILENAME}) + set(hex_filename ${basename}.hex) + add_hex_target(${args_NAME} ${elf_target} ${hex_filename}) + set(bin_filename ${basename}.bin) + add_bin_target(${args_NAME}.bin ${elf_target} ${bin_filename}) + endif() + if(args_OUTPUT_BIN_FILENAME) + set(${args_OUTPUT_BIN_FILENAME} ${bin_filename} PARENT_SCOPE) + endif() + if(args_OUTPUT_TARGET_NAME) + set(${args_OUTPUT_TARGET_NAME} ${elf_target} PARENT_SCOPE) + endif() + if(args_OUTPUT_HEX_FILENAME) + set(${args_OUTPUT_HEX_FILENAME} ${hex_filename} PARENT_SCOPE) + endif() +endfunction() + +function(target_stm32) # Parse keyword arguments cmake_parse_arguments( - PARSED_ARGS - "DISABLE_MSC" # Boolean arguments - "HSE_MHZ;OPENOCD_TARGET;SVD" # Single value arguments - "DEFINITIONS" # Multi-value arguments - ${ARGN} # Start parsing after the known arguments + args + # Boolean arguments + "DISABLE_MSC;BOOTLOADER" + # Single value arguments + "HSE_MHZ;LINKER_SCRIPT;NAME;OPENOCD_TARGET;OPTIMIZATION;STARTUP;SVD" + # Multi-value arguments + "COMPILE_DEFINITIONS;COMPILE_OPTIONS;INCLUDE_DIRECTORIES;LINK_OPTIONS;SOURCES;MSC_SOURCES;MSC_INCLUDE_DIRECTORIES;VCP_SOURCES;VCP_INCLUDE_DIRECTORIES" + # Start parsing after the known arguments + ${ARGN} ) + set(name ${args_NAME}) - if (PARSED_ARGS_HSE_MHZ) - set(hse_mhz ${PARSED_ARGS_HSE_MHZ}) + if (args_HSE_MHZ) + set(hse_mhz ${args_HSE_MHZ}) else() set(hse_mhz ${STM32_DEFAULT_HSE_MHZ}) endif() - # Main .elf target - add_executable(${name}) - target_sources(${name} PRIVATE "${STM32_STARTUP_DIR}/${startup}" ${COMMON_SRC} ${CMSIS_DSP_SRC}) + set(target_sources ${STM32_STARTUP_DIR}/${args_STARTUP}) + list(APPEND target_sources ${args_SOURCES}) file(GLOB target_c_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.c") file(GLOB target_h_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.h") - target_sources(${name} PRIVATE ${target_c_sources} ${target_h_sources}) - target_include_directories(${name} PRIVATE . ${STM32_INCLUDE_DIRS}) - target_compile_options(${name} PRIVATE ${STM32_COMPILE_OPTIONS}) - if(WARNINGS_AS_ERRORS) - target_compile_options(${name} PRIVATE -Werror) - endif() - target_link_libraries(${name} PRIVATE ${STM32_LINK_LIBRARIES}) - target_link_options(${name} PRIVATE ${STM32_LINK_OPTIONS}) - target_link_options(${name} PRIVATE "-T${STM32_LINKER_DIR}/${ldscript}") - target_link_options(${name} PRIVATE "-Wl,-Map,$.map") + list(APPEND target_sources ${target_c_sources} ${target_h_sources}) + + set(target_include_directories ${args_INCLUDE_DIRECTORIES}) set(target_definitions ${STM32_DEFINITIONS}) + + get_stm32_target_features(features "${CMAKE_CURRENT_SOURCE_DIR}" ${name}) + set_property(TARGET ${elf_target} PROPERTY FEATURES ${features}) + + if(VCP IN_LIST features) + list(APPEND target_sources ${STM32_VCP_SRC} ${args_VCP_SOURCES}) + list(APPEND target_include_directories ${args_VCP_INCLUDE_DIRECTORIES}) + endif() + if(SDCARD IN_LIST features) + list(APPEND target_sources ${STM32_SDCARD_SRC} ${STM32_ASYNCFATFS_SRC}) + endif() + + set(msc_sources) + if(NOT args_DISABLE_MSC AND MSC IN_LIST features) + list(APPEND target_include_directories ${args_MSC_INCLUDE_DIRECTORIES}) + list(APPEND msc_sources ${STM32_MSC_SRC} ${args_MSC_SOURCES}) + list(APPEND target_definitions USE_USB_MSC) + if(FLASHFS IN_LIST features) + list(APPEND msc_sources ${STM32_MSC_FLASH_SRC}) + endif() + if (SDCARD IN_LIST features) + if (SDIO IN_LIST features) + list(APPEND msc_sources ${STM32_MSC_SDCARD_SDIO_SRC}) + else() + list(APPEND msc_sources ${STM32_MSC_SDCARD_SPI_SRC}) + endif() + endif() + endif() + math(EXPR hse_value "${hse_mhz} * 1000000") list(APPEND target_definitions "HSE_VALUE=${hse_value}") - if(PARSED_ARGS_DEFINITIONS) - list(APPEND target_definitions ${PARSED_ARGS_DEFINITIONS}) + if(args_COMPILE_DEFINITIONS) + list(APPEND target_definitions ${args_COMPILE_DEFINITIONS}) endif() if(DEBUG_HARDFAULTS) list(APPEND target_definitions DEBUG_HARDFAULTS) endif() - target_compile_definitions(${name} PRIVATE ${target_definitions}) - get_stm32_target_features(features "${CMAKE_CURRENT_SOURCE_DIR}" ${name}) - set_property(TARGET ${name} PROPERTY FEATURES ${features}) - if(VCP IN_LIST features) - target_sources(${name} PRIVATE ${STM32_VCP_SRC}) - endif() - if(SDCARD IN_LIST features) - target_sources(${name} PRIVATE ${STM32_SDCARD_SRC} ${STM32_ASYNCFATFS_SRC}) - endif() - if(NOT PARSED_ARGS_DISABLE_MSC AND MSC IN_LIST features) - target_sources(${name} PRIVATE ${STM32_MSC_SRC}) - target_compile_definitions(${name} PRIVATE USE_USB_MSC) - if (FLASHFS IN_LIST features) - target_sources(${name} PRIVATE ${STM32_MSC_FLASH_SRC}) - endif() - if (SDCARD IN_LIST features) - if (SDIO IN_LIST features) - target_sources(${name} PRIVATE ${STM32_MSC_SDCARD_SDIO_SRC}) - else() - target_sources(${name} PRIVATE ${STM32_MSC_SDCARD_SPI_SRC}) - endif() - endif() - endif() - set_property(TARGET ${name} PROPERTY OPENOCD_TARGET ${PARSED_ARGS_OPENOCD_TARGET}) - set_property(TARGET ${name} PROPERTY OPENOCD_DEFAULT_INTERFACE stlink) - set_property(TARGET ${name} PROPERTY SVD ${PARSED_ARGS_SVD}) - # Generate .hex - # XXX: Generator expressions are not supported for add_custom_command() - # OUTPUT nor BYPRODUCTS, so we can't rely of them. Instead, build the filename - # for the .hex from the target name - set(hexdir "${CMAKE_BINARY_DIR}/hex") - set(hex "${hexdir}/${PROJECT_NAME}_${name}_${FIRMWARE_VERSION}.hex") - add_custom_command(TARGET ${name} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory ${hexdir} - COMMAND ${CMAKE_OBJCOPY} -Oihex $ ${hex} - BYPRODUCTS ${hex} + string(TOLOWER ${PROJECT_NAME} lowercase_project_name) + set(binary_name ${lowercase_project_name}_${FIRMWARE_VERSION}_${name}) + + # Main firmware + add_stm32_executable( + NAME ${name} + FILENAME ${binary_name} + SOURCES ${target_sources} ${msc_sources} ${CMSIS_DSP_SRC} ${COMMON_SRC} + COMPILE_DEFINITIONS ${target_definitions} + COMPILE_OPTIONS ${args_COMPILE_OPTIONS} + INCLUDE_DIRECTORIES ${target_include_directories} + LINK_OPTIONS ${args_LINK_OPTIONS} + LINKER_SCRIPT ${args_LINKER_SCRIPT} + OPTIMIZATION ${args_OPTIMIZATION} + + OUTPUT_HEX_FILENAME main_hex_filename + OUTPUT_TARGET_NAME main_target_name ) + + set_property(TARGET ${main_target_name} PROPERTY OPENOCD_TARGET ${args_OPENOCD_TARGET}) + set_property(TARGET ${main_target_name} PROPERTY OPENOCD_DEFAULT_INTERFACE stlink) + set_property(TARGET ${main_target_name} PROPERTY SVD ${args_SVD}) + + setup_firmware_target(${main_target_name} ${name}) + + if(args_BOOTLOADER) + # Bootloader for the target + set(bl_suffix _bl) + add_stm32_executable( + NAME ${name}${bl_suffix} + FILENAME ${binary_name}${bl_suffix} + SOURCES ${target_sources} ${BOOTLOADER_SOURCES} + COMPILE_DEFINITIONS ${target_definitions} BOOTLOADER MSP_FIRMWARE_UPDATE + COMPILE_OPTIONS ${args_COMPILE_OPTIONS} + INCLUDE_DIRECTORIES ${target_include_directories} + LINK_OPTIONS ${args_LINK_OPTIONS} + LINKER_SCRIPT ${args_LINKER_SCRIPT}${bl_suffix} + OPTIMIZATION ${args_OPTIMIZATION} + + OUTPUT_BIN_FILENAME bl_bin_filename + OUTPUT_HEX_FILENAME bl_hex_filename + OUTPUT_TARGET_NAME bl_target_name + ) + setup_executable(${bl_target_name} ${name}) + + # Main firmware, but for running with the bootloader + set(for_bl_suffix _for_bl) + add_stm32_executable( + NAME ${name}${for_bl_suffix} + FILENAME ${binary_name}${for_bl_suffix} + SOURCES ${target_sources} ${msc_sources} ${CMSIS_DSP_SRC} ${COMMON_SRC} + COMPILE_DEFINITIONS ${target_definitions} MSP_FIRMWARE_UPDATE + COMPILE_OPTIONS ${args_COMPILE_OPTIONS} + INCLUDE_DIRECTORIES ${target_include_directories} + LINK_OPTIONS ${args_LINK_OPTIONS} + LINKER_SCRIPT ${args_LINKER_SCRIPT}${for_bl_suffix} + OPTIMIZATION ${args_OPTIMIZATION} + + OUTPUT_BIN_FILENAME for_bl_bin_filename + OUTPUT_HEX_FILENAME for_bl_hex_filename + OUTPUT_TARGET_NAME for_bl_target_name + ) + setup_executable(${for_bl_target_name} ${name}) + + # Combined with bootloader and main firmware + set(with_bl_suffix _with_bl) + set(combined_hex ${CMAKE_BINARY_DIR}/${binary_name}${with_bl_suffix}.hex) + add_custom_target(${name}${with_bl_suffix} + ${CMAKE_SOURCE_DIR}/src/utils/combine_tool ${bl_bin_filename} ${for_bl_bin_filename} ${combined_hex} + DEPENDS ${bl_bin_filename} ${for_bl_bin_filename} + BYPRODUCTS ${combined_hex} + ) + endif() + # clean_ set(clean_target "clean_${name}") add_custom_target(${clean_target} - COMMAND cmake -E rm -r "${CMAKE_CURRENT_BINARY_DIR}" + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E rm -r "${CMAKE_CURRENT_BINARY_DIR}" + COMMAND ${CMAKE_COMMAND} -E rm ${main_hex_filename} + COMMAND ${CMAKE_COMMAND} -E rm ${bl_hex_filename} + COMMAND ${CMAKE_COMMAND} -E rm ${main_hex_filename} COMMENT "Removing intermediate files for ${name}") set_property(TARGET ${clean_target} PROPERTY TARGET_MESSAGES OFF diff --git a/cmake/stm32f3.cmake b/cmake/stm32f3.cmake index 39279fa622..0e4dc764e3 100644 --- a/cmake/stm32f3.cmake +++ b/cmake/stm32f3.cmake @@ -52,35 +52,41 @@ set(STM32F3_DEFINITIONS USE_STDPERIPH_DRIVER ) -set(STM32F303_DEFINITIONS +set(STM32F303CC_DEFINITIONS STM32F303 STM32F303xC FLASH_SIZE=256 ) -function(target_stm32f3xx name startup ldscript) - # F3 targets don't support MSC - target_stm32(${name} ${startup} ${ldscript} DISABLE_MSC OPENOCD_TARGET stm32f3x ${ARGN}) - # F3 targets don't use -O2 to save size - if (IS_RELEASE_BUILD) - target_compile_options(${name} PRIVATE "-Os") - target_link_options(${name} PRIVATE "-Os") - endif() - target_sources(${name} PRIVATE ${STM32_STDPERIPH_SRC} ${STM32F3_STDPERIPH_SRC} ${STM32F3_SRC}) - target_compile_options(${name} PRIVATE ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_COMPILE_OPTIONS}) - target_include_directories(${name} PRIVATE ${STM32F3_INCLUDE_DIRS}) - target_compile_definitions(${name} PRIVATE ${STM32F3_DEFINITIONS}) - target_link_options(${name} PRIVATE ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_LINK_OPTIONS}) +function(target_stm32f3xx) + # F3 targets don't support MSC and use -Os instead of -O2 to save size + target_stm32( + SOURCES ${STM32_STDPERIPH_SRC} ${STM32F3_STDPERIPH_SRC} ${STM32F3_SRC} + COMPILE_DEFINITIONS ${STM32F3_DEFINITIONS} + COMPILE_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_COMPILE_OPTIONS} + INCLUDE_DIRECTORIES ${STM32F3_INCLUDE_DIRS} + LINK_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_LINK_OPTIONS} - get_property(features TARGET ${name} PROPERTY FEATURES) - if(VCP IN_LIST features) - target_include_directories(${name} PRIVATE ${STM32F3_USB_INCLUDE_DIRS}) - target_sources(${name} PRIVATE ${STM32F3_USB_SRC} ${STM32F3_VCP_SRC}) - endif() + VCP_SOURCES ${STM32F3_USB_SRC} ${STM32F3_VCP_SRC} + VCP_INCLUDE_DIRECTORIES ${STM32F3_USB_INCLUDE_DIRS} + + DISABLE_MSC + + OPTIMIZATION -Os + + OPENOCD_TARGET stm32f3x + + ${ARGN} + ) endfunction() -function(target_stm32f303 name) - target_stm32f3xx(${name} startup_stm32f30x_md_gcc.S stm32_flash_f303_256k.ld SVD STM32F303 ${ARGN}) - target_compile_definitions(${name} PRIVATE ${STM32F303_DEFINITIONS}) - setup_firmware_target(${name}) +function(target_stm32f303xc name) + target_stm32f3xx( + NAME ${name} + STARTUP startup_stm32f30x_md_gcc.S + COMPILE_DEFINITIONS ${STM32F303CC_DEFINITIONS} + LINKER_SCRIPT stm32_flash_f303xc + SVD STM32F303 + ${ARGN} + ) endfunction() diff --git a/cmake/stm32f4-usb.cmake b/cmake/stm32f4-usb.cmake index 177d5322df..8c30f0e554 100644 --- a/cmake/stm32f4-usb.cmake +++ b/cmake/stm32f4-usb.cmake @@ -46,7 +46,11 @@ set(STM32F4_USBMSC_SRC usbd_msc_data.c usbd_msc_scsi.c ) +main_sources(STM32F4_MSC_SRC + msc/usbd_msc_desc.c +) list(TRANSFORM STM32F4_USBMSC_SRC PREPEND "${STM32_USBMSC_DIR}/src/") +list(APPEND STM32F4_USBMSC_SRC ${STM32F4_MSC_SRC}) list(APPEND STM32F4_USB_SRC ${STM32_USBOTG_SRC}) list(APPEND STM32F4_USB_SRC ${STM32_USBCORE_SRC}) diff --git a/cmake/stm32f4.cmake b/cmake/stm32f4.cmake index ba6ab602dd..8beb83e4de 100644 --- a/cmake/stm32f4.cmake +++ b/cmake/stm32f4.cmake @@ -75,26 +75,24 @@ set(STM32F4_DEFINITIONS USE_STDPERIPH_DRIVER ) -function(target_stm32f4xx name startup ldscript) - target_stm32(${name} ${startup} ${ldscript} OPENOCD_TARGET stm32f4x ${ARGN}) - if (IS_RELEASE_BUILD) - target_compile_options(${name} PRIVATE "-O2") - target_link_options(${name} PRIVATE "-O2") - endif() - target_sources(${name} PRIVATE ${STM32_STDPERIPH_SRC} ${STM32F4_SRC}) - target_compile_options(${name} PRIVATE ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_COMPILE_OPTIONS}) - target_include_directories(${name} PRIVATE ${STM32F4_INCLUDE_DIRS}) - target_compile_definitions(${name} PRIVATE ${STM32F4_DEFINITIONS}) - target_link_options(${name} PRIVATE ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_LINK_OPTIONS}) +function(target_stm32f4xx) + target_stm32( + SOURCES ${STM32_STDPERIPH_SRC} ${STM32F4_SRC} + COMPILE_DEFINITIONS ${STM32F4_DEFINITIONS} + COMPILE_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_COMPILE_OPTIONS} + INCLUDE_DIRECTORIES ${STM32F4_INCLUDE_DIRS} + LINK_OPTIONS ${CORTEX_M4F_COMMON_OPTIONS} ${CORTEX_M4F_LINK_OPTIONS} - get_property(features TARGET ${name} PROPERTY FEATURES) - if(VCP IN_LIST features) - target_include_directories(${name} PRIVATE ${STM32F4_USB_INCLUDE_DIRS}) - target_sources(${name} PRIVATE ${STM32F4_USB_SRC} ${STM32F4_VCP_SRC}) - endif() - if(MSC IN_LIST features) - target_sources(${name} PRIVATE ${STM32F4_USBMSC_SRC} ${STM32F4_MSC_SRC}) - endif() + MSC_SOURCES ${STM32F4_USBMSC_SRC} ${STM32F4_MSC_SRC} + VCP_SOURCES ${STM32F4_USB_SRC} ${STM32F4_VCP_SRC} + VCP_INCLUDE_DIRECTORIES ${STM32F4_USB_INCLUDE_DIRS} + + OPTIMIZATION -O2 + + OPENOCD_TARGET stm32f4x + + ${ARGN} + ) endfunction() set(STM32F405_COMPILE_DEFINITIONS @@ -103,11 +101,17 @@ set(STM32F405_COMPILE_DEFINITIONS FLASH_SIZE=1024 ) -function(target_stm32f405 name) - target_stm32f4xx(${name} startup_stm32f40xx.s stm32_flash_f405.ld SVD STM32F405 ${ARGN}) - target_sources(${name} PRIVATE ${STM32F4_STDPERIPH_SRC}) - target_compile_definitions(${name} PRIVATE ${STM32F405_COMPILE_DEFINITIONS}) - setup_firmware_target(${name}) +function(target_stm32f405xg name) + target_stm32f4xx( + NAME ${name} + STARTUP startup_stm32f40xx.s + SOURCES ${STM32F4_STDPERIPH_SRC} + COMPILE_DEFINITIONS ${STM32F405_COMPILE_DEFINITIONS} + LINKER_SCRIPT stm32_flash_f405xg + SVD STM32F405 + BOOTLOADER + ${ARGN} + ) endfunction() set(STM32F411_OR_F427_STDPERIPH_SRC ${STM32F4_STDPERIPH_SRC}) @@ -119,20 +123,30 @@ set(STM32F411_COMPILE_DEFINITIONS FLASH_SIZE=512 ) -function(target_stm32f411 name) - target_stm32f4xx(${name} startup_stm32f411xe.s stm32_flash_f411.ld SVD STM32F411 ${ARGN}) - target_sources(${name} PRIVATE ${STM32F411_OR_F427_STDPERIPH_SRC}) - target_compile_definitions(${name} PRIVATE ${STM32F411_COMPILE_DEFINITIONS}) - setup_firmware_target(${name}) +function(target_stm32f411xe name) + target_stm32f4xx( + NAME ${name} + STARTUP startup_stm32f411xe.s + SOURCES ${STM32F411_OR_F427_STDPERIPH_SRC} + COMPILE_DEFINITIONS ${STM32F411_COMPILE_DEFINITIONS} + LINKER_SCRIPT stm32_flash_f411xe + SVD STM32F411 + ${ARGN} + ) endfunction() set(STM32F427_COMPILE_DEFINITIONS STM32F427_437xx FLASH_SIZE=1024 ) -function(target_stm32f427 name) - target_stm32f4xx(${name} startup_stm32f427xx.s stm32_flash_f427.ld SVD STM32F427 ${ARGN}) - target_sources(${name} PRIVATE ${STM32F411_OR_F427_STDPERIPH_SRC}) - target_compile_definitions(${name} PRIVATE ${STM32F427_COMPILE_DEFINITIONS}) - setup_firmware_target(${name}) +function(target_stm32f427xg name) + target_stm32f4xx( + NAME ${name} + STARTUP startup_stm32f427xx.s + SOURCES ${STM32F411_OR_F427_STDPERIPH_SRC} + COMPILE_DEFINITIONS ${STM32F427_COMPILE_DEFINITIONS} + LINKER_SCRIPT stm32_flash_f427xg + SVD STM32F411 + ${ARGN} + ) endfunction() diff --git a/cmake/stm32f7.cmake b/cmake/stm32f7.cmake index a452eaff36..1ce5d8c459 100644 --- a/cmake/stm32f7.cmake +++ b/cmake/stm32f7.cmake @@ -82,42 +82,50 @@ set(STM32F7_DEFINITIONS USE_FULL_LL_DRIVER ) -function(target_stm32f7xx name startup ldscript) - target_stm32(${name} ${startup} ${ldscript} OPENOCD_TARGET stm32f7x ${ARGN}) - if (IS_RELEASE_BUILD) - target_compile_options(${name} PRIVATE "-O2") - target_link_options(${name} PRIVATE "-O2") - endif() - target_sources(${name} PRIVATE ${STM32F7_HAL_SRC} ${STM32F7_SRC}) - target_compile_options(${name} PRIVATE ${CORTEX_M7_COMMON_OPTIONS} ${CORTEX_M7_COMPILE_OPTIONS}) - target_include_directories(${name} PRIVATE ${STM32F7_INCLUDE_DIRS}) - target_compile_definitions(${name} PRIVATE ${STM32F7_DEFINITIONS}) - target_link_options(${name} PRIVATE ${CORTEX_M7_COMMON_OPTIONS} ${CORTEX_M7_LINK_OPTIONS}) +function(target_stm32f7xx) + target_stm32( + SOURCES ${STM32F7_HAL_SRC} ${STM32F7_SRC} + COMPILE_DEFINITIONS ${STM32F7_DEFINITIONS} + COMPILE_OPTIONS ${CORTEX_M7_COMMON_OPTIONS} ${CORTEX_M7_COMPILE_OPTIONS} + INCLUDE_DIRECTORIES ${STM32F7_INCLUDE_DIRS} + LINK_OPTIONS ${CORTEX_M7_COMMON_OPTIONS} ${CORTEX_M7_LINK_OPTIONS} - get_property(features TARGET ${name} PROPERTY FEATURES) - if(VCP IN_LIST features) - target_include_directories(${name} PRIVATE ${STM32F7_USB_INCLUDE_DIRS} ${STM32F7_VCP_DIR}) - target_sources(${name} PRIVATE ${STM32F7_USB_SRC} ${STM32F7_VCP_SRC}) - endif() - if(MSC IN_LIST features) - target_sources(${name} PRIVATE ${STM32F7_USBMSC_SRC} ${STM32F7_MSC_SRC}) - endif() + MSC_SOURCES ${STM32F7_USBMSC_SRC} ${STM32F7_MSC_SRC} + VCP_SOURCES ${STM32F7_USB_SRC} ${STM32F7_VCP_SRC} + VCP_INCLUDE_DIRECTORIES ${STM32F7_USB_INCLUDE_DIRS} ${STM32F7_VCP_DIR} + + OPTIMIZATION -O2 + + OPENOCD_TARGET stm32f7x + + BOOTLOADER + + ${ARGN} + ) endfunction() -macro(define_target_stm32f7 suffix flash_size) - function(target_stm32f7${suffix} name) - target_stm32f7xx(${name} startup_stm32f7${suffix}xx.s stm32_flash_f7${suffix}.ld ${ARGN}) +macro(define_target_stm32f7 subfamily size) + function(target_stm32f7${subfamily}x${size} name) + string(TOUPPER ${size} upper_size) + get_stm32_flash_size(flash_size ${size}) set(definitions STM32F7 - STM32F7${suffix}xx + STM32F7${subfamily}xx + STM32F7${subfamily}x${upper_size} FLASH_SIZE=${flash_size} ) - target_compile_definitions(${name} PRIVATE ${definitions}) - setup_firmware_target(${name}) + target_stm32f7xx( + NAME ${name} + STARTUP startup_stm32f7${subfamily}xx.s + COMPILE_DEFINITIONS ${definitions} + LINKER_SCRIPT stm32_flash_f7${subfamily}x${size} + ${ARGN} + ) endfunction() endmacro() -define_target_stm32f7("22" 512) -define_target_stm32f7("45" 2048) -define_target_stm32f7("46" 2048) -define_target_stm32f7("65" 2048) \ No newline at end of file +define_target_stm32f7(22 e) +define_target_stm32f7(45 g) +define_target_stm32f7(46 g) +define_target_stm32f7(65 g) +define_target_stm32f7(65 i) \ No newline at end of file diff --git a/cmake/svd.cmake b/cmake/svd.cmake index 06be82c394..d6efdc783b 100644 --- a/cmake/svd.cmake +++ b/cmake/svd.cmake @@ -1,5 +1,5 @@ -function(setup_svd target_name) - get_property(svd_name TARGET ${target_name} PROPERTY SVD) +function(setup_svd target_exe target_name) + get_property(svd_name TARGET ${target_exe} PROPERTY SVD) set(svd_target_name "svd_${target_name}") if (svd_name AND NOT svd_name STREQUAL "") add_custom_target(${svd_target_name} diff --git a/src/main/CMakeLists.txt b/src/main/CMakeLists.txt index d9c4123055..77dfc54c20 100644 --- a/src/main/CMakeLists.txt +++ b/src/main/CMakeLists.txt @@ -273,6 +273,10 @@ main_sources(COMMON_SRC fc/fc_msp.h fc/fc_msp_box.c fc/fc_msp_box.h + fc/firmware_update.c + fc/firmware_update.h + fc/firmware_update_common.c + fc/firmware_update_common.h fc/rc_smoothing.c fc/rc_smoothing.h fc/rc_adjustments.c diff --git a/src/main/startup/startup_stm32f427xx.s b/src/main/startup/startup_stm32f427xx.s old mode 100755 new mode 100644 diff --git a/src/main/target/AIKONF4/CMakeLists.txt b/src/main/target/AIKONF4/CMakeLists.txt index 483f54efbb..4f415fd1af 100644 --- a/src/main/target/AIKONF4/CMakeLists.txt +++ b/src/main/target/AIKONF4/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(AIKONF4) +target_stm32f405xg(AIKONF4) diff --git a/src/main/target/AIRBOTF4/CMakeLists.txt b/src/main/target/AIRBOTF4/CMakeLists.txt index b86030b6e8..5d69f7a6aa 100644 --- a/src/main/target/AIRBOTF4/CMakeLists.txt +++ b/src/main/target/AIRBOTF4/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(AIRBOTF4) +target_stm32f405xg(AIRBOTF4) diff --git a/src/main/target/AIRBOTF7/CMakeLists.txt b/src/main/target/AIRBOTF7/CMakeLists.txt index 17d2773f09..1915ffc91c 100644 --- a/src/main/target/AIRBOTF7/CMakeLists.txt +++ b/src/main/target/AIRBOTF7/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f722(AIRBOTF7) -target_stm32f722(OMNIBUSF7NANOV7) \ No newline at end of file +target_stm32f722xe(AIRBOTF7) +target_stm32f722xe(OMNIBUSF7NANOV7) diff --git a/src/main/target/AIRHEROF3/CMakeLists.txt b/src/main/target/AIRHEROF3/CMakeLists.txt index f18202b648..35634a62bd 100644 --- a/src/main/target/AIRHEROF3/CMakeLists.txt +++ b/src/main/target/AIRHEROF3/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f303(AIRHEROF3 HSE_MHZ 12) -target_stm32f303(AIRHEROF3_QUAD HSE_MHZ 12) \ No newline at end of file +target_stm32f303xc(AIRHEROF3 HSE_MHZ 12) +target_stm32f303xc(AIRHEROF3_QUAD HSE_MHZ 12) diff --git a/src/main/target/ALIENFLIGHTNGF7/CMakeLists.txt b/src/main/target/ALIENFLIGHTNGF7/CMakeLists.txt index 8ad2eb2cca..16288f4b84 100644 --- a/src/main/target/ALIENFLIGHTNGF7/CMakeLists.txt +++ b/src/main/target/ALIENFLIGHTNGF7/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(ALIENFLIGHTNGF7) \ No newline at end of file +target_stm32f722xe(ALIENFLIGHTNGF7) diff --git a/src/main/target/ANYFC/CMakeLists.txt b/src/main/target/ANYFC/CMakeLists.txt index 88ab8c97f7..4a04e0f69b 100644 --- a/src/main/target/ANYFC/CMakeLists.txt +++ b/src/main/target/ANYFC/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(ANYFC) \ No newline at end of file +target_stm32f405xg(ANYFC) diff --git a/src/main/target/ANYFCF7/CMakeLists.txt b/src/main/target/ANYFCF7/CMakeLists.txt index 28cd0006c8..8b9a150c9e 100644 --- a/src/main/target/ANYFCF7/CMakeLists.txt +++ b/src/main/target/ANYFCF7/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f745(ANYFCF7) -target_stm32f745(ANYFCF7_EXTERNAL_BARO) \ No newline at end of file +target_stm32f745xg(ANYFCF7) +target_stm32f745xg(ANYFCF7_EXTERNAL_BARO) diff --git a/src/main/target/ASGARD32F4/CMakeLists.txt b/src/main/target/ASGARD32F4/CMakeLists.txt index ec7bd4458e..4a2d3bbed2 100644 --- a/src/main/target/ASGARD32F4/CMakeLists.txt +++ b/src/main/target/ASGARD32F4/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(ASGARD32F4) +target_stm32f405xg(ASGARD32F4) diff --git a/src/main/target/ASGARD32F7/CMakeLists.txt b/src/main/target/ASGARD32F7/CMakeLists.txt index 1a21972809..711c638e7e 100644 --- a/src/main/target/ASGARD32F7/CMakeLists.txt +++ b/src/main/target/ASGARD32F7/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(ASGARD32F7) \ No newline at end of file +target_stm32f722xe(ASGARD32F7) \ No newline at end of file diff --git a/src/main/target/BEEROTORF4/CMakeLists.txt b/src/main/target/BEEROTORF4/CMakeLists.txt index a30103b89d..295e6369de 100644 --- a/src/main/target/BEEROTORF4/CMakeLists.txt +++ b/src/main/target/BEEROTORF4/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(BEEROTORF4) +target_stm32f405xg(BEEROTORF4) diff --git a/src/main/target/BETAFLIGHTF3/CMakeLists.txt b/src/main/target/BETAFLIGHTF3/CMakeLists.txt index 728fff1e74..e27e7e5e7a 100644 --- a/src/main/target/BETAFLIGHTF3/CMakeLists.txt +++ b/src/main/target/BETAFLIGHTF3/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(BETAFLIGHTF3 DEFINITIONS "SPRACINGF3") \ No newline at end of file +target_stm32f303xc(BETAFLIGHTF3 COMPILE_DEFINITIONS "SPRACINGF3") diff --git a/src/main/target/BETAFLIGHTF4/CMakeLists.txt b/src/main/target/BETAFLIGHTF4/CMakeLists.txt index 0160a3c7ef..a76bd04734 100644 --- a/src/main/target/BETAFLIGHTF4/CMakeLists.txt +++ b/src/main/target/BETAFLIGHTF4/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(BETAFLIGHTF4) +target_stm32f405xg(BETAFLIGHTF4) diff --git a/src/main/target/BLUEJAYF4/CMakeLists.txt b/src/main/target/BLUEJAYF4/CMakeLists.txt index ba93ee7b42..2c93878cff 100644 --- a/src/main/target/BLUEJAYF4/CMakeLists.txt +++ b/src/main/target/BLUEJAYF4/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(BLUEJAYF4) +target_stm32f405xg(BLUEJAYF4) diff --git a/src/main/target/CLRACINGF4AIR/CMakeLists.txt b/src/main/target/CLRACINGF4AIR/CMakeLists.txt index b2566244c3..3b4ceb65ad 100644 --- a/src/main/target/CLRACINGF4AIR/CMakeLists.txt +++ b/src/main/target/CLRACINGF4AIR/CMakeLists.txt @@ -1,3 +1,3 @@ -target_stm32f405(CLRACINGF4AIR) -target_stm32f405(CLRACINGF4AIRV2) -target_stm32f405(CLRACINGF4AIRV3) +target_stm32f405xg(CLRACINGF4AIR) +target_stm32f405xg(CLRACINGF4AIRV2) +target_stm32f405xg(CLRACINGF4AIRV3) diff --git a/src/main/target/COLIBRI/CMakeLists.txt b/src/main/target/COLIBRI/CMakeLists.txt index 355c8d3e02..e8568b8281 100644 --- a/src/main/target/COLIBRI/CMakeLists.txt +++ b/src/main/target/COLIBRI/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f405(COLIBRI HSE_MHZ 16) -target_stm32f405(QUANTON HSE_MHZ 16) +target_stm32f405xg(COLIBRI HSE_MHZ 16) +target_stm32f405xg(QUANTON HSE_MHZ 16) diff --git a/src/main/target/DALRCF405/CMakeLists.txt b/src/main/target/DALRCF405/CMakeLists.txt index 43f7c6c669..d3de7d6f88 100644 --- a/src/main/target/DALRCF405/CMakeLists.txt +++ b/src/main/target/DALRCF405/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(DALRCF405) +target_stm32f405xg(DALRCF405) diff --git a/src/main/target/DALRCF722DUAL/CMakeLists.txt b/src/main/target/DALRCF722DUAL/CMakeLists.txt index ea04ea8ea6..3e9fe9a4f0 100644 --- a/src/main/target/DALRCF722DUAL/CMakeLists.txt +++ b/src/main/target/DALRCF722DUAL/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(DALRCF722DUAL) \ No newline at end of file +target_stm32f722xe(DALRCF722DUAL) diff --git a/src/main/target/F4BY/CMakeLists.txt b/src/main/target/F4BY/CMakeLists.txt index 532ae1bfd4..09b695702b 100644 --- a/src/main/target/F4BY/CMakeLists.txt +++ b/src/main/target/F4BY/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(F4BY) +target_stm32f405xg(F4BY) diff --git a/src/main/target/FALCORE/CMakeLists.txt b/src/main/target/FALCORE/CMakeLists.txt index f792193dd6..fb2436238e 100644 --- a/src/main/target/FALCORE/CMakeLists.txt +++ b/src/main/target/FALCORE/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(FALCORE HSE_MHZ 12) \ No newline at end of file +target_stm32f303xc(FALCORE HSE_MHZ 12) diff --git a/src/main/target/FF_F35_LIGHTNING/CMakeLists.txt b/src/main/target/FF_F35_LIGHTNING/CMakeLists.txt index d575693d71..15380146f5 100644 --- a/src/main/target/FF_F35_LIGHTNING/CMakeLists.txt +++ b/src/main/target/FF_F35_LIGHTNING/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f405(FF_F35_LIGHTNING) -target_stm32f405(WINGFC) +target_stm32f405xg(FF_F35_LIGHTNING) +target_stm32f405xg(WINGFC) diff --git a/src/main/target/FF_FORTINIF4/CMakeLists.txt b/src/main/target/FF_FORTINIF4/CMakeLists.txt index 51eb0287a8..a78703f69c 100644 --- a/src/main/target/FF_FORTINIF4/CMakeLists.txt +++ b/src/main/target/FF_FORTINIF4/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(FF_FORTINIF4) +target_stm32f405xg(FF_FORTINIF4) diff --git a/src/main/target/FF_PIKOF4/CMakeLists.txt b/src/main/target/FF_PIKOF4/CMakeLists.txt index d439ef8feb..9a1c349de1 100644 --- a/src/main/target/FF_PIKOF4/CMakeLists.txt +++ b/src/main/target/FF_PIKOF4/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f405(FF_PIKOF4) -target_stm32f405(FF_PIKOF4OSD) +target_stm32f405xg(FF_PIKOF4) +target_stm32f405xg(FF_PIKOF4OSD) diff --git a/src/main/target/FIREWORKSV2/CMakeLists.txt b/src/main/target/FIREWORKSV2/CMakeLists.txt index 8ed374297f..c057816a90 100644 --- a/src/main/target/FIREWORKSV2/CMakeLists.txt +++ b/src/main/target/FIREWORKSV2/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f405(FIREWORKSV2) -target_stm32f405(OMNIBUSF4V6) +target_stm32f405xg(FIREWORKSV2) +target_stm32f405xg(OMNIBUSF4V6) diff --git a/src/main/target/FISHDRONEF4/CMakeLists.txt b/src/main/target/FISHDRONEF4/CMakeLists.txt index 468386fc68..1f431194d7 100644 --- a/src/main/target/FISHDRONEF4/CMakeLists.txt +++ b/src/main/target/FISHDRONEF4/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(FISHDRONEF4) +target_stm32f405xg(FISHDRONEF4) diff --git a/src/main/target/FLYWOOF411/CMakeLists.txt b/src/main/target/FLYWOOF411/CMakeLists.txt index ef56491f3b..ca3e384913 100644 --- a/src/main/target/FLYWOOF411/CMakeLists.txt +++ b/src/main/target/FLYWOOF411/CMakeLists.txt @@ -1 +1 @@ -target_stm32f411(FLYWOOF411) +target_stm32f411xe(FLYWOOF411) diff --git a/src/main/target/FLYWOOF7DUAL/CMakeLists.txt b/src/main/target/FLYWOOF7DUAL/CMakeLists.txt index 00373c55d3..7db7e35247 100644 --- a/src/main/target/FLYWOOF7DUAL/CMakeLists.txt +++ b/src/main/target/FLYWOOF7DUAL/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(FLYWOOF7DUAL) \ No newline at end of file +target_stm32f722xe(FLYWOOF7DUAL) diff --git a/src/main/target/FOXEERF405/CMakeLists.txt b/src/main/target/FOXEERF405/CMakeLists.txt index e9136cf0f4..f6337a96ee 100644 --- a/src/main/target/FOXEERF405/CMakeLists.txt +++ b/src/main/target/FOXEERF405/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(FOXEERF405) +target_stm32f405xg(FOXEERF405) diff --git a/src/main/target/FOXEERF722DUAL/CMakeLists.txt b/src/main/target/FOXEERF722DUAL/CMakeLists.txt index 560189ff1b..9af4d4ef09 100644 --- a/src/main/target/FOXEERF722DUAL/CMakeLists.txt +++ b/src/main/target/FOXEERF722DUAL/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f722(FOXEERF722DUAL) -target_stm32f722(FOXEERF722V2) \ No newline at end of file +target_stm32f722xe(FOXEERF722DUAL) +target_stm32f722xe(FOXEERF722V2) diff --git a/src/main/target/FRSKYF3/CMakeLists.txt b/src/main/target/FRSKYF3/CMakeLists.txt index ebd8e1a8b3..0ce4048685 100644 --- a/src/main/target/FRSKYF3/CMakeLists.txt +++ b/src/main/target/FRSKYF3/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(FRSKYF3) \ No newline at end of file +target_stm32f303xc(FRSKYF3) diff --git a/src/main/target/FRSKYF4/CMakeLists.txt b/src/main/target/FRSKYF4/CMakeLists.txt index cb13fbed3c..ef64ff2ded 100644 --- a/src/main/target/FRSKYF4/CMakeLists.txt +++ b/src/main/target/FRSKYF4/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(FRSKYF4) +target_stm32f405xg(FRSKYF4) diff --git a/src/main/target/FURYF3/CMakeLists.txt b/src/main/target/FURYF3/CMakeLists.txt index ed0e423893..d4d60d306c 100644 --- a/src/main/target/FURYF3/CMakeLists.txt +++ b/src/main/target/FURYF3/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f303(FURYF3) -target_stm32f303(FURYF3_SPIFLASH) \ No newline at end of file +target_stm32f303xc(FURYF3) +target_stm32f303xc(FURYF3_SPIFLASH) diff --git a/src/main/target/FURYF4OSD/CMakeLists.txt b/src/main/target/FURYF4OSD/CMakeLists.txt index 620d9f3a7b..34025a1f90 100644 --- a/src/main/target/FURYF4OSD/CMakeLists.txt +++ b/src/main/target/FURYF4OSD/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f405(FURYF4OSD) -target_stm32f405(MAMBAF405) +target_stm32f405xg(FURYF4OSD) +target_stm32f405xg(MAMBAF405) diff --git a/src/main/target/HGLRCF722/CMakeLists.txt b/src/main/target/HGLRCF722/CMakeLists.txt index 3015c57d0a..7ea0539d65 100644 --- a/src/main/target/HGLRCF722/CMakeLists.txt +++ b/src/main/target/HGLRCF722/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(HGLRCF722) \ No newline at end of file +target_stm32f722xe(HGLRCF722) diff --git a/src/main/target/IFLIGHTF4_SUCCEXD/CMakeLists.txt b/src/main/target/IFLIGHTF4_SUCCEXD/CMakeLists.txt index 7c0d18cb3f..1c0c46b895 100644 --- a/src/main/target/IFLIGHTF4_SUCCEXD/CMakeLists.txt +++ b/src/main/target/IFLIGHTF4_SUCCEXD/CMakeLists.txt @@ -1 +1 @@ -target_stm32f411(IFLIGHTF4_SUCCEXD) \ No newline at end of file +target_stm32f411xe(IFLIGHTF4_SUCCEXD) diff --git a/src/main/target/IFLIGHTF4_TWING/CMakeLists.txt b/src/main/target/IFLIGHTF4_TWING/CMakeLists.txt index 048646799d..a7640915f3 100644 --- a/src/main/target/IFLIGHTF4_TWING/CMakeLists.txt +++ b/src/main/target/IFLIGHTF4_TWING/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(IFLIGHTF4_TWING) +target_stm32f405xg(IFLIGHTF4_TWING) diff --git a/src/main/target/IFLIGHTF7_TWING/CMakeLists.txt b/src/main/target/IFLIGHTF7_TWING/CMakeLists.txt index 8ce43face7..cf8ca2b933 100644 --- a/src/main/target/IFLIGHTF7_TWING/CMakeLists.txt +++ b/src/main/target/IFLIGHTF7_TWING/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(IFLIGHTF7_TWING) \ No newline at end of file +target_stm32f722xe(IFLIGHTF7_TWING) diff --git a/src/main/target/KAKUTEF4/CMakeLists.txt b/src/main/target/KAKUTEF4/CMakeLists.txt index 8441910872..074eb6cd35 100644 --- a/src/main/target/KAKUTEF4/CMakeLists.txt +++ b/src/main/target/KAKUTEF4/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f405(KAKUTEF4) -target_stm32f405(KAKUTEF4V2) +target_stm32f405xg(KAKUTEF4) +target_stm32f405xg(KAKUTEF4V2) diff --git a/src/main/target/KAKUTEF7/CMakeLists.txt b/src/main/target/KAKUTEF7/CMakeLists.txt index 78856cbd15..8f4702fcf4 100644 --- a/src/main/target/KAKUTEF7/CMakeLists.txt +++ b/src/main/target/KAKUTEF7/CMakeLists.txt @@ -1,3 +1,3 @@ -target_stm32f745(KAKUTEF7) -target_stm32f745(KAKUTEF7HDV) -target_stm32f745(KAKUTEF7MINI) \ No newline at end of file +target_stm32f745xg(KAKUTEF7) +target_stm32f745xg(KAKUTEF7HDV) +target_stm32f745xg(KAKUTEF7MINI) diff --git a/src/main/target/KFC32F3_INAV/CMakeLists.txt b/src/main/target/KFC32F3_INAV/CMakeLists.txt index 5f1543c39f..c8bf5690a0 100644 --- a/src/main/target/KFC32F3_INAV/CMakeLists.txt +++ b/src/main/target/KFC32F3_INAV/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(KFC32F3_INAV) \ No newline at end of file +target_stm32f303xc(KFC32F3_INAV) diff --git a/src/main/target/LUX_RACE/CMakeLists.txt b/src/main/target/LUX_RACE/CMakeLists.txt index 797a42bbec..d052694896 100644 --- a/src/main/target/LUX_RACE/CMakeLists.txt +++ b/src/main/target/LUX_RACE/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(LUX_RACE) \ No newline at end of file +target_stm32f303xc(LUX_RACE) diff --git a/src/main/target/MAMBAF405US/CMakeLists.txt b/src/main/target/MAMBAF405US/CMakeLists.txt index 270627d913..d4565822bf 100644 --- a/src/main/target/MAMBAF405US/CMakeLists.txt +++ b/src/main/target/MAMBAF405US/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(MAMBAF405US) +target_stm32f405xg(MAMBAF405US) diff --git a/src/main/target/MAMBAF722/CMakeLists.txt b/src/main/target/MAMBAF722/CMakeLists.txt index 5494780c06..e893c24684 100644 --- a/src/main/target/MAMBAF722/CMakeLists.txt +++ b/src/main/target/MAMBAF722/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(MAMBAF722) \ No newline at end of file +target_stm32f722xe(MAMBAF722) diff --git a/src/main/target/MATEKF405/CMakeLists.txt b/src/main/target/MATEKF405/CMakeLists.txt index 8ffba845e5..c4f839c1c1 100644 --- a/src/main/target/MATEKF405/CMakeLists.txt +++ b/src/main/target/MATEKF405/CMakeLists.txt @@ -1,3 +1,3 @@ -target_stm32f405(MATEKF405) -target_stm32f405(MATEKF405_SERVOS6) -target_stm32f405(MATEKF405OSD) +target_stm32f405xg(MATEKF405) +target_stm32f405xg(MATEKF405_SERVOS6) +target_stm32f405xg(MATEKF405OSD) diff --git a/src/main/target/MATEKF405SE/CMakeLists.txt b/src/main/target/MATEKF405SE/CMakeLists.txt index 4fedcde60a..2c754ecea8 100644 --- a/src/main/target/MATEKF405SE/CMakeLists.txt +++ b/src/main/target/MATEKF405SE/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(MATEKF405SE) +target_stm32f405xg(MATEKF405SE) diff --git a/src/main/target/MATEKF411/CMakeLists.txt b/src/main/target/MATEKF411/CMakeLists.txt index 426c86cb5d..5907460815 100644 --- a/src/main/target/MATEKF411/CMakeLists.txt +++ b/src/main/target/MATEKF411/CMakeLists.txt @@ -1,4 +1,4 @@ -target_stm32f411(MATEKF411) -target_stm32f411(MATEKF411_FD_SFTSRL) -target_stm32f411(MATEKF411_RSSI) -target_stm32f411(MATEKF411_SFTSRL2) +target_stm32f411xe(MATEKF411) +target_stm32f411xe(MATEKF411_FD_SFTSRL) +target_stm32f411xe(MATEKF411_RSSI) +target_stm32f411xe(MATEKF411_SFTSRL2) diff --git a/src/main/target/MATEKF411SE/CMakeLists.txt b/src/main/target/MATEKF411SE/CMakeLists.txt index 0031ec68c2..df67c6f00b 100644 --- a/src/main/target/MATEKF411SE/CMakeLists.txt +++ b/src/main/target/MATEKF411SE/CMakeLists.txt @@ -1 +1 @@ -target_stm32f411(MATEKF411SE) +target_stm32f411xe(MATEKF411SE) diff --git a/src/main/target/MATEKF722/CMakeLists.txt b/src/main/target/MATEKF722/CMakeLists.txt index cbafe79506..eb384e1281 100644 --- a/src/main/target/MATEKF722/CMakeLists.txt +++ b/src/main/target/MATEKF722/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f722(MATEKF722) -target_stm32f722(MATEKF722_HEXSERVO) \ No newline at end of file +target_stm32f722xe(MATEKF722) +target_stm32f722xe(MATEKF722_HEXSERVO) diff --git a/src/main/target/MATEKF722PX/CMakeLists.txt b/src/main/target/MATEKF722PX/CMakeLists.txt index 9e53706f3f..0248902846 100644 --- a/src/main/target/MATEKF722PX/CMakeLists.txt +++ b/src/main/target/MATEKF722PX/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(MATEKF722PX) \ No newline at end of file +target_stm32f722xe(MATEKF722PX) diff --git a/src/main/target/MATEKF722SE/CMakeLists.txt b/src/main/target/MATEKF722SE/CMakeLists.txt index 66c55b0fbf..a541da229f 100644 --- a/src/main/target/MATEKF722SE/CMakeLists.txt +++ b/src/main/target/MATEKF722SE/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f722(MATEKF722SE) -target_stm32f722(MATEKF722MINI) \ No newline at end of file +target_stm32f722xe(MATEKF722SE) +target_stm32f722xe(MATEKF722MINI) diff --git a/src/main/target/MATEKF765/CMakeLists.txt b/src/main/target/MATEKF765/CMakeLists.txt index ab9f4e7e77..2461647ec0 100644 --- a/src/main/target/MATEKF765/CMakeLists.txt +++ b/src/main/target/MATEKF765/CMakeLists.txt @@ -1 +1 @@ -target_stm32f765(MATEKF765) \ No newline at end of file +target_stm32f765xi(MATEKF765) diff --git a/src/main/target/MOTOLAB/CMakeLists.txt b/src/main/target/MOTOLAB/CMakeLists.txt index d3372f5056..44a615e98d 100644 --- a/src/main/target/MOTOLAB/CMakeLists.txt +++ b/src/main/target/MOTOLAB/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(MOTOLAB) \ No newline at end of file +target_stm32f303xc(MOTOLAB) diff --git a/src/main/target/NOX/CMakeLists.txt b/src/main/target/NOX/CMakeLists.txt index 588b589c87..b8189c76ec 100644 --- a/src/main/target/NOX/CMakeLists.txt +++ b/src/main/target/NOX/CMakeLists.txt @@ -1 +1 @@ -target_stm32f411(NOX) +target_stm32f411xe(NOX) diff --git a/src/main/target/OMNIBUS/CMakeLists.txt b/src/main/target/OMNIBUS/CMakeLists.txt index a87b528667..9b0d502da5 100644 --- a/src/main/target/OMNIBUS/CMakeLists.txt +++ b/src/main/target/OMNIBUS/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(OMNIBUS) \ No newline at end of file +target_stm32f303xc(OMNIBUS) diff --git a/src/main/target/OMNIBUSF4/CMakeLists.txt b/src/main/target/OMNIBUSF4/CMakeLists.txt index b6c2077d0f..72f3bbeca8 100644 --- a/src/main/target/OMNIBUSF4/CMakeLists.txt +++ b/src/main/target/OMNIBUSF4/CMakeLists.txt @@ -1,12 +1,12 @@ -target_stm32f405(DYSF4PRO) -target_stm32f405(DYSF4PROV2) -target_stm32f405(OMNIBUSF4) +target_stm32f405xg(DYSF4PRO) +target_stm32f405xg(DYSF4PROV2) +target_stm32f405xg(OMNIBUSF4) # the OMNIBUSF4SD has an SDCARD instead of flash, a BMP280 baro and therefore a slightly different ppm/pwm and SPI mapping -target_stm32f405(OMNIBUSF4PRO) -target_stm32f405(OMNIBUSF4PRO_LEDSTRIPM5) -target_stm32f405(OMNIBUSF4V3_S5_S6_2SS) -target_stm32f405(OMNIBUSF4V3_S5S6_SS) -target_stm32f405(OMNIBUSF4V3_S6_SS) +target_stm32f405xg(OMNIBUSF4PRO) +target_stm32f405xg(OMNIBUSF4PRO_LEDSTRIPM5) +target_stm32f405xg(OMNIBUSF4V3_S5_S6_2SS) +target_stm32f405xg(OMNIBUSF4V3_S5S6_SS) +target_stm32f405xg(OMNIBUSF4V3_S6_SS) # OMNIBUSF4V3 is a (almost identical) variant of OMNIBUSF4PRO target, # except for an inverter on UART6. -target_stm32f405(OMNIBUSF4V3) +target_stm32f405xg(OMNIBUSF4V3) diff --git a/src/main/target/OMNIBUSF7/CMakeLists.txt b/src/main/target/OMNIBUSF7/CMakeLists.txt index 5f2f42d4c6..456c8632f6 100644 --- a/src/main/target/OMNIBUSF7/CMakeLists.txt +++ b/src/main/target/OMNIBUSF7/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f745(OMNIBUSF7) -target_stm32f745(OMNIBUSF7V2) \ No newline at end of file +target_stm32f745xg(OMNIBUSF7) +target_stm32f745xg(OMNIBUSF7V2) diff --git a/src/main/target/OMNIBUSF7NXT/CMakeLists.txt b/src/main/target/OMNIBUSF7NXT/CMakeLists.txt index d75488409b..db1bd01c22 100644 --- a/src/main/target/OMNIBUSF7NXT/CMakeLists.txt +++ b/src/main/target/OMNIBUSF7NXT/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(OMNIBUSF7NXT) \ No newline at end of file +target_stm32f722xe(OMNIBUSF7NXT) diff --git a/src/main/target/PIKOBLX/CMakeLists.txt b/src/main/target/PIKOBLX/CMakeLists.txt index 8ed14ef875..b9357a9f98 100644 --- a/src/main/target/PIKOBLX/CMakeLists.txt +++ b/src/main/target/PIKOBLX/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(PIKOBLX) \ No newline at end of file +target_stm32f303xc(PIKOBLX) diff --git a/src/main/target/PIXRACER/CMakeLists.txt b/src/main/target/PIXRACER/CMakeLists.txt index d55ca6feff..c2c06c5a67 100644 --- a/src/main/target/PIXRACER/CMakeLists.txt +++ b/src/main/target/PIXRACER/CMakeLists.txt @@ -1 +1 @@ -target_stm32f427(PIXRACER HSE_MHZ 24) +target_stm32f427xg(PIXRACER HSE_MHZ 24) diff --git a/src/main/target/RCEXPLORERF3/CMakeLists.txt b/src/main/target/RCEXPLORERF3/CMakeLists.txt index 2a069102f9..cdb3b34ed0 100644 --- a/src/main/target/RCEXPLORERF3/CMakeLists.txt +++ b/src/main/target/RCEXPLORERF3/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(RCEXPLORERF3) \ No newline at end of file +target_stm32f303xc(RCEXPLORERF3) diff --git a/src/main/target/REVO/CMakeLists.txt b/src/main/target/REVO/CMakeLists.txt index 4b7a04fb53..e972aaf43e 100644 --- a/src/main/target/REVO/CMakeLists.txt +++ b/src/main/target/REVO/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(REVO) +target_stm32f405xg(REVO) diff --git a/src/main/target/RMDO/CMakeLists.txt b/src/main/target/RMDO/CMakeLists.txt index f3a2c36eeb..541927fed0 100644 --- a/src/main/target/RMDO/CMakeLists.txt +++ b/src/main/target/RMDO/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(RMDO DEFINITIONS "SPRACINGF3") \ No newline at end of file +target_stm32f303xc(RMDO COMPILE_DEFINITIONS "SPRACINGF3") diff --git a/src/main/target/SPARKY/CMakeLists.txt b/src/main/target/SPARKY/CMakeLists.txt index 1a6f1f0e23..10bb24b0ab 100644 --- a/src/main/target/SPARKY/CMakeLists.txt +++ b/src/main/target/SPARKY/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(SPARKY) \ No newline at end of file +target_stm32f303xc(SPARKY) diff --git a/src/main/target/SPARKY2/CMakeLists.txt b/src/main/target/SPARKY2/CMakeLists.txt index ea3e9b15d8..12985b381a 100644 --- a/src/main/target/SPARKY2/CMakeLists.txt +++ b/src/main/target/SPARKY2/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(SPARKY2) +target_stm32f405xg(SPARKY2) diff --git a/src/main/target/SPEEDYBEEF4/CMakeLists.txt b/src/main/target/SPEEDYBEEF4/CMakeLists.txt index ed18e3403c..1735fcb6c2 100644 --- a/src/main/target/SPEEDYBEEF4/CMakeLists.txt +++ b/src/main/target/SPEEDYBEEF4/CMakeLists.txt @@ -1,3 +1,3 @@ -target_stm32f405(SPEEDYBEEF4) -target_stm32f405(SPEEDYBEEF4_SFTSRL1) -target_stm32f405(SPEEDYBEEF4_SFTSRL2) +target_stm32f405xg(SPEEDYBEEF4) +target_stm32f405xg(SPEEDYBEEF4_SFTSRL1) +target_stm32f405xg(SPEEDYBEEF4_SFTSRL2) diff --git a/src/main/target/SPRACINGF3/CMakeLists.txt b/src/main/target/SPRACINGF3/CMakeLists.txt index dae18ee21f..2840cbef85 100644 --- a/src/main/target/SPRACINGF3/CMakeLists.txt +++ b/src/main/target/SPRACINGF3/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(SPRACINGF3) \ No newline at end of file +target_stm32f303xc(SPRACINGF3) diff --git a/src/main/target/SPRACINGF3EVO/CMakeLists.txt b/src/main/target/SPRACINGF3EVO/CMakeLists.txt index c2dbd822b0..3833d8d59e 100644 --- a/src/main/target/SPRACINGF3EVO/CMakeLists.txt +++ b/src/main/target/SPRACINGF3EVO/CMakeLists.txt @@ -1,2 +1,2 @@ -target_stm32f303(SPRACINGF3EVO) -target_stm32f303(SPRACINGF3EVO_1SS) \ No newline at end of file +target_stm32f303xc(SPRACINGF3EVO) +target_stm32f303xc(SPRACINGF3EVO_1SS) diff --git a/src/main/target/SPRACINGF3MINI/CMakeLists.txt b/src/main/target/SPRACINGF3MINI/CMakeLists.txt index d9518a0920..e3b633a6d4 100644 --- a/src/main/target/SPRACINGF3MINI/CMakeLists.txt +++ b/src/main/target/SPRACINGF3MINI/CMakeLists.txt @@ -1 +1 @@ -target_stm32f303(SPRACINGF3MINI) \ No newline at end of file +target_stm32f303xc(SPRACINGF3MINI) diff --git a/src/main/target/SPRACINGF4EVO/CMakeLists.txt b/src/main/target/SPRACINGF4EVO/CMakeLists.txt index 0b9e390d71..41dbc70ab0 100644 --- a/src/main/target/SPRACINGF4EVO/CMakeLists.txt +++ b/src/main/target/SPRACINGF4EVO/CMakeLists.txt @@ -1 +1 @@ -target_stm32f405(SPRACINGF4EVO) +target_stm32f405xg(SPRACINGF4EVO) diff --git a/src/main/target/SPRACINGF7DUAL/CMakeLists.txt b/src/main/target/SPRACINGF7DUAL/CMakeLists.txt index 9f470b18e7..1fc19b7e12 100644 --- a/src/main/target/SPRACINGF7DUAL/CMakeLists.txt +++ b/src/main/target/SPRACINGF7DUAL/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(SPRACINGF7DUAL) \ No newline at end of file +target_stm32f722xe(SPRACINGF7DUAL) diff --git a/src/main/target/YUPIF7/CMakeLists.txt b/src/main/target/YUPIF7/CMakeLists.txt index e1073f8d00..289873afc0 100644 --- a/src/main/target/YUPIF7/CMakeLists.txt +++ b/src/main/target/YUPIF7/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(YUPIF7) \ No newline at end of file +target_stm32f722xe(YUPIF7) \ No newline at end of file diff --git a/src/main/target/ZEEZF7/CMakeLists.txt b/src/main/target/ZEEZF7/CMakeLists.txt index 8c1536bee4..513e023060 100644 --- a/src/main/target/ZEEZF7/CMakeLists.txt +++ b/src/main/target/ZEEZF7/CMakeLists.txt @@ -1 +1 @@ -target_stm32f722(ZEEZF7) \ No newline at end of file +target_stm32f722xe(ZEEZF7) diff --git a/src/main/target/link/stm32_flash_F427.ld b/src/main/target/link/stm32_flash_F427.ld old mode 100755 new mode 100644 diff --git a/src/main/target/link/stm32_flash_F7_split.ld b/src/main/target/link/stm32_flash_F7_split.ld index 42d8f0205c..f3dde2e7f7 100644 --- a/src/main/target/link/stm32_flash_F7_split.ld +++ b/src/main/target/link/stm32_flash_F7_split.ld @@ -1,9 +1,9 @@ /* ***************************************************************************** ** -** File : stm32_flash_split.ld +** File : stm32_flash_f7_split.ld ** -** Abstract : Common linker script for STM32 devices. +** Abstract : Common linker script for STM32F7 devices. ** ***************************************************************************** */ diff --git a/src/main/target/link/stm32_flash_f303xc.ld b/src/main/target/link/stm32_flash_f303xc.ld new file mode 100644 index 0000000000..1917843495 --- /dev/null +++ b/src/main/target/link/stm32_flash_f303xc.ld @@ -0,0 +1,30 @@ +/* +***************************************************************************** +** +** File : stm32_flash.ld +** +** Abstract : Linker script for STM32F30x Device with +** 256KByte FLASH and 40KByte RAM +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Specify the memory areas. */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 250K + FLASH_CONFIG (r) : ORIGIN = 0x0803E800, LENGTH = 6K + + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 40K + CCM (xrw) : ORIGIN = 0x10000000, LENGTH = 8K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +REGION_ALIAS("STACKRAM", CCM) +REGION_ALIAS("FASTRAM", CCM) + +INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_f405xg.ld b/src/main/target/link/stm32_flash_f405xg.ld new file mode 100644 index 0000000000..66721aee5f --- /dev/null +++ b/src/main/target/link/stm32_flash_f405xg.ld @@ -0,0 +1,40 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f405.ld +** +** Abstract : Linker script for STM32F405RG Device with +** 1024KByte FLASH, 128KByte RAM 64KByte CCM (RAM) +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x08000000 to 0x08100000 1024K full flash, +0x08000000 to 0x080DFFFF 896K firmware, +0x080E0000 to 0x08100000 128K config, // FLASH_Sector_11 +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 896K + FLASH_CONFIG (r) : ORIGIN = 0x080E0000, LENGTH = 128K + + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K + CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K + BACKUP_SRAM (rwx) : ORIGIN = 0x40024000, LENGTH = 4K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +REGION_ALIAS("STACKRAM", CCM) +REGION_ALIAS("FASTRAM", CCM) + +INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_f405xg_bl.ld b/src/main/target/link/stm32_flash_f405xg_bl.ld new file mode 100644 index 0000000000..6ae82e6f8a --- /dev/null +++ b/src/main/target/link/stm32_flash_f405xg_bl.ld @@ -0,0 +1,43 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f405.ld +** +** Abstract : Linker script for STM32F405RG Device with +** 1024KByte FLASH, 128KByte RAM 64KByte CCM (RAM) +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x08000000 to 0x08100000 1024K full flash, +0x08000000 to 0x080DFFFF 896K firmware, +0x080E0000 to 0x08100000 128K config, // FLASH_Sector_11 +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K + FIRMWARE (rx) : ORIGIN = 0x08008000, LENGTH = 864K + FLASH_CONFIG (r) : ORIGIN = 0x080E0000, LENGTH = 128K + + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K + CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K + BACKUP_SRAM (rwx) : ORIGIN = 0x40024000, LENGTH = 4K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +REGION_ALIAS("STACKRAM", CCM) +REGION_ALIAS("FASTRAM", CCM) + +__firmware_start = ORIGIN(FIRMWARE); + +INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_f405xg_for_bl.ld b/src/main/target/link/stm32_flash_f405xg_for_bl.ld new file mode 100644 index 0000000000..c2a60a1429 --- /dev/null +++ b/src/main/target/link/stm32_flash_f405xg_for_bl.ld @@ -0,0 +1,42 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f405.ld +** +** Abstract : Linker script for STM32F405RG Device with +** 1024KByte FLASH, 128KByte RAM 64KByte CCM (RAM) +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x08000000 to 0x08100000 1024K full flash, +0x08000000 to 0x080DFFFF 896K firmware, +0x080E0000 to 0x08100000 128K config, // FLASH_Sector_11 +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 864K + FLASH_CONFIG (r) : ORIGIN = 0x080E0000, LENGTH = 128K + + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K + CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K + BACKUP_SRAM (rwx) : ORIGIN = 0x40024000, LENGTH = 4K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +REGION_ALIAS("STACKRAM", CCM) +REGION_ALIAS("FASTRAM", CCM) + +__firmware_start = ORIGIN(FLASH); + +INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_f411xe.ld b/src/main/target/link/stm32_flash_f411xe.ld new file mode 100644 index 0000000000..0326840b34 --- /dev/null +++ b/src/main/target/link/stm32_flash_f411xe.ld @@ -0,0 +1,40 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f411.ld +** +** Abstract : Linker script for STM32F11 Device with +** 512KByte FLASH, 128KByte RAM +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x08000000 to 0x0807FFFF 512K full flash, +0x08000000 to 0x08003FFF 16K isr vector, startup code, +0x08004000 to 0x08007FFF 16K config, // FLASH_Sector_1 +0x08008000 to 0x0807FFFF 480K firmware, +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K + FLASH_CONFIG (r) : ORIGIN = 0x08004000, LENGTH = 16K + FLASH1 (rx) : ORIGIN = 0x08008000, LENGTH = 480K + + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +REGION_ALIAS("STACKRAM", RAM) +REGION_ALIAS("FASTRAM", RAM) + +INCLUDE "stm32_flash_split.ld" diff --git a/src/main/target/link/stm32_flash_f427xg.ld b/src/main/target/link/stm32_flash_f427xg.ld new file mode 100644 index 0000000000..8c080f38e7 --- /dev/null +++ b/src/main/target/link/stm32_flash_f427xg.ld @@ -0,0 +1,59 @@ +/* +***************************************************************************** +** +** File : stm32_flash.ld +** +** Abstract : Linker script for STM32F427 Device with +** 2048 KByte FLASH, 192KByte RAM +** +** Set heap size, stack size and stack location according +** to application requirements. +** +** Set memory bank area and size if external memory is used. +** +** Target : STMicroelectronics STM32 +** +** Environment : Atollic TrueSTUDIO(R) +** +** Distribution: The file is distributed as is, without any warranty +** of any kind. +** +** (c)Copyright Atollic AB. +** You may use this file as-is or modify it according to the needs of your +** project. Distribution of this file (unmodified or modified) is not +** permitted. Atollic AB permit registered Atollic TrueSTUDIO(R) users the +** rights to distribute the assembled, compiled & linked contents of this +** file as part of an application binary file, provided that it is built +** using the Atollic TrueSTUDIO(R) toolchain. +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x08000000 to 0x08100000 1024K full flash, +0x08000000 to 0x080DFFFF 896K firmware, +0x080E0000 to 0x08100000 128K config, // FLASH_Sector_11 +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 896K + FLASH_CONFIG (r) : ORIGIN = 0x080E0000, LENGTH = 128K + + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K + CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +REGION_ALIAS("STACKRAM", CCM) +REGION_ALIAS("FASTRAM", CCM) + +INCLUDE "stm32_flash.ld" diff --git a/src/main/target/link/stm32_flash_f446xe.ld b/src/main/target/link/stm32_flash_f446xe.ld new file mode 100644 index 0000000000..1128fa3506 --- /dev/null +++ b/src/main/target/link/stm32_flash_f446xe.ld @@ -0,0 +1,40 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f411.ld +** +** Abstract : Linker script for STM32F11 Device with +** 512KByte FLASH, 128KByte RAM +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x08000000 to 0x0807FFFF 512K full flash, +0x08000000 to 0x08003FFF 16K isr vector, startup code, +0x08004000 to 0x08007FFF 16K config, // FLASH_Sector_1 +0x08008000 to 0x0807FFFF 480K firmware, +*/ + +/* Specify the memory areas */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K + FLASH_CONFIG (r) : ORIGIN = 0x08004000, LENGTH = 16K + FLASH1 (rx) : ORIGIN = 0x08008000, LENGTH = 480K + + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +REGION_ALIAS("STACKRAM", RAM) +REGION_ALIAS("FASTRAM", RAM) + +INCLUDE "stm32_flash_split.ld" \ No newline at end of file diff --git a/src/main/target/link/stm32_flash_f722xe.ld b/src/main/target/link/stm32_flash_f722xe.ld new file mode 100644 index 0000000000..3a9094ed81 --- /dev/null +++ b/src/main/target/link/stm32_flash_f722xe.ld @@ -0,0 +1,48 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f722xe.ld +** +** Abstract : Linker script for STM32F722RETx Device with +** 512KByte FLASH, 256KByte RAM +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x08000000 to 0x0807FFFF 512K full flash, +0x08000000 to 0x08003FFF 16K isr vector, startup code, +0x08004000 to 0x08007FFF 16K config, // FLASH_Sector_1 +0x08008000 to 0x0807FFFF 480K firmware, +*/ + +/* Specify the memory areas */ +MEMORY +{ + ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K + + ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 16K + /* config occupies the entire flash sector 1 for the ease of erasure, 16K on F72x */ + ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00204000, LENGTH = 16K + ITCM_FLASH1 (rx) : ORIGIN = 0x00208000, LENGTH = 480K + + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K + FLASH_CONFIG (r) : ORIGIN = 0x08004000, LENGTH = 16K + FLASH1 (rx) : ORIGIN = 0x08008000, LENGTH = 480K + + TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 192K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +REGION_ALIAS("STACKRAM", TCM) +REGION_ALIAS("FASTRAM", TCM) + +INCLUDE "stm32_flash_f7_split.ld" diff --git a/src/main/target/link/stm32_flash_f722xe_bl.ld b/src/main/target/link/stm32_flash_f722xe_bl.ld new file mode 100644 index 0000000000..1241562d05 --- /dev/null +++ b/src/main/target/link/stm32_flash_f722xe_bl.ld @@ -0,0 +1,50 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f722.ld +** +** Abstract : Linker script for STM32F722RETx Device with +** 512KByte FLASH, 256KByte RAM +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x08000000 to 0x0807FFFF 512K full flash, +0x08000000 to 0x08003FFF 16K isr vector, startup code, +0x08004000 to 0x08007FFF 16K config, // FLASH_Sector_1 +0x08008000 to 0x0807FFFF 480K firmware, +*/ + +/* Specify the memory areas */ +MEMORY +{ + ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K + + ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 16K + /* config occupies the entire flash sector 1 for the ease of erasure, 16K on F72x */ + ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00204000, LENGTH = 16K + ITCM_FLASH1 (rx) : ORIGIN = 0x00208000, LENGTH = 480K + + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K + FIRMWARE (rx) : ORIGIN = 0x08008000, LENGTH = 16K + FLASH_CONFIG (r) : ORIGIN = 0x0800c000, LENGTH = 16K + + TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 192K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +REGION_ALIAS("STACKRAM", TCM) +REGION_ALIAS("FASTRAM", TCM) + +__firmware_start = ORIGIN(FIRMWARE); + +INCLUDE "stm32_flash_F7.ld" diff --git a/src/main/target/link/stm32_flash_f722xe_for_bl.ld b/src/main/target/link/stm32_flash_f722xe_for_bl.ld new file mode 100644 index 0000000000..5ce5fb0377 --- /dev/null +++ b/src/main/target/link/stm32_flash_f722xe_for_bl.ld @@ -0,0 +1,50 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f722.ld +** +** Abstract : Linker script for STM32F722RETx Device with +** 512KByte FLASH, 256KByte RAM +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x08000000 to 0x0807FFFF 512K full flash, +0x08000000 to 0x08003FFF 16K isr vector, startup code, +0x08004000 to 0x08007FFF 16K config, // FLASH_Sector_1 +0x08008000 to 0x0807FFFF 480K firmware, +*/ + +/* Specify the memory areas */ +MEMORY +{ + ITCM_RAM (rwx) : ORIGIN = 0x00000000, LENGTH = 16K + + /*ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 16K*/ + /* config occupies the entire flash sector 1 for the ease of erasure, 16K on F72x */ + /*ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00204000, LENGTH = 16K*/ + /*ITCM_FLASH1 (rx) : ORIGIN = 0x00208000, LENGTH = 480K*/ + + FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 16K + FLASH_CONFIG (r) : ORIGIN = 0x0800c000, LENGTH = 16K + FLASH1 (rx) : ORIGIN = 0x08010000, LENGTH = 448K + + TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 192K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} + +REGION_ALIAS("STACKRAM", TCM) +REGION_ALIAS("FASTRAM", TCM) + +__firmware_start = ORIGIN(FLASH); + +INCLUDE "stm32_flash_F7_split.ld" diff --git a/src/main/target/link/stm32_flash_f745xg.ld b/src/main/target/link/stm32_flash_f745xg.ld new file mode 100644 index 0000000000..161e3b5d58 --- /dev/null +++ b/src/main/target/link/stm32_flash_f745xg.ld @@ -0,0 +1,48 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f745xg.ld +** +** Abstract : Linker script for STM32F745xG Device with +** 1024KByte FLASH, 320KByte RAM +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x00000000 to 0x00003FFF 16K ITCM RAM, +0x08000000 to 0x080FFFFF 1024K full flash, +0x08000000 to 0x08007FFF 32K isr vector, startup code, +0x08008000 to 0x0800FFFF 32K config, // FLASH_Sector_1 +0x08010000 to 0x080FFFFF 960K firmware, +*/ + +/* Specify the memory areas */ +MEMORY +{ + ITCM_RAM (rx) : ORIGIN = 0x00000000, LENGTH = 16K + ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 32K + /* config occupies the entire flash sector 1 for the ease of erasure, 32K on F74x */ + ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00208000, LENGTH = 32K + ITCM_FLASH1 (rx) : ORIGIN = 0x00210000, LENGTH = 960K + + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K + FLASH_CONFIG (r) : ORIGIN = 0x08008000, LENGTH = 32K + FLASH1 (rx) : ORIGIN = 0x08010000, LENGTH = 960K + + TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 256K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} +/* note CCM could be used for stack */ +REGION_ALIAS("STACKRAM", TCM) +REGION_ALIAS("FASTRAM", TCM) + +INCLUDE "stm32_flash_F7_split.ld" diff --git a/src/main/target/link/stm32_flash_f745xg_bl.ld b/src/main/target/link/stm32_flash_f745xg_bl.ld new file mode 100644 index 0000000000..6639776539 --- /dev/null +++ b/src/main/target/link/stm32_flash_f745xg_bl.ld @@ -0,0 +1,50 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f745.ld +** +** Abstract : Linker script for STM32F745VGTx Device with +** 1024KByte FLASH, 320KByte RAM +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x00000000 to 0x00003FFF 16K ITCM RAM, +0x08000000 to 0x080FFFFF 1024K full flash, +0x08000000 to 0x08007FFF 32K isr vector, startup code, +0x08008000 to 0x0800FFFF 32K config, // FLASH_Sector_1 +0x08010000 to 0x080FFFFF 960K firmware, +*/ + +/* Specify the memory areas */ +MEMORY +{ + ITCM_RAM (rx) : ORIGIN = 0x00000000, LENGTH = 16K + ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 32K + /* config occupies the entire flash sector 1 for the ease of erasure, 32K on F74x */ + ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00208000, LENGTH = 32K + ITCM_FLASH1 (rx) : ORIGIN = 0x00210000, LENGTH = 928K + + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K + FIRMWARE (rx) : ORIGIN = 0x08008000, LENGTH = 32K + FLASH_CONFIG (r) : ORIGIN = 0x08010000, LENGTH = 32K + + TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 256K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} +/* note CCM could be used for stack */ +REGION_ALIAS("STACKRAM", TCM) +REGION_ALIAS("FASTRAM", TCM) + +__firmware_start = ORIGIN(FIRMWARE); + +INCLUDE "stm32_flash_F7.ld" diff --git a/src/main/target/link/stm32_flash_f745xg_for_bl.ld b/src/main/target/link/stm32_flash_f745xg_for_bl.ld new file mode 100644 index 0000000000..4cfd76df20 --- /dev/null +++ b/src/main/target/link/stm32_flash_f745xg_for_bl.ld @@ -0,0 +1,50 @@ +/* +***************************************************************************** +** +** File : stm32_flash_f745.ld +** +** Abstract : Linker script for STM32F745VGTx Device with +** 1024KByte FLASH, 320KByte RAM +** +***************************************************************************** +*/ + +/* Stack & Heap sizes */ +_Min_Heap_Size = 0; +_Min_Stack_Size = 0x1800; + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* +0x00000000 to 0x00003FFF 16K ITCM RAM, +0x08000000 to 0x080FFFFF 1024K full flash, +0x08000000 to 0x08007FFF 32K isr vector, startup code, +0x08008000 to 0x0800FFFF 32K config, // FLASH_Sector_1 +0x08010000 to 0x080FFFFF 960K firmware, +*/ + +/* Specify the memory areas */ +MEMORY +{ + ITCM_RAM (rx) : ORIGIN = 0x00000000, LENGTH = 16K + ITCM_FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 32K + /* config occupies the entire flash sector 1 for the ease of erasure, 32K on F74x */ + ITCM_FLASH_CONFIG (r) : ORIGIN = 0x00208000, LENGTH = 32K + ITCM_FLASH1 (rx) : ORIGIN = 0x00210000, LENGTH = 960K + + FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 32K + FLASH_CONFIG (r) : ORIGIN = 0x08010000, LENGTH = 32K + FLASH1 (rx) : ORIGIN = 0x08018000, LENGTH = 928K + + TCM (rwx) : ORIGIN = 0x20000000, LENGTH = 64K + RAM (rwx) : ORIGIN = 0x20010000, LENGTH = 256K + MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K +} +/* note CCM could be used for stack */ +REGION_ALIAS("STACKRAM", TCM) +REGION_ALIAS("FASTRAM", TCM) + +__firmware_start = ORIGIN(FLASH); + +INCLUDE "stm32_flash_F7_split.ld"