feat(ota): 实现安全OTA更新协议支持AES加密和CRC校验

- 添加AES128加密解密功能支持安全固件传输
- 实现基于随机数握手的安全会话密钥协商机制
- 集成CRC32带密钥校验确保数据完整性
- 重构OTA状态机支持握手、数据传输和验证流程
- 添加CANFD数据长度规范处理和安全跳转逻辑
- 移除调试打印语句优化性能

refactor(can): 优化CANFD发送和OTA确认处理逻辑

- 重构CANFD_AsyncSend函数支持规范数据长度
- 重命名sendACK为sendDATA_ACK并添加重载函数
- 修复数据长度处理和缓冲区填充逻辑
- 优化CAN消息发送的数据复制和验证流程
- 移除未使用的联合体类型定义

chore(project): 添加AES加密模块和系统初始化配置

- 在项目配置中添加AES128加密解密文件
- 在main.cpp中初始化CRC外设模块
- 添加安全十六进制打印调试函数
- 集成AES加密库到OTA处理流程中
- 优化系统时钟初始化配置
This commit is contained in:
cbb
2026-01-01 01:39:19 +08:00
parent a25ec5f029
commit 9c7145ef99
28 changed files with 2470 additions and 1040 deletions
+30 -15
View File
@@ -9,20 +9,35 @@
322 422 7883668898391400 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-patch b54a62060b325746
422 9179 7883668985966322 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure 708efa7dee4d8c45
422 9179 7883668985966322 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-configure 708efa7dee4d8c45
13 429 7883895993327684 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build c3a3e5728b3e60b8
16 115 7889058218052152 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build c3a3e5728b3e60b8
441 553 7883669975311345 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes 9db191f9941f966f
13 429 7883895993327684 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf c3a3e5728b3e60b8
13 429 7883895993327684 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.hex c3a3e5728b3e60b8
13 429 7883895993327684 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf.map c3a3e5728b3e60b8
839 1004 7883896002827735 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done 39cd38b08f3cacb9
731 839 7883896001185719 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test 57275ea8426097a0
13 429 7883895993327684 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build c3a3e5728b3e60b8
16 115 7889058218052152 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf c3a3e5728b3e60b8
16 115 7889058218052152 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.hex c3a3e5728b3e60b8
16 115 7889058218052152 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf.map c3a3e5728b3e60b8
407 516 7889058222828813 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done 39cd38b08f3cacb9
329 407 7889058221742405 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test 57275ea8426097a0
16 115 7889058218052152 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build c3a3e5728b3e60b8
441 553 7883669975311345 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-executes 9db191f9941f966f
429 671 7883895997486268 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database 206b709820348205
429 671 7883895997486268 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database 206b709820348205
671 731 7883895999907919 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-install 66d6e5c354af78e4
671 731 7883895999907919 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-install 66d6e5c354af78e4
731 839 7883896001185719 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test 57275ea8426097a0
839 1004 7883896002827735 CMakeFiles/Robot_V2.Release+GD32C103CB-complete 39cd38b08f3cacb9
839 1004 7883896002827735 G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-complete 39cd38b08f3cacb9
839 1004 7883896002827735 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done 39cd38b08f3cacb9
115 283 7889058219043466 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database 206b709820348205
115 283 7889058219043466 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database 206b709820348205
283 329 7889058220722009 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-install 66d6e5c354af78e4
283 329 7889058220722009 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-install 66d6e5c354af78e4
329 407 7889058221742405 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test 57275ea8426097a0
407 516 7889058222828813 CMakeFiles/Robot_V2.Release+GD32C103CB-complete 39cd38b08f3cacb9
407 516 7889058222828813 G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-complete 39cd38b08f3cacb9
407 516 7889058222828813 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done 39cd38b08f3cacb9
16 471 7889059150268053 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build c3a3e5728b3e60b8
16 471 7889059150268053 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf c3a3e5728b3e60b8
16 471 7889059150268053 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.hex c3a3e5728b3e60b8
16 471 7889059150268053 G:/Robot_v2/BOOT/out/Robot_V2/GD32C103CB/Release/Robot_V2.axf.map c3a3e5728b3e60b8
16 471 7889059150268053 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-build c3a3e5728b3e60b8
471 680 7889059154820695 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database 206b709820348205
471 680 7889059154820695 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-database 206b709820348205
680 726 7889059156906569 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-install 66d6e5c354af78e4
680 726 7889059156906569 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-install 66d6e5c354af78e4
726 809 7889059157974137 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test 57275ea8426097a0
726 809 7889059157974137 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-test 57275ea8426097a0
809 935 7889059159195145 CMakeFiles/Robot_V2.Release+GD32C103CB-complete 39cd38b08f3cacb9
809 935 7889059159195145 Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done 39cd38b08f3cacb9
809 935 7889059159195145 G:/Robot_v2/BOOT/tmp/CMakeFiles/Robot_V2.Release+GD32C103CB-complete 39cd38b08f3cacb9
809 935 7889059159195145 G:/Robot_v2/BOOT/tmp/Robot_V2.Release+GD32C103CB/src/Robot_V2.Release+GD32C103CB-stamp/Robot_V2.Release+GD32C103CB-done 39cd38b08f3cacb9