This commit is contained in:
cbb
2025-12-25 12:07:06 +08:00
commit 26e73f451e
899 changed files with 42812 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include "stdint.h"
// Flash分区配置
constexpr uint32_t BOOTLOADER_SIZE = 0x4000; // 16KB
constexpr uint32_t APP_START_ADDR = 0x08004000; // APP起始地址
constexpr uint32_t APP_MAX_SIZE = 0x0001C000; // 112KB
constexpr uint32_t FMC_PAGE_SIZE = 0x400;
// CANFD配置
constexpr uint32_t CANFD_OTA_REQ_ID = 0x00000100;
constexpr uint32_t CANFD_OTA_DATA_ID = 0x00000101;
constexpr uint32_t CANFD_OTA_ACK_ID = 0x00000102;
// CANFD数据段最大64字节,我们用32字节数据 + 4字节头部
constexpr uint32_t OTA_PACKET_SIZE = 32;
typedef struct {
uint32_t packet_num; // 包序号
uint8_t data[OTA_PACKET_SIZE]; // 32字节有效数据
uint32_t crc32; // 简单校验
} canfd_ota_packet_t;