diff --git a/components/bootloaders/SConscript b/components/bootloaders/SConscript index 7b44cdfb..f6cb87bb 100644 --- a/components/bootloaders/SConscript +++ b/components/bootloaders/SConscript @@ -3,6 +3,6 @@ from SCons.Script import Import, Return Import("*") -artifacts = SConscript("STM/stm32f103/SConscript", exports=["CONFIG_IDS", "PLATFORM_ENV"]) +artifacts = SConscript("STM/stm32f1/SConscript", exports=["CONFIG_IDS", "PLATFORM_ENV"]) Return('artifacts') diff --git a/components/bootloaders/STM/stm32f103/FeatureDefs.yaml b/components/bootloaders/STM/stm32f1/FeatureDefs.yaml similarity index 83% rename from components/bootloaders/STM/stm32f103/FeatureDefs.yaml rename to components/bootloaders/STM/stm32f1/FeatureDefs.yaml index a2f0c100..0abdba0e 100644 --- a/components/bootloaders/STM/stm32f103/FeatureDefs.yaml +++ b/components/bootloaders/STM/stm32f1/FeatureDefs.yaml @@ -4,3 +4,4 @@ config: defs: can_debug: erase_invalid_app: + flashable_bootloader: diff --git a/components/bootloaders/STM/stm32f1/FeatureSels.yaml b/components/bootloaders/STM/stm32f1/FeatureSels.yaml new file mode 100644 index 00000000..204626fa --- /dev/null +++ b/components/bootloaders/STM/stm32f1/FeatureSels.yaml @@ -0,0 +1,5 @@ +featureDefs: "#/components/bootloaders/STM/stm32f1/FeatureDefs.yaml" +features: + feature_erase_invalid_app: false + feature_can_debug: false + mcu_stm32_use_hal: false diff --git a/components/bootloaders/STM/stm32f103/SConscript b/components/bootloaders/STM/stm32f1/SConscript similarity index 95% rename from components/bootloaders/STM/stm32f103/SConscript rename to components/bootloaders/STM/stm32f1/SConscript index 8b4ea4c2..986205f2 100644 --- a/components/bootloaders/STM/stm32f103/SConscript +++ b/components/bootloaders/STM/stm32f1/SConscript @@ -71,6 +71,7 @@ c_flags = [ "-Wshadow", "-Wunused", "-Wundef", + "-include", "BuildDefines.h", # Executed one after eachother ] if not GetOption("release"): @@ -81,6 +82,7 @@ link_flags = [ # "-Wl,--print-gc-sections", "-Wl,--relax", "-Wl,--print-memory-usage", + "-Icomponents/bootloaders/STM/stm32f1/include/HW/", ] as_flags = [ @@ -126,7 +128,7 @@ env.Append( ASFLAGS=as_flags, CPPPATH=inc_paths, CCFLAGS=c_flags, - LINKSCRIPT=File("STM32F103C8.ld"), + LINKSCRIPT=File("STM32F1.ld"), LINKFLAGS=c_flags + link_flags, ) @@ -195,9 +197,19 @@ for config_id, config in configs.items(): "_".join(config["description"].split(" ")) + f"_{config_id}" ) generated_dir = variant_dir.Dir("generated") + config_env.Append( + LINKFLAGS=f"-I{generated_dir.abspath}", + ) makedirs(generated_dir.abspath, exist_ok=True) features = {"features": config_env.GenerateFeatures(feature_selections_files, config["features"]["overrides"]) } + if features["features"]["defs"]["app_function_id"] == "function_id_bl": + try: + AddOption("--flashable-bootloader", dest="flashable-bootloader", action="store_true") + except Exception: + pass + if GetOption("flashable-bootloader"): + features["features"]["defs"]["feature_flashable_bootloader"] = True generated_features = render_generated_files(features, renderers["featureDefs"], generated_dir) generated = render_generated_files(config["options"], renderers["buildDefs"], generated_dir) @@ -222,15 +234,6 @@ for config_id, config in configs.items(): for src in uds_srcs ] ) - if features["features"]["defs"]["app_function_id"] == "function_id_blu": - config_env["LINKSCRIPT"]=File("STM32F103C8-BLU.ld") - elif features["features"]["defs"]["app_function_id"] == "function_id_bl": - try: - AddOption("--flashable-bootloader", dest="flashable-bootloader", action="store_true") - except Exception: - pass - if GetOption("flashable-bootloader"): - config_env["LINKSCRIPT"]=File("STM32F103C8-BLFLASHABLE.ld") # link all the compiled objects into an elf elf, map = config_env.Program( diff --git a/components/bootloaders/STM/stm32f103/STM32F103C8.ld b/components/bootloaders/STM/stm32f1/STM32F1.ld similarity index 78% rename from components/bootloaders/STM/stm32f103/STM32F103C8.ld rename to components/bootloaders/STM/stm32f1/STM32F1.ld index 819733d7..f63d5629 100644 --- a/components/bootloaders/STM/stm32f103/STM32F103C8.ld +++ b/components/bootloaders/STM/stm32f1/STM32F1.ld @@ -1,163 +1,199 @@ -/** - * STM32F103C8.ld - * Linker script for STM32F103C8 - */ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* bottom of stack (grows down) */ - -__STACK_SIZE = 0x400; -__HEAP_SIZE = 0x200; - -__RAM_SIZE = 20K; -__FLASH_SIZE = 64K; -__BOOT_FLASH_SIZE = 8K; - -__RAM_ORIGIN = 0x20000000; /* don't change */ -__FLASH_ORIGIN = 0x8000000; /* don't change */ -__APP_FLASH_ORIGIN = __FLASH_ORIGIN + __BOOT_FLASH_SIZE; -__FLASH_END = __FLASH_ORIGIN + __FLASH_SIZE; -__BOOT_FLASH_END = __FLASH_ORIGIN + __BOOT_FLASH_SIZE; - - -/* Memory definition */ -MEMORY -{ - RAM (rwx) : ORIGIN = __RAM_ORIGIN, LENGTH = __RAM_SIZE - FLASH (rx) : ORIGIN = __FLASH_ORIGIN, LENGTH = __BOOT_FLASH_SIZE -} - -SECTIONS -{ - .isr_vector : ALIGN(0x100) - { - __app_start_addr = .; - KEEP(*(.isr_vector)) /* interrupt vector table */ - } > FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text .text.* .gnu.linkonce.t.*) /* .text sections (code) */ - *(.rodata .rodata.* .gnu.linkonce.r.*) /* .rodata sections (constants, strings, etc.) */ - *(.eh_frame) /* https://stackoverflow.com/questions/26300819/why-gcc-compiled-c-program-needs-eh-frame-section */ - - . = ALIGN(4); - KEEP (*(.init)) - - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(.init_array)) - KEEP (*(SORT(.init_array.*))) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(4); - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* address of end of text section */ - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - .ARM.exidx : - { - PROVIDE (__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE (__exidx_end = .); - } > FLASH - - /* .ARM.attributes 0 : */ - /* { */ - /* *(.ARM.attributes) */ - /* } */ - - /* Initialized data sections into "RAM" Ram type memory */ - .relocate : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at start of section */ - *(.data .data.*) /* .data sections */ - *(.ramfunc .ramfunc.*) /* .ramfunc sections */ - . = ALIGN(4); - _edata = .; /* define a global symbol at end of section */ - - } > RAM AT> FLASH - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.relocate); - __appdesc_addr = LOADADDR(.relocate) + SIZEOF(.relocate); - __appcrc_addr = __appdesc_addr + SIZEOF(.appDescriptor); - .appDescriptor __appdesc_addr : - { - __app_desc_addr = .; - . = ALIGN(4); - KEEP(*(.appDescriptor)) - } > FLASH - __app_end_addr = LOADADDR(.appDescriptor) + SIZEOF(.appDescriptor); - .crc __appcrc_addr : - { - __app_crc_addr = .; - KEEP(*(.appCrc)) - } > FLASH - - - /* Uninitialized data section into "RAM" Ram type memory */ - .bss(NOLOAD) : - { - /* This is used by the startup in order to initialize the .bss section */ - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss .bss.*) - *(COMMON) - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } > RAM - - /* Heap and Stack definitions, if needed */ - .heap (COPY) : - { - . = ALIGN(8); - __HeapLimit = .; - . = . + __HEAP_SIZE; - . = ALIGN(8); - __HeapTop = .; - PROVIDE(end = .); - } > RAM - - .stack (ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE) (COPY) : - { - . = ALIGN(8); - __StackLimit = .; - . = . + __STACK_SIZE; - . = ALIGN(8); - __StackTop = .; - _estack = .; - PROVIDE(__stack = __StackTop); - } > RAM - - ASSERT(__HeapTop < __StackLimit, "RAM overflowed stack") - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - libc_nano.a ( * ) - libg_nano.a ( * ) - } -} +/** + * STM32F103C8.ld + * Linker script for STM32F103C8 + */ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = ORIGIN(RAM) + LENGTH(RAM); /* bottom of stack (grows down) */ + +__STACK_SIZE = 0x400; +__HEAP_SIZE = 0x200; + +#if MCU_STM32_PN == FDEFS_STM32_PN_STM32F103XB +__RAM_SIZE = 20K; +__FLASH_SIZE = 64K; +#elif MCU_STM32_PN == FDEFS_STM32_PN_STM32F105 +__RAM_SIZE = 64K; +__FLASH_SIZE = 256K; +#else +#error "Chipset not supported" +#endif +__BOOT_FLASH_SIZE = 8K; +__APP_FLASH_SIZE = __FLASH_SIZE - __BOOT_FLASH_SIZE; + +__RAM_ORIGIN = 0x20000000; /* don't change */ +__FLASH_ORIGIN = 0x8000000; /* don't change */ +__APP_FLASH_ORIGIN = __FLASH_ORIGIN + __BOOT_FLASH_SIZE; +__FLASH_END = __FLASH_ORIGIN + __FLASH_SIZE; +__BOOT_FLASH_END = __FLASH_ORIGIN + __BOOT_FLASH_SIZE; + + +/* Memory definition */ +MEMORY +{ + RAM (rwx) : ORIGIN = __RAM_ORIGIN, LENGTH = __RAM_SIZE +#if APP_FUNCTION_ID == FDEFS_FUNCTION_ID_BL + FLASH (rx) : ORIGIN = __FLASH_ORIGIN, LENGTH = __BOOT_FLASH_SIZE +#elif APP_FUNCTION_ID == FDEFS_FUNCTION_ID_BLU + FLASH (rx) : ORIGIN = __APP_FLASH_ORIGIN, LENGTH = __APP_FLASH_SIZE +#else +#error "Function not supported" +#endif +} + +SECTIONS +{ +#if APP_FUNCTION_ID == FDEFS_FUNCTION_ID_BLU + .appDescriptor : + { + __app_desc_addr = .; + . = ALIGN(4); + KEEP(*(.appDescriptor)) + } > FLASH +#elif APP_FUNCTION_ID != FDEFS_FUNCTION_ID_BL +#error "Function not supported" +#endif + + .isr_vector : ALIGN(0x100) + { + __app_start_addr = .; + KEEP(*(.isr_vector)) /* interrupt vector table */ + } > FLASH + + /* The program code and other data into "FLASH" Rom type memory */ + .text : + { + . = ALIGN(4); + *(.text .text.* .gnu.linkonce.t.*) /* .text sections (code) */ + *(.rodata .rodata.* .gnu.linkonce.r.*) /* .rodata sections (constants, strings, etc.) */ + *(.eh_frame) /* https://stackoverflow.com/questions/26300819/why-gcc-compiled-c-program-needs-eh-frame-section */ + + . = ALIGN(4); + KEEP (*(.init)) + + . = ALIGN(4); + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(.init_array)) + KEEP (*(SORT(.init_array.*))) + PROVIDE_HIDDEN (__init_array_end = .); + + . = ALIGN(4); + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* address of end of text section */ + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + .ARM.exidx : + { + PROVIDE (__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE (__exidx_end = .); + } > FLASH + + /* .ARM.attributes 0 : */ + /* { */ + /* *(.ARM.attributes) */ + /* } */ + + /* Initialized data sections into "RAM" Ram type memory */ + .relocate : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at start of section */ + *(.data .data.*) /* .data sections */ + *(.ramfunc .ramfunc.*) /* .ramfunc sections */ + . = ALIGN(4); + _edata = .; /* define a global symbol at end of section */ + + } > RAM AT> FLASH + /* Used by the startup to initialize data */ + _sidata = LOADADDR(.relocate); +#if APP_FUNCTION_ID == FDEFS_FUNCTION_ID_BL +#if FEATURE_IS_ENABLED(FEATURE_FLASHABLE_BOOTLOADER) + __appcrc_addr = __BOOT_FLASH_END - 4; + __appdesc_addr = __appcrc_addr - SIZEOF(.appDescriptor); +#else + __appdesc_addr = LOADADDR(.relocate) + SIZEOF(.relocate); + __appcrc_addr = __appdesc_addr + SIZEOF(.appDescriptor); +#endif + .appDescriptor __appdesc_addr : + { + __app_desc_addr = .; + . = ALIGN(4); + KEEP(*(.appDescriptor)) + } > FLASH +#elif APP_FUNCTION_ID == FDEFS_FUNCTION_ID_BLU + __appcrc_addr = LOADADDR(.relocate) + SIZEOF(.relocate); +#else +#error "Function not supported" +#endif + .crc __appcrc_addr : + { + __app_crc_addr = .; + __app_end_addr = .; + KEEP(*(.appCrc)) + } > FLASH + + + /* Uninitialized data section into "RAM" Ram type memory */ + .bss(NOLOAD) : + { + /* This is used by the startup in order to initialize the .bss section */ + . = ALIGN(4); + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } > RAM + + /* Heap and Stack definitions, if needed */ + .heap (COPY) : + { + . = ALIGN(8); + __HeapLimit = .; + . = . + __HEAP_SIZE; + . = ALIGN(8); + __HeapTop = .; + PROVIDE(end = .); + } > RAM + + .stack (ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE) (COPY) : + { + . = ALIGN(8); + __StackLimit = .; + . = . + __STACK_SIZE; + . = ALIGN(8); + __StackTop = .; + _estack = .; + PROVIDE(__stack = __StackTop); + } > RAM + + ASSERT(__HeapTop < __StackLimit, "RAM overflowed stack") + + /* Remove information from the compiler libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + libc_nano.a ( * ) + libg_nano.a ( * ) + } +} diff --git a/components/bootloaders/STM/stm32f103/include/CAN.h b/components/bootloaders/STM/stm32f1/include/CAN.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/CAN.h rename to components/bootloaders/STM/stm32f1/include/CAN.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/BuildDefines.h b/components/bootloaders/STM/stm32f1/include/HW/BuildDefines.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/BuildDefines.h rename to components/bootloaders/STM/stm32f1/include/HW/BuildDefines.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW.h b/components/bootloaders/STM/stm32f1/include/HW/HW.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW.h rename to components/bootloaders/STM/stm32f1/include/HW/HW.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW_CAN.h b/components/bootloaders/STM/stm32f1/include/HW/HW_CAN.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW_CAN.h rename to components/bootloaders/STM/stm32f1/include/HW/HW_CAN.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW_CLK.h b/components/bootloaders/STM/stm32f1/include/HW/HW_CLK.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW_CLK.h rename to components/bootloaders/STM/stm32f1/include/HW/HW_CLK.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW_CRC.h b/components/bootloaders/STM/stm32f1/include/HW/HW_CRC.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW_CRC.h rename to components/bootloaders/STM/stm32f1/include/HW/HW_CRC.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW_FLASH.h b/components/bootloaders/STM/stm32f1/include/HW/HW_FLASH.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW_FLASH.h rename to components/bootloaders/STM/stm32f1/include/HW/HW_FLASH.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW_GPIO.h b/components/bootloaders/STM/stm32f1/include/HW/HW_GPIO.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW_GPIO.h rename to components/bootloaders/STM/stm32f1/include/HW/HW_GPIO.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW_NVIC.h b/components/bootloaders/STM/stm32f1/include/HW/HW_NVIC.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW_NVIC.h rename to components/bootloaders/STM/stm32f1/include/HW/HW_NVIC.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW_SYS.h b/components/bootloaders/STM/stm32f1/include/HW/HW_SYS.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW_SYS.h rename to components/bootloaders/STM/stm32f1/include/HW/HW_SYS.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW_TIM.h b/components/bootloaders/STM/stm32f1/include/HW/HW_TIM.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW_TIM.h rename to components/bootloaders/STM/stm32f1/include/HW/HW_TIM.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW_pinmux.h b/components/bootloaders/STM/stm32f1/include/HW/HW_pinmux.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW_pinmux.h rename to components/bootloaders/STM/stm32f1/include/HW/HW_pinmux.h diff --git a/components/bootloaders/STM/stm32f103/include/HW/HW_specific.h b/components/bootloaders/STM/stm32f1/include/HW/HW_specific.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/HW/HW_specific.h rename to components/bootloaders/STM/stm32f1/include/HW/HW_specific.h diff --git a/components/bootloaders/STM/stm32f103/include/LIB_app_config.h b/components/bootloaders/STM/stm32f1/include/LIB_app_config.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/LIB_app_config.h rename to components/bootloaders/STM/stm32f1/include/LIB_app_config.h diff --git a/components/bootloaders/STM/stm32f103/include/Types.h b/components/bootloaders/STM/stm32f1/include/Types.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/Types.h rename to components/bootloaders/STM/stm32f1/include/Types.h diff --git a/components/bootloaders/STM/stm32f103/include/UDS.h b/components/bootloaders/STM/stm32f1/include/UDS.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/UDS.h rename to components/bootloaders/STM/stm32f1/include/UDS.h diff --git a/components/bootloaders/STM/stm32f103/include/Utilities.h b/components/bootloaders/STM/stm32f1/include/Utilities.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/Utilities.h rename to components/bootloaders/STM/stm32f1/include/Utilities.h diff --git a/components/bootloaders/STM/stm32f103/include/cortexm3_macro.h b/components/bootloaders/STM/stm32f1/include/cortexm3_macro.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/cortexm3_macro.h rename to components/bootloaders/STM/stm32f1/include/cortexm3_macro.h diff --git a/components/bootloaders/STM/stm32f103/include/libcrc_componentSpecific.h b/components/bootloaders/STM/stm32f1/include/libcrc_componentSpecific.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/libcrc_componentSpecific.h rename to components/bootloaders/STM/stm32f1/include/libcrc_componentSpecific.h diff --git a/components/bootloaders/STM/stm32f103/include/uds_componentSpecific.h b/components/bootloaders/STM/stm32f1/include/uds_componentSpecific.h similarity index 100% rename from components/bootloaders/STM/stm32f103/include/uds_componentSpecific.h rename to components/bootloaders/STM/stm32f1/include/uds_componentSpecific.h diff --git a/components/bootloaders/STM/stm32f103/renderers/BuildDefines_generated.h.mako b/components/bootloaders/STM/stm32f1/renderers/BuildDefines_generated.h.mako similarity index 100% rename from components/bootloaders/STM/stm32f103/renderers/BuildDefines_generated.h.mako rename to components/bootloaders/STM/stm32f1/renderers/BuildDefines_generated.h.mako diff --git a/components/bootloaders/STM/stm32f103/src/CAN.c b/components/bootloaders/STM/stm32f1/src/CAN.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/CAN.c rename to components/bootloaders/STM/stm32f1/src/CAN.c diff --git a/components/bootloaders/STM/stm32f103/src/HW/HW.c b/components/bootloaders/STM/stm32f1/src/HW/HW.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/HW/HW.c rename to components/bootloaders/STM/stm32f1/src/HW/HW.c diff --git a/components/bootloaders/STM/stm32f103/src/HW/HW_CAN.c b/components/bootloaders/STM/stm32f1/src/HW/HW_CAN.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/HW/HW_CAN.c rename to components/bootloaders/STM/stm32f1/src/HW/HW_CAN.c diff --git a/components/bootloaders/STM/stm32f103/src/HW/HW_CLK.c b/components/bootloaders/STM/stm32f1/src/HW/HW_CLK.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/HW/HW_CLK.c rename to components/bootloaders/STM/stm32f1/src/HW/HW_CLK.c diff --git a/components/bootloaders/STM/stm32f103/src/HW/HW_CRC.c b/components/bootloaders/STM/stm32f1/src/HW/HW_CRC.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/HW/HW_CRC.c rename to components/bootloaders/STM/stm32f1/src/HW/HW_CRC.c diff --git a/components/bootloaders/STM/stm32f103/src/HW/HW_FLASH.c b/components/bootloaders/STM/stm32f1/src/HW/HW_FLASH.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/HW/HW_FLASH.c rename to components/bootloaders/STM/stm32f1/src/HW/HW_FLASH.c diff --git a/components/bootloaders/STM/stm32f103/src/HW/HW_GPIO.c b/components/bootloaders/STM/stm32f1/src/HW/HW_GPIO.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/HW/HW_GPIO.c rename to components/bootloaders/STM/stm32f1/src/HW/HW_GPIO.c diff --git a/components/bootloaders/STM/stm32f103/src/HW/HW_NVIC.c b/components/bootloaders/STM/stm32f1/src/HW/HW_NVIC.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/HW/HW_NVIC.c rename to components/bootloaders/STM/stm32f1/src/HW/HW_NVIC.c diff --git a/components/bootloaders/STM/stm32f103/src/HW/HW_SYS.c b/components/bootloaders/STM/stm32f1/src/HW/HW_SYS.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/HW/HW_SYS.c rename to components/bootloaders/STM/stm32f1/src/HW/HW_SYS.c diff --git a/components/bootloaders/STM/stm32f103/src/HW/HW_TIM.c b/components/bootloaders/STM/stm32f1/src/HW/HW_TIM.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/HW/HW_TIM.c rename to components/bootloaders/STM/stm32f1/src/HW/HW_TIM.c diff --git a/components/bootloaders/STM/stm32f103/src/UDS.c b/components/bootloaders/STM/stm32f1/src/UDS.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/UDS.c rename to components/bootloaders/STM/stm32f1/src/UDS.c diff --git a/components/bootloaders/STM/stm32f103/src/c_only_startup.S b/components/bootloaders/STM/stm32f1/src/c_only_startup.S similarity index 100% rename from components/bootloaders/STM/stm32f103/src/c_only_startup.S rename to components/bootloaders/STM/stm32f1/src/c_only_startup.S diff --git a/components/bootloaders/STM/stm32f103/src/cortexm3_macro.S b/components/bootloaders/STM/stm32f1/src/cortexm3_macro.S similarity index 100% rename from components/bootloaders/STM/stm32f103/src/cortexm3_macro.S rename to components/bootloaders/STM/stm32f1/src/cortexm3_macro.S diff --git a/components/bootloaders/STM/stm32f103/src/main.c b/components/bootloaders/STM/stm32f1/src/main.c similarity index 100% rename from components/bootloaders/STM/stm32f103/src/main.c rename to components/bootloaders/STM/stm32f1/src/main.c diff --git a/components/bootloaders/STM/stm32f103/variants.yaml b/components/bootloaders/STM/stm32f1/variants.yaml similarity index 100% rename from components/bootloaders/STM/stm32f103/variants.yaml rename to components/bootloaders/STM/stm32f1/variants.yaml diff --git a/components/bootloaders/STM/stm32f103/FeatureSels.yaml b/components/bootloaders/STM/stm32f103/FeatureSels.yaml deleted file mode 100644 index a2ec9292..00000000 --- a/components/bootloaders/STM/stm32f103/FeatureSels.yaml +++ /dev/null @@ -1,4 +0,0 @@ -featureDefs: "#/components/bootloaders/STM/stm32f103/FeatureDefs.yaml" -features: - feature_erase_invalid_app: false - feature_can_debug: false diff --git a/components/bootloaders/STM/stm32f103/STM32F103C8-BLFLASHABLE.ld b/components/bootloaders/STM/stm32f103/STM32F103C8-BLFLASHABLE.ld deleted file mode 100644 index 81ad26e3..00000000 --- a/components/bootloaders/STM/stm32f103/STM32F103C8-BLFLASHABLE.ld +++ /dev/null @@ -1,163 +0,0 @@ -/** - * STM32F103C8.ld - * Linker script for STM32F103C8 - */ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* bottom of stack (grows down) */ - -__STACK_SIZE = 0x400; -__HEAP_SIZE = 0x200; - -__RAM_SIZE = 20K; -__FLASH_SIZE = 64K; -__BOOT_FLASH_SIZE = 8K; - -__RAM_ORIGIN = 0x20000000; /* don't change */ -__FLASH_ORIGIN = 0x8000000; /* don't change */ -__APP_FLASH_ORIGIN = __FLASH_ORIGIN + __BOOT_FLASH_SIZE; -__FLASH_END = __FLASH_ORIGIN + __FLASH_SIZE; -__BOOT_FLASH_END = __FLASH_ORIGIN + __BOOT_FLASH_SIZE; - - -/* Memory definition */ -MEMORY -{ - RAM (rwx) : ORIGIN = __RAM_ORIGIN, LENGTH = __RAM_SIZE - FLASH (rx) : ORIGIN = __FLASH_ORIGIN, LENGTH = __BOOT_FLASH_SIZE -} - -SECTIONS -{ - .isr_vector : ALIGN(0x100) - { - __app_start_addr = .; - KEEP(*(.isr_vector)) /* interrupt vector table */ - } > FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text .text.* .gnu.linkonce.t.*) /* .text sections (code) */ - *(.rodata .rodata.* .gnu.linkonce.r.*) /* .rodata sections (constants, strings, etc.) */ - *(.eh_frame) /* https://stackoverflow.com/questions/26300819/why-gcc-compiled-c-program-needs-eh-frame-section */ - - . = ALIGN(4); - KEEP (*(.init)) - - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(.init_array)) - KEEP (*(SORT(.init_array.*))) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(4); - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* address of end of text section */ - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - .ARM.exidx : - { - PROVIDE (__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE (__exidx_end = .); - } > FLASH - - /* .ARM.attributes 0 : */ - /* { */ - /* *(.ARM.attributes) */ - /* } */ - - /* Initialized data sections into "RAM" Ram type memory */ - .relocate : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at start of section */ - *(.data .data.*) /* .data sections */ - *(.ramfunc .ramfunc.*) /* .ramfunc sections */ - . = ALIGN(4); - _edata = .; /* define a global symbol at end of section */ - - } > RAM AT> FLASH - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.relocate); - __appcrc_addr = __BOOT_FLASH_END - 4; - __appdesc_addr = __appcrc_addr - SIZEOF(.appDescriptor); - .appDescriptor __appdesc_addr : - { - __app_desc_addr = .; - . = ALIGN(4); - KEEP(*(.appDescriptor)) - } > FLASH - __app_end_addr = __APP_FLASH_ORIGIN - 4; - .crc __appcrc_addr : - { - __app_crc_addr = .; - KEEP(*(.appCrc)) - } > FLASH - - - /* Uninitialized data section into "RAM" Ram type memory */ - .bss(NOLOAD) : - { - /* This is used by the startup in order to initialize the .bss section */ - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss .bss.*) - *(COMMON) - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } > RAM - - /* Heap and Stack definitions, if needed */ - .heap (COPY) : - { - . = ALIGN(8); - __HeapLimit = .; - . = . + __HEAP_SIZE; - . = ALIGN(8); - __HeapTop = .; - PROVIDE(end = .); - } > RAM - - .stack (ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE) (COPY) : - { - . = ALIGN(8); - __StackLimit = .; - . = . + __STACK_SIZE; - . = ALIGN(8); - __StackTop = .; - _estack = .; - PROVIDE(__stack = __StackTop); - } > RAM - - ASSERT(__HeapTop < __StackLimit, "RAM overflowed stack") - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - libc_nano.a ( * ) - libg_nano.a ( * ) - } -} diff --git a/components/bootloaders/STM/stm32f103/STM32F103C8-BLU.ld b/components/bootloaders/STM/stm32f103/STM32F103C8-BLU.ld deleted file mode 100644 index faabdf3a..00000000 --- a/components/bootloaders/STM/stm32f103/STM32F103C8-BLU.ld +++ /dev/null @@ -1,162 +0,0 @@ -/** - * STM32F103C8.ld - * Linker script for STM32F103C8 - */ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* bottom of stack (grows down) */ - -__STACK_SIZE = 0x400; -__HEAP_SIZE = 0x200; - -__RAM_SIZE = 20K; -__FLASH_SIZE = 64K; -__BOOT_FLASH_SIZE = 8K; -__APP_FLASH_SIZE = __FLASH_SIZE - __BOOT_FLASH_SIZE; - -__RAM_ORIGIN = 0x20000000; /* don't change */ -__FLASH_ORIGIN = 0x8000000; /* don't change */ -__APP_FLASH_ORIGIN = __FLASH_ORIGIN + __BOOT_FLASH_SIZE; -__FLASH_END = __FLASH_ORIGIN + __FLASH_SIZE; -__BOOT_FLASH_END = __FLASH_ORIGIN + __BOOT_FLASH_SIZE; - - -/* Memory definition */ -MEMORY -{ - RAM (rwx) : ORIGIN = __RAM_ORIGIN, LENGTH = __RAM_SIZE - FLASH (rx) : ORIGIN = __APP_FLASH_ORIGIN, LENGTH = __APP_FLASH_SIZE -} - -SECTIONS -{ - .appDescriptor : - { - . = ALIGN(4); - KEEP(*(.appDescriptor)) - } > FLASH - .isr_vector : ALIGN(0x100) - { - __app_start_addr = .; - KEEP(*(.isr_vector)) /* interrupt vector table */ - } > FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text .text.* .gnu.linkonce.t.*) /* .text sections (code) */ - *(.rodata .rodata.* .gnu.linkonce.r.*) /* .rodata sections (constants, strings, etc.) */ - *(.eh_frame) /* https://stackoverflow.com/questions/26300819/why-gcc-compiled-c-program-needs-eh-frame-section */ - - . = ALIGN(4); - KEEP (*(.init)) - - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(.init_array)) - KEEP (*(SORT(.init_array.*))) - PROVIDE_HIDDEN (__init_array_end = .); - - . = ALIGN(4); - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* address of end of text section */ - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - .ARM.exidx : - { - PROVIDE (__exidx_start = .); - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - PROVIDE (__exidx_end = .); - } > FLASH - - /* .ARM.attributes 0 : */ - /* { */ - /* *(.ARM.attributes) */ - /* } */ - - /* Initialized data sections into "RAM" Ram type memory */ - .relocate : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at start of section */ - *(.data .data.*) /* .data sections */ - *(.ramfunc .ramfunc.*) /* .ramfunc sections */ - . = ALIGN(4); - _edata = .; /* define a global symbol at end of section */ - - } > RAM AT> FLASH - __app_end_addr = LOADADDR(.relocate) + SIZEOF(.relocate); - .crc __app_end_addr : - { - __app_crc_addr = .; - KEEP(*(.appCrc)) - } > FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.relocate); - - - /* Uninitialized data section into "RAM" Ram type memory */ - .bss(NOLOAD) : - { - /* This is used by the startup in order to initialize the .bss section */ - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss .bss.*) - *(COMMON) - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } > RAM - - /* Heap and Stack definitions, if needed */ - .heap (COPY) : - { - . = ALIGN(8); - __HeapLimit = .; - . = . + __HEAP_SIZE; - . = ALIGN(8); - __HeapTop = .; - PROVIDE(end = .); - } > RAM - - .stack (ORIGIN(RAM) + LENGTH(RAM) - __STACK_SIZE) (COPY) : - { - . = ALIGN(8); - __StackLimit = .; - . = . + __STACK_SIZE; - . = ALIGN(8); - __StackTop = .; - _estack = .; - PROVIDE(__stack = __StackTop); - } > RAM - - ASSERT(__HeapTop < __StackLimit, "RAM overflowed stack") - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - libc_nano.a ( * ) - libg_nano.a ( * ) - } -}