Follow the reference to port the bootloader

This commit is contained in:
2025-09-28 01:14:06 +08:00
parent 422c27846f
commit bd541d585e
23 changed files with 712 additions and 1638 deletions

View File

@@ -24,7 +24,7 @@ if(DEFINED TOOLCHAIN_DIRECTORY)
set(TOOLCHAIN_PREFIX "${TOOLCHAIN_DIRECTORY}/${TOOLCHAIN_PREFIX}")
endif()
set(FLAGS "-mcpu=cortex-m23 -std=gnu11 -fstack-usage -fdata-sections -ffunction-sections -fmessage-length=0 -fsigned-char -mthumb -Wall -Wno-missing-braces -Wno-format -Wno-strict-aliasing -Wl,--gc-sections")
set(FLAGS "-mcpu=cortex-m23 -std=gnu11 -Os -fstack-usage -fdata-sections -ffunction-sections -fmessage-length=0 -fsigned-char -mthumb -Wall -Wno-missing-braces -Wno-format -Wno-strict-aliasing -Wl,--gc-sections -flto")
set(ASM_FLAGS "-x assembler-with-cpp")
set(CPP_FLAGS "-fno-rtti -fno-exceptions -fno-threadsafe-statics")

View File

@@ -16,8 +16,8 @@ target_compile_options(${TARGET_NAME} PRIVATE
"$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:C>>:-O0>"
"$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:CXX>>:-O0>"
"$<$<AND:$<NOT:$<CONFIG:Debug>>,$<COMPILE_LANGUAGE:C>>:-Os>"
"$<$<AND:$<NOT:$<CONFIG:Debug>>,$<COMPILE_LANGUAGE:CXX>>:-Os>"
"$<$<AND:$<NOT:$<CONFIG:Debug>>,$<COMPILE_LANGUAGE:C>>:-Os;-flto>"
"$<$<AND:$<NOT:$<CONFIG:Debug>>,$<COMPILE_LANGUAGE:CXX>>:-Os;-flto>"
-mcpu=cortex-m23
)
@@ -30,6 +30,7 @@ target_link_options(${TARGET_NAME} PRIVATE
--specs=nano.specs
--specs=nosys.specs
-Wl,--gc-sections
"$<$<NOT:$<CONFIG:Debug>>:-flto>"
-Wl,--start-group -lc -lm -Wl,--end-group
)