|
@@ -160,7 +160,7 @@ int Upgrade_Flash(unsigned int Type,char *SourcePath,char *ModelName)
|
|
|
fd = open(SourcePath, O_RDONLY);
|
|
|
if(fd < 0)
|
|
|
{
|
|
|
- DEBUG_ERROR("UpdateRootfs NG - can not open rootfs\n");
|
|
|
+ DEBUG_ERROR("UpdateRootfs NG - can not open image file %s\n", SourcePath);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -671,7 +671,7 @@ int Upgrade_UART(int uartfdOrd,unsigned int Type,unsigned char TargetAddr,char *
|
|
|
fd = open(SourcePath, O_RDONLY);
|
|
|
if(fd < 0)
|
|
|
{
|
|
|
- DEBUG_ERROR("UpdateRootfs NG - can not open rootfs\n");
|
|
|
+ DEBUG_ERROR("UpdateRootfs NG - can not open image file %s\n", SourcePath);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -735,13 +735,29 @@ int Upgrade_UART(int uartfdOrd,unsigned int Type,unsigned char TargetAddr,char *
|
|
|
if(CNT_Fail>=10)
|
|
|
{
|
|
|
uart_update_abord(uartfd, TargetAddr);
|
|
|
- DEBUG_ERROR("UART upgrade retry > limits, aboard upgrade.\n");
|
|
|
- printf("UART upgrade retry > limits, aboard upgrade.\n");
|
|
|
+ DEBUG_ERROR("UART upgrade transfer retry > limits, aboard upgrade.\n");
|
|
|
}
|
|
|
- else if(uart_update_finish(uartfd, TargetAddr)==PASS)
|
|
|
+ else
|
|
|
{
|
|
|
- result = PASS;
|
|
|
- printf("UART upgrade success.\n");
|
|
|
+ do
|
|
|
+ {
|
|
|
+ if(uart_update_finish(uartfd, TargetAddr)==PASS)
|
|
|
+ break;
|
|
|
+ else
|
|
|
+ DEBUG_WARN("Upgrade finish fail, retry %d \n", ++CNT_Fail);
|
|
|
+ }while(CNT_Fail<10);
|
|
|
+
|
|
|
+ if(CNT_Fail>=10)
|
|
|
+ {
|
|
|
+ uart_update_abord(uartfd, TargetAddr);
|
|
|
+ DEBUG_ERROR("UART upgrade finish retry > limits, aboard upgrade.\n");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result = PASS;
|
|
|
+ printf("UART upgrade success.\n");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -930,7 +946,7 @@ int Upgrade_CAN(int canfd,unsigned int Type,unsigned char TargetAddr,char *Sourc
|
|
|
fd = open(SourcePath, O_RDONLY);
|
|
|
if(fd < 0)
|
|
|
{
|
|
|
- DEBUG_ERROR("UpdateRootfs NG - can not open rootfs\n");
|
|
|
+ DEBUG_ERROR("UpdateRootfs NG - can not open image file %s\n", SourcePath);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -1034,7 +1050,7 @@ int Check_CCS_image_header(unsigned int Type,char *SourcePath,char *ModelName)
|
|
|
fd = open(SourcePath, O_RDONLY);
|
|
|
if(fd < 0)
|
|
|
{
|
|
|
- DEBUG_ERROR("Update CCS NG - can not open upgrade image\n");
|
|
|
+ DEBUG_ERROR("Update CCS NG - can not open upgrade image %s\n", SourcePath);
|
|
|
return FAIL;
|
|
|
}
|
|
|
|