feat(cproject): 移除CAN DMA相关代码并优化编译配置

- 移除了CAN模块中的DMA相关代码,包括can_dma_init函数、
  DMA中断处理函数以及相关的全局变量和头文件包含

- 更新了项目构建配置,将优化级别从balanced改为size以减小
  固件体积

- 添加了-fno-exceptions和-fno-rtti编译选项以进一步优化代码

- 升级了GD32C10x_DFP包版本至1.5.0

- 调整了OTA跳转逻辑,增加了更安全的中断和外设关闭处理

- 修复了Flash写入时的重复包处理逻辑,增加错误标志清理机制

- 将AES加密算法中的gf_mul函数标记为noinline属性
This commit is contained in:
cbb
2026-07-26 23:08:02 +08:00
parent c357a8af6f
commit 05069e3057
58 changed files with 1332 additions and 4191 deletions
+20 -40
View File
@@ -15,7 +15,7 @@
# Rule for linking CXX executable.
rule CXX_EXECUTABLE_LINKER__Robot_V2.2eRelease.2bGD32C103CB_
command = C:\WINDOWS\system32\cmd.exe /C "$PRE_LINK && c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armlink.exe $LINK_FLAGS $LINK_PATH $LINK_LIBRARIES $in -o $TARGET_FILE --list=$TARGET_FILE.map && $POST_BUILD"
command = C:\WINDOWS\system32\cmd.exe /C "$PRE_LINK && C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armlink.exe $LINK_FLAGS $LINK_PATH $LINK_LIBRARIES $in -o $TARGET_FILE --list=$TARGET_FILE.map && $POST_BUILD"
description = Linking CXX executable $TARGET_FILE
restat = $RESTAT
@@ -26,7 +26,7 @@ rule CXX_EXECUTABLE_LINKER__Robot_V2.2eRelease.2bGD32C103CB_
rule CXX_COMPILER__Group_Source_Files_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building CXX object $out
@@ -36,7 +36,7 @@ rule CXX_COMPILER__Group_Source_Files_unscanned_
rule CXX_COMPILER__Group_sys_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building CXX object $out
@@ -46,7 +46,7 @@ rule CXX_COMPILER__Group_sys_unscanned_
rule CXX_COMPILER__Group_device_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building CXX object $out
@@ -56,7 +56,7 @@ rule CXX_COMPILER__Group_device_unscanned_
rule C_COMPILER__GigaDevice_Device_EVAL_GD32C10x_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -66,7 +66,7 @@ rule C_COMPILER__GigaDevice_Device_EVAL_GD32C10x_1_3_0_unscanned_
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -76,7 +76,7 @@ rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_CAN_1_3_0_unscanned_
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -86,17 +86,7 @@ rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_CRC_1_3_0_unscanned_
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_DBG_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
#############################################
# Rule for compiling C files.
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -106,7 +96,7 @@ rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_DMA_1_3_0_unscanned_
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -116,17 +106,7 @@ rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_EXTI_1_3_0_unscanned_
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_FMC_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
#############################################
# Rule for compiling C files.
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -136,7 +116,7 @@ rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_FWDGT_1_3_0_unscanned
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -146,7 +126,7 @@ rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_GPIO_1_3_0_unscanned_
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -156,7 +136,7 @@ rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_MISC_1_3_0_unscanned_
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -166,7 +146,7 @@ rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_PMU_1_3_0_unscanned_
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -176,7 +156,7 @@ rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_RCU_1_3_0_unscanned_
rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -186,7 +166,7 @@ rule C_COMPILER__GigaDevice_Device_GD32C10x_StdPeripherals_USART_1_3_0_unscanned
rule ASM_COMPILER__GigaDevice_Device_Startup_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -c -o $out $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -c -o $out $in
description = Building ASM object $out
@@ -196,7 +176,7 @@ rule ASM_COMPILER__GigaDevice_Device_Startup_1_3_0_unscanned_
rule C_COMPILER__GigaDevice_Device_Startup_1_3_0_unscanned_
depfile = $DEP_FILE
deps = gcc
command = ${LAUNCHER}${CODE_CHECK}c:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
command = ${LAUNCHER}${CODE_CHECK}C:\Users\cbb\.vcpkg\artifacts\2139c4c6\compilers.arm.armclang\6.24.0\bin\armclang.exe --target=arm-arm-none-eabi $DEFINES $INCLUDES $FLAGS -MD -MT $out -MF $DEP_FILE -o $out -c $in
description = Building C object $out
@@ -212,7 +192,7 @@ rule CUSTOM_COMMAND
# Rule for re-running cmake.
rule RERUN_CMAKE
command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.5\bin\cmake.exe --regenerate-during-build -SG:\Robot_v2\BOOT\tmp\Robot_V2.Release+GD32C103CB -BG:\Robot_v2\BOOT\tmp\1
command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.kitware.cmake\3.31.12\bin\cmake.exe --regenerate-during-build -SG:\Robot_v2\BOOT\tmp\Robot_V2.Release+GD32C103CB -BG:\Robot_v2\BOOT\tmp\1
description = Re-running CMake...
generator = 1
@@ -221,7 +201,7 @@ rule RERUN_CMAKE
# Rule for cleaning all built files.
rule CLEAN
command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.ninja.build.ninja\1.12.1\ninja.exe $FILE_ARG -t clean $TARGETS
command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.ninja.build.ninja\1.12.0\ninja.exe $FILE_ARG -t clean $TARGETS
description = Cleaning all built files...
@@ -229,6 +209,6 @@ rule CLEAN
# Rule for printing all primary targets available.
rule HELP
command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.ninja.build.ninja\1.12.1\ninja.exe -t targets
command = C:\Users\cbb\.vcpkg\artifacts\2139c4c6\tools.ninja.build.ninja\1.12.0\ninja.exe -t targets
description = All primary targets available: