Ver Fonte

fix:加密的部分超过64KB下载会失败

alienwalker há 3 anos atrás
pai
commit
1def200874
2 ficheiros alterados com 9 adições e 1 exclusões
  1. 9 1
      bsp/air105/platform/bl_main.c
  2. BIN
      project/air105/soc_download.exe

+ 9 - 1
bsp/air105/platform/bl_main.c

@@ -548,7 +548,15 @@ void Remote_Upgrade(void)
 				ReadLen += ReadBuffer.Pos;
 
 				prvBL.FWDataBuffer.Pos = __FLASH_BLOCK_SIZE__;
-				Result = LzmaUncompress(prvBL.FWDataBuffer.Data, &prvBL.FWDataBuffer.Pos, ReadBuffer.Data, &LzmaDataLen, LzmaHead, LzmaHeadLen);
+				if (LzmaHead[0])
+				{
+					Result = LzmaUncompress(prvBL.FWDataBuffer.Data, &prvBL.FWDataBuffer.Pos, ReadBuffer.Data, &LzmaDataLen, LzmaHead, LzmaHeadLen);
+				}
+				else
+				{
+					prvBL.FWDataBuffer.Pos = LzmaDataLen;
+					memcpy(prvBL.FWDataBuffer.Data, ReadBuffer.Data, LzmaDataLen);
+				}
 				while(Flash_CheckBusy()){;}
 				Flash_Program(ProgramPos, prvBL.FWDataBuffer.Data, prvBL.FWDataBuffer.Pos);
 				WDT_Feed();

BIN
project/air105/soc_download.exe