update flash size 3200k
This commit is contained in:
@@ -13,10 +13,6 @@
|
||||
|
||||
#if HID_DFU_EN
|
||||
|
||||
#ifndef DFU_FLASH_MAX_UPGRADE_SIZE
|
||||
#define DFU_FLASH_MAX_UPGRADE_SIZE (2800 * 1024)
|
||||
#endif
|
||||
|
||||
#define DFU_FLASH_ERROR()
|
||||
|
||||
static int dfu_flash_device_open = 0;
|
||||
|
||||
@@ -95,7 +95,7 @@ unsigned char handle_firmware_upgrade_start(uint8_t data[], uint16_t len)
|
||||
|
||||
debug_printf("g_first_page_write_executed: %d\n", g_first_page_write_executed);
|
||||
|
||||
if (firmware_size == 0 || firmware_size > FLASH_MAX_UPGRADE_SIZE) {
|
||||
if (firmware_size == 0 || firmware_size > DFU_FLASH_MAX_UPGRADE_SIZE) {
|
||||
debug_printf("Firmware upgrade error: invalid size %lu\n", firmware_size);
|
||||
response[0] = STATUS_SIZE_INVALID;
|
||||
send_firmware_upgrade_response(FIRMWARE_UPGRADE_START, response, 1);
|
||||
|
||||
@@ -44,7 +44,11 @@ typedef enum {
|
||||
// 数据包格式:同步头(1) + 命令码(1) + 块序号(2) + 数据长度(1) + 数据(N) + Checksum(1)
|
||||
// 所以最大数据长度 = 63 - 5(头部) - 1(Checksum) = 57字节
|
||||
#define MAX_DATA_BLOCK_SIZE 57 // 最大数据块大小(63字节HID数据包 - 5字节头部 - 1字节Checksum)
|
||||
#define FLASH_MAX_UPGRADE_SIZE (2000 * 1024) // 最大固件大小1400KB
|
||||
|
||||
#ifndef DFU_FLASH_MAX_UPGRADE_SIZE
|
||||
#define DFU_FLASH_MAX_UPGRADE_SIZE (3200 * 1024)
|
||||
#endif
|
||||
|
||||
|
||||
// 页缓冲区结构
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user