Browse Source

版本号1.2.1.25,4830软件,Fota更新测试,更改了Fota和BMS升级回复逻辑,同时和1.2.1.24测试Ota升级

CHENJIE-PC\QiXiang_CHENJIE 3 years ago
parent
commit
7aaeb9a9f6
2 changed files with 16 additions and 3 deletions
  1. 1 1
      inc/app.h
  2. 15 2
      src/Fota.c

+ 1 - 1
inc/app.h

@@ -34,7 +34,7 @@ extern "C" {
 #define HWVERSION		    0x0102    //硬件主版本,现为V1.2板
 #define	BLSWVERSION		0x01020000    //BootLoader版本号V1.2.0.0
 #define	DRVSWVERSION		0x01040000     //驱动层版本号V1.4.0.0
-#define	APPSWVERSION		0x01020118     
+#define	APPSWVERSION		0x01020119     
 
 //--------------------------------------------------------------------------------
 

+ 15 - 2
src/Fota.c

@@ -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;
                     }