From 8b51c78f1b88d94a89bb8c37ae38a54f523cb597 Mon Sep 17 00:00:00 2001 From: QuakeGod <quakegod@sina.com> Date: 星期六, 24 二月 2024 10:16:54 +0800 Subject: [PATCH] CCTE bootloader and KMini --- ComLib/Src/KMachine.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ComLib/Src/KMachine.c b/ComLib/Src/KMachine.c index 5f05e00..c8368e2 100644 --- a/ComLib/Src/KMachine.c +++ b/ComLib/Src/KMachine.c @@ -30,7 +30,7 @@ { // sizeof(stKMInfoBlock), (BOARD_TYPE<<8) + BOARD_VER, //nDeviceType BOARD_VER, //nDevieVer - 0x0104, //ProgVer + 0x0107, //ProgVer 0x0100, //KLinkVer 0x0100, //KBusVer // 0x0100, //KNetVer @@ -54,9 +54,10 @@ 0, //nAbility; 6, //nSwitchBits; }; -const char VersionStr[] __attribute__((at(FLASH_BASE + 0X1000))) //__attribute__((at(0X8001000))) +/* +const char VersionStr[] __attribute__((at(FLASH_BASE + 0X2000))) //__attribute__((at(0X8001000))) = "3.00"; - +*/ const stStoredKMSysCfg KMDefaultSysCfg /*__attribute__((at(STORECFGBASE)))*/ = { START_SIGN, @@ -181,7 +182,7 @@ res = HAL_FLASH_Unlock(); uint32_t ErrNo; FLASH_EraseInitTypeDef erase1; - erase1.NbPages=1; + erase1.NbPages=(nByteSize-1) / FLASH_PAGESIZE + 1;; erase1.PageAddress=(unsigned int)pAddrFlash; erase1.TypeErase=FLASH_TYPEERASE_PAGES; res = HAL_FLASHEx_Erase(&erase1,&ErrNo); -- Gitblit v1.9.1