|
@@ -20,7 +20,7 @@ static UINT8 Fota_crc_chk(UINT8* data,UINT8 length);
|
|
|
volatile bool Fota_update_flag = FALSE; //可以升级标志
|
|
|
void Fota_Func(UINT8 *DataPtr,INT32 connectId)
|
|
|
{
|
|
|
- UINT8 Fota_Answer[42];
|
|
|
+ UINT8 Fota_Answer[43];
|
|
|
UINT8 Fota_Cmd;
|
|
|
INT8 ret;
|
|
|
Fota_S.Fota_Flash_Addres = FLASH_FOTA_REGION_START;
|
|
@@ -42,7 +42,7 @@ void Fota_Func(UINT8 *DataPtr,INT32 connectId)
|
|
|
Fota_Answer[22] = 0x00;
|
|
|
Fota_Answer[23] = 0x12;
|
|
|
memcpy(&Fota_Answer[24],(DataPtr+24),18);
|
|
|
- Fota_Answer[42] = bcc_chk_fota(Fota_Answer,41);
|
|
|
+ Fota_Answer[42] = bcc_chk_fota(Fota_Answer,42);
|
|
|
tcpipConnectionSend(connectId,Fota_Answer,43,0,0,0);
|
|
|
BSP_QSPI_Erase_Safe(FLASH_FOTA_REGION_START,Fota_S.Fota_All_Data_Len + 4 - (Fota_S.Fota_All_Data_Len%4)); //512k-32k = 480k -> 0x75300 0x78000
|
|
|
break;
|
|
@@ -115,7 +115,7 @@ void Fota_Func(UINT8 *DataPtr,INT32 connectId)
|
|
|
Fota_Answer[22] = 0x00;
|
|
|
Fota_Answer[23] = 0x12;
|
|
|
memcpy(&Fota_Answer[24],(DataPtr+24),18);
|
|
|
- Fota_Answer[42] = bcc_chk_fota(Fota_Answer,41);
|
|
|
+ Fota_Answer[42] = bcc_chk_fota(Fota_Answer,42);
|
|
|
tcpipConnectionSend(connectId,Fota_Answer,43,0,0,0);
|
|
|
break;
|
|
|
}
|
|
@@ -127,9 +127,9 @@ void Fota_Func(UINT8 *DataPtr,INT32 connectId)
|
|
|
memcpy(&Fota_Answer[4],(DataPtr+4),BATT_SN_LEN);
|
|
|
Fota_Answer[21] = TCP_ENCPT_DISABLE;
|
|
|
Fota_Answer[22] = 0x00;
|
|
|
- Fota_Answer[23] = 0x12;
|
|
|
+ Fota_Answer[23] = 0x13;
|
|
|
memcpy(&Fota_Answer[24],(DataPtr+24),18);
|
|
|
- Fota_Answer[42] = bcc_chk_fota(Fota_Answer,41);
|
|
|
+ Fota_Answer[42] = bcc_chk_fota(Fota_Answer,42);
|
|
|
tcpipConnectionSend(connectId,Fota_Answer,43,0,0,0);
|
|
|
if(Fota_S.Fota_All_Data_Len==Fota_S.Fota_Current_Addres)
|
|
|
{
|