|
@@ -181,8 +181,21 @@ void Fota_Func(UINT8 *DataPtr,INT32 connectId)
|
|
|
{
|
|
|
Fota_S.Fota_Recv_Data_Len = Fota_S.Fota_Recv_Data_Len + 4-(Fota_S.Fota_Recv_Data_Len%4);
|
|
|
}
|
|
|
- ret = BSP_QSPI_Write_Safe(Fota_S.Fota_Recv_Data,Fota_S.Fota_Flash_Addres+Fota_S.Fota_Current_Addres,Fota_S.Fota_Recv_Data_Len);
|
|
|
- if(ret==QSPI_OK)
|
|
|
+ BSP_QSPI_Write_Safe(Fota_S.Fota_Recv_Data,Fota_S.Fota_Flash_Addres+Fota_S.Fota_Current_Addres,Fota_S.Fota_Recv_Data_Len);
|
|
|
+ Data_Read_Buffer = malloc(Fota_S.Fota_Recv_Data_Len);
|
|
|
+ BSP_QSPI_Read_Safe(Data_Read_Buffer,Fota_S.Fota_Flash_Addres+Fota_S.Fota_Current_Addres,Fota_S.Fota_Recv_Data_Len);
|
|
|
+ Data_Read_Crc = Fota_crc_chk(Data_Read_Buffer,Fota_S.Fota_Recv_Data_Len);
|
|
|
+ #ifdef USING_PRINTF
|
|
|
+ printf("\n\n\n");
|
|
|
+ UINT8 temp[1];
|
|
|
+ for(int i=0;i<Fota_S.Fota_Recv_Data_Len;i++)
|
|
|
+ {
|
|
|
+ printf("%x ",*(Data_Read_Buffer+i));
|
|
|
+ }
|
|
|
+ printf("\n\n\n");
|
|
|
+ #endif
|
|
|
+ free(Data_Read_Buffer);
|
|
|
+ if(Data_Read_Crc==Fota_S.Fota_CRC )
|
|
|
{
|
|
|
Fota_Answer[3] = 0x01;
|
|
|
}
|