Browse Source

2021-12-14 / Eason Yang
Action:
1. Added : Default Maintain Server URL -> wss://ocpp.phihong.com.tw:2013/.
2. Added : CCS alarm code. ALARM_QCA_FLASH_FAIL 0x80000000.
3. Added : CCS alarm detection logic.
4. Added : Handshake countdown logic, when the system is preparing mode.
5. Added : CCS detection only once.
6. Added : Wake up logic for socket e typ plug-in.
7. Improve : When the system change to reservation mode and display logic.

File:
1. main.c & main.h
Action 2
Action 4
Action 6

2. Module_AlarmDetect.c
Action 3
Action 5

3. Module_FactoryConfig.c
Action 1

4. Module_LcmContorl.c
Action 7

LCM SOFTWARE VERSION: V0.24
LCM USER INTERFACE VERSION: REV.02.00
FIRMWARE VERSION: B0.58.XX.XXXX.PX

8009 3 years ago
parent
commit
1106803b43

+ 37 - 25
EVSE/Projects/AW-CCS/Apps/LCM/Module_LcmControl.c

@@ -2,9 +2,9 @@
  * Module_LcmControl.c
  *
  * Created on : 2020-10-20
- * Update on : 2021-12-06
+ * Update on : 2021-12-14
  * Author : Folus Wen, Eason Yang
- * Version : V0.23
+ * Version : V0.24
  *
  */
 
@@ -55,12 +55,12 @@ void setWarningStatus(uint8_t gun_index);
 void setQRCodeReceipt(uint8_t gun_index);
 void setCurrencyFromWebsite(uint8_t unit);
 void setPriceFromWebsite(float monry_rate);
-void setPlugAndChargeAnim(uint8_t gun_index);
 void setAuthorizationPage(uint8_t gun_index);
 float getPresentFinalCost(uint8_t gun_index);
 void setGunPluginAnimation(uint8_t gun_index);
 void setPresentChargedEnergy(uint8_t gun_index);
 void setPresentChargedgPower(uint8_t gun_index);
+void setPlugAndChargeAnimation(uint8_t gun_index);
 void setPresentChargedDuration(uint8_t gun_index);
 void setPresentPowerConsumption(uint8_t gun_index);
 void setFinalCost(uint8_t gun_index, uint8_t type);
@@ -113,7 +113,7 @@ int Uart1Fd;
 //=======================================
 // Record version and date
 //=======================================
-char *FIRMWARE_UPDATE_IMAGE[3] = {"V0.23", "2021-12-06", "REV.02.00"};
+char *FIRMWARE_UPDATE_IMAGE[3] = {"V0.24", "2021-12-14", "REV.02.00"};
 
 //=======================================
 // Common routine
@@ -334,7 +334,7 @@ void page_idle(uint8_t gun_index, uint8_t system_mode)
 					}
 					else
 					{
-						setPlugAndChargeAnim(gun_index);
+						setPlugAndChargeAnimation(gun_index);
 					}
 				}
 				else
@@ -1327,9 +1327,11 @@ void setFinalCost(uint8_t gun_index, uint8_t type)
 				}
 				else
 				{
-					// DISAPPEAR COST ICON AND COST TEXT
-					setDisplayValue(ICON_CHARGING_COST, DISAPPEAR);
-					setDisplayValue(TEXT_CHARGING_COST, DISAPPEAR);
+					setDisplayValue(ICON_CHARGING_COST, APPEAR);
+
+					strcpy((char*)cost_empty, "-----");
+					string2ByteArray(cost_empty, output_data);
+					lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_COST, output_data, ARRAY_SIZE(output_data));
 				}
 			}
 			break;
@@ -1342,7 +1344,6 @@ void setFinalCost(uint8_t gun_index, uint8_t type)
 				string2ByteArray(balance_empty, output_data);
 
 				lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_REMAINING_ACCOUNT_BALANCE, output_data, ARRAY_SIZE(output_data));
-				lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_USER_ACCOUNT_BALANCE, output_data, ARRAY_SIZE(output_data));
 			}
 			else
 			{
@@ -1359,16 +1360,15 @@ void setFinalCost(uint8_t gun_index, uint8_t type)
 					trim_string(input_data,length);
 					memcpy(output_data ,input_data, strlen(input_data));
 					lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_REMAINING_ACCOUNT_BALANCE, output_data, ARRAY_SIZE(output_data));
-					lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_USER_ACCOUNT_BALANCE, output_data, ARRAY_SIZE(output_data));
 				}
 				else
-				{
-					/*
-					 * 1. DISAPPEAR ACCOUNT BALANCE WHEN THE SYSTEM IS COMPLETE MODE
-					 * 2. DISAPPEAR ACCOUNT ICON WHEN THE SYSTEM IS COMPLETE MODE
-					 */
-					setDisplayValue(ICON_COMPLETE_WALLET, DISAPPEAR);
-					setDisplayValue(TEXT_REMAINING_ACCOUNT_BALANCE, DISAPPEAR);
+				{	
+					setDisplayValue(ICON_COMPLETE_WALLET, APPEAR);
+
+					strcpy((char*)balance_empty, "-----");
+					string2ByteArray(balance_empty, output_data);
+
+					lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_REMAINING_ACCOUNT_BALANCE, output_data, ARRAY_SIZE(output_data));
 				}
 			}
 			break;
@@ -1430,9 +1430,11 @@ void setRunningCost(uint8_t gun_index, uint8_t type)
 				}
 				else
 				{
-					// DISAPPEAR COST ICON AND COST TEXT
-					setDisplayValue(ICON_CHARGING_COST, DISAPPEAR);
-					setDisplayValue(TEXT_CHARGING_COST, DISAPPEAR);
+					setDisplayValue(ICON_CHARGING_COST, APPEAR);
+
+					strcpy((char*)cost_empty, "-----");
+					string2ByteArray(cost_empty, output_data);
+					lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_CHARGING_COST, output_data, ARRAY_SIZE(output_data));
 				}
 			}
 
@@ -1857,7 +1859,7 @@ void setGunPluginAnimation(uint8_t gun_index)
 //=======================================
 // Setting [ Plug & Charge ] Animation
 //=======================================
-void setPlugAndChargeAnim(uint8_t gun_index)
+void setPlugAndChargeAnimation(uint8_t gun_index)
 {
 	if((GUN_PLUGING_LEVEL_STATUS == GUN_PLUGING_LEVEL_0) && (DiffTimebWithNow(startTime[gun_index][TMR_IDX_PLUGIN]) > (TIME_ANIMATION_PLUGIN)))
 	{
@@ -1884,6 +1886,7 @@ void setPresentConnectionTimeout(uint8_t gun_index)
 
 	memset(data, 0x00, ARRAY_SIZE(data));
 	memset(conntectionTimeout, 0x00, ARRAY_SIZE(conntectionTimeout));
+	memset(not_counting, 0x00, ARRAY_SIZE(not_counting));
 
 	if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_B) ||
 	   (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C) ||
@@ -1896,9 +1899,18 @@ void setPresentConnectionTimeout(uint8_t gun_index)
 	else
 	{
 		time = ShmCharger->timeoutSpec.Handshake_Timeout;
-		sprintf((char *)conntectionTimeout, "%03d ", time);
-		string2ByteArray(conntectionTimeout, data);
-		lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PREPARING_CONNECTION_TIMER, data, ARRAY_SIZE(data));
+		if(time <= 0)
+		{
+			strcpy((char*)not_counting, "000");
+			string2ByteArray(not_counting, data);
+			lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PREPARING_CONNECTION_TIMER, data, ARRAY_SIZE(data));
+		}
+		else
+		{
+			sprintf((char *)conntectionTimeout, "%03d ", time);
+			string2ByteArray(conntectionTimeout, data);
+			lcdRegisterWrite(Uart1Fd, REG_TYPE_RAM, TEXT_PREPARING_CONNECTION_TIMER, data, ARRAY_SIZE(data));
+		}
 	}
 }
 
@@ -2581,7 +2593,7 @@ int main(void)
 					page_authorizing(ShmCharger->gun_selectd);
 					ShmCharger->gun_info[ShmCharger->gun_selectd].isHandshakeTimerRefresh = YES;
 				}
-				else if((ShmSysConfigAndInfo->SysInfo.AcChargingData[ShmCharger->gun_selectd].SystemStatus == SYS_MODE_IDLE) && (ShmCharger->gun_info[ShmCharger->gun_selectd].resultAuthorization == VALIDATED_RFID))
+				else if(((ShmSysConfigAndInfo->SysInfo.AcChargingData[ShmCharger->gun_selectd].SystemStatus == SYS_MODE_IDLE) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[ShmCharger->gun_selectd].SystemStatus == SYS_MODE_RESERVATION)) && (ShmCharger->gun_info[ShmCharger->gun_selectd].resultAuthorization == VALIDATED_RFID))
 				{
 					page_preparing(ShmCharger->gun_selectd, ShmSysConfigAndInfo->SysInfo.AcChargingData[ShmCharger->gun_selectd].SystemStatus);
 					ShmCharger->gun_info[ShmCharger->gun_selectd].isHandshakeTimerRefresh = NO;

+ 2 - 2
EVSE/Projects/AW-CCS/Apps/LCM/lcmComm_dgus.c

@@ -2,9 +2,9 @@
  * lcmComm_dgus.c
  *
  * Created on : 2020-10-20
- * Update on : 2021-06-23
+ * Update on : 2021-12-14
  * Author : Folus Wen, Eason Yang
- * Version : D0.01
+ * Version : V0.24
  *
  */
 

+ 2 - 2
EVSE/Projects/AW-CCS/Apps/LCM/lcmComm_dgus.h

@@ -2,9 +2,9 @@
  * lcmComm_dwin.h
  *
  * Created on : 2020-10-20
- * Update on : 2021-06-23
+ * Update on : 2021-12-14
  * Author : Folus Wen, Eason Yang
- * Version : D0.01
+ * Version : V0.24
  *
  */
 

+ 79 - 0
EVSE/Projects/AW-CCS/Apps/Module_AlarmDetect.c

@@ -264,11 +264,31 @@ void getNowDatetime(uint8_t *data)
 	sprintf((char*)data, "%04d-%02d-%02dT%02d:%02d:%02dZ", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
 }
 
+int qca7000FlashCheck()
+{
+	int result = FAIL;
+	char buf[256];
+	FILE *fp;
+
+	fp = popen("/usr/bin/plcID", "r");
+	if(fp != NULL)
+	{
+		while(fgets(buf, sizeof(buf), fp) != NULL)
+		{
+			if(strlen(buf) >= 10)result = PASS;
+		}
+	}
+	pclose(fp);
+
+	return result;
+}
+
 //==========================================
 // Main process
 //==========================================
 int main(void)
 {
+	uint8_t isCheckQca7000[AC_QUANTITY] = {0};
 
 	if(InitShareMemory() == FAIL)
 	{
@@ -1071,6 +1091,35 @@ int main(void)
 				}
 			}
 
+			//=====================================
+			// QCA7000 flash content check
+			//=====================================
+			if((((gun_index == 0) && (ShmSysConfigAndInfo->SysConfig.ModelName[9] == '7')) ||
+			    ((gun_index == 1) && (ShmSysConfigAndInfo->SysConfig.ModelName[8] == '7')) ||
+			    ((gun_index == 2) && (ShmSysConfigAndInfo->SysConfig.ModelName[7] == '7'))) && !isCheckQca7000[gun_index])
+			{
+				if(qca7000FlashCheck() == FAIL)
+				{
+					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail == OFF)
+					{
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail = ON;
+						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode |= ALARM_QCA_FLASH_FAIL;
+						DEBUG_INFO("ALARM_QCA_FLASH_FAIL : alarm \n");
+					}
+				}
+				else
+				{
+					if(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail == ON)
+					{
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail = OFF;
+						ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode &= ~ALARM_QCA_FLASH_FAIL;
+						DEBUG_INFO("ALARM_QCA_FLASH_FAIL : recover \n");
+					}
+				}
+
+				isCheckQca7000[gun_index] = TRUE;
+			}
+
 			//=====================================
 			// OCPP error code message
 			//=====================================
@@ -1240,6 +1289,12 @@ int main(void)
 					sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "012345");
 					sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].Info , "PilotNegativeError");
 				}
+				else if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_QCA_FLASH_FAIL)
+				{
+					sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "OtherError");
+					sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].VendorErrorCode , "012284");
+					sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].Info , "QCA Self test Failed");
+				}
 				else
 				{
 					sprintf((char*)ShmOCPP16Data->StatusNotification[gun_index].ErrorCode , "NoError");
@@ -1985,6 +2040,30 @@ int main(void)
 						previousAlarmCode[gun_index] &= ~ALARM_CP_NEG_ERROR;
 				}
 
+				if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_QCA_FLASH_FAIL) != (previousAlarmCode[gun_index] & ALARM_QCA_FLASH_FAIL))
+				{
+					getNowDatetime(ShmOCPP20Data->NotifyEvent.eventData[idxEvent].timestamp);
+					ShmOCPP20Data->NotifyEvent.eventData[idxEvent].eventId = idxEvent;
+					sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].trigger, "Alerting");
+					sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].actualValue, ((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_CP_NEG_ERROR)?"true":"false"));
+					ShmOCPP20Data->NotifyEvent.eventData[idxEvent].cleared = ((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_CP_NEG_ERROR)?OFF:ON);
+					sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].eventNotificationType, "HardWiredNotification");
+
+					sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].techcode, "012284");
+					sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].techInfo, "QCA Self test Failed");
+
+					sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].component.name, "PCBA");
+					ShmOCPP20Data->NotifyEvent.eventData[idxEvent].component.evse.connectorId = (gun_index+1);
+					sprintf((char*)ShmOCPP20Data->NotifyEvent.eventData[idxEvent].variable.name, "Problem");
+
+					idxEvent += ((idxEvent<ARRAY_SIZE(ShmOCPP20Data->NotifyEvent.eventData)-1)?1:0);
+
+					if(ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode & ALARM_QCA_FLASH_FAIL)
+						previousAlarmCode[gun_index] |= ALARM_QCA_FLASH_FAIL;
+					else
+						previousAlarmCode[gun_index] &= ~ALARM_QCA_FLASH_FAIL;
+				}
+
 				if(idxEvent > 0)
 					ShmOCPP20Data->SpMsg.bits.NotifyEventReq = ON;
 			}

+ 3 - 1
EVSE/Projects/AW-CCS/Apps/Module_FactoryConfig.c

@@ -324,6 +324,7 @@ int main(int argc, char *argv[])
 	strcpy((char*)SysConfig.OcppServerURL, "");
 	sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
 	strcpy((char *)SysConfig.chargePointVendor, "");	// default: Null
+	strcpy((char*)SysConfig.MaintainServerURL, "");
 	SysConfig.BackendConnTimeout=300; 		// 300 seconds
 	SysConfig.OfflinePolicy = 2;			// 0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
 	SysConfig.OfflineMaxChargeEnergy = 0;	// 0: Same as MaxChargeEnergy	Other: 1~65535KWH
@@ -331,11 +332,12 @@ int main(int argc, char *argv[])
 	SysConfig.isReqFirstUpgrade = 1;		// 0: Skip first upgrade, 	1: Process first upgrade
 
 	// Customization configuration item
-	if(strstr((char*)&SysConfig.ModelName[12], "P0") != NULL)
+	if(SysConfig.ModelName[12] == 'P')
 	{
 		strcpy((char*)SysConfig.OcppServerURL, "");
 		sprintf((char*)SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
 		strcpy((char *)SysConfig.chargePointVendor, "");
+		strcpy((char*)SysConfig.MaintainServerURL, "wss://ocpp.phihong.com.tw:2013/");
 	}
 	else
 	{

+ 17 - 12
EVSE/Projects/AW-CCS/Apps/main.c

@@ -2882,7 +2882,7 @@ void get_firmware_version(unsigned char gun_index)
 	strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
 
 	// Get CSU root file system version
-	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.57.00.0000.00");
+	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.58.00.0000.00");
 
 	// Get AC connector type from model name
 	for(uint8_t idx=0;idx<3;idx++)
@@ -4004,14 +4004,14 @@ void checkReset()
 				if(strcmp((char*)ShmOCPP16Data->Reset.Type, "Hard") == 0)
 				{
 					system("sync");
-					sleep(5);
+					sleep(10);
 					system("reboot -f");
-					sleep(5);
+					sleep(10);
 					system("reboot -f");
 				}
 				else
 				{
-					sleep(5);
+					sleep(10);
 					close(wtdFd);
 					system("/usr/bin/run_evse_restart.sh");
 				}
@@ -4035,14 +4035,14 @@ void checkReset()
 				if(strcmp((char*)ShmOCPP20Data->Reset.type, "Immediate") == 0)
 				{
 					system("sync");
-					sleep(5);
+					sleep(10);
 					system("reboot -f");
-					sleep(5);
+					sleep(10);
 					system("reboot -f");
 				}
 				else
 				{
-					sleep(5);
+					sleep(10);
 					close(wtdFd);
 					system("/usr/bin/run_evse_restart.sh");
 				}
@@ -4931,7 +4931,7 @@ int main(void)
 			 *	TODO:
 			 *	1. Power saving logic
 			 */
-			if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)
+			if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A) || (ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn == OFF))
 			{
 				ftime(&startTime[gun_index][TMR_IDX_POWERSAVING_STATE_B]);
 			}
@@ -4951,11 +4951,12 @@ int main(void)
 			}
 			else
 			{
-				if((gpio_get_value(GPIO_IN_WAKEUP) == OFF) ||
+				if((ShmCharger->gun_info[ShmCharger->gun_selectd].isHandshakeTimerRefresh == YES) ||
+				   (gpio_get_value(GPIO_IN_WAKEUP) == OFF) ||
 				   (ShmCharger->gun_info[gun_index].GPIO_Input.Button_Mode_Switch == ON) ||
 				   (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus != ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus) ||
 				   (((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_IDLE) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_PREPARING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus == SYS_MODE_RESERVATION)) &&
-					(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_B) &&
+					((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_B) || (ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn == ON)) && 
 					(DiffTimebWithNow(startTime[gun_index][TMR_IDX_POWERSAVING_STATE_B]) < 10000)))
 				{
 					ftime(&startTime[gun_index][TMR_IDX_POWERSAVING_LCD]);
@@ -5089,7 +5090,7 @@ int main(void)
 			if(ShmSysConfigAndInfo->SysInfo.AcChargingData[0].SystemStatus != SYS_MODE_BOOTING)
 			{
 				// Alarm event check
-				if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0))
+				if((ShmCharger->gun_info[gun_index].primaryMcuAlarm.InputAlarmCode>0) || ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail)
 				{
 					if(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].SystemStatus != SYS_MODE_ALARM)
 					{
@@ -5789,6 +5790,8 @@ int main(void)
 						ShmCharger->gun_info[gun_index].rfidReq = OFF;
 					}
 					
+					ShmCharger->timeoutSpec.Handshake_Timeout = ((ocpp_get_connection_timeout()) - (DiffTimebWithNow(startTime[gun_index][TMR_IDX_HANDSHAKING])/1000));
+
 					if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_HANDSHAKING]) > ShmCharger->timeoutSpec.Present_Timeout_Spec)
 					{
 						setLedMotion(gun_index, LED_ACTION_HANDSHAKE_FAIL);
@@ -6050,6 +6053,8 @@ int main(void)
 
 						getDateTimeString((char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StopDateTime);
 						ShmCharger->gun_info[gun_index].resultAuthorization = DEFAULT_RFID;
+						
+						sleep(3);
 					}
 
 					ftime(&endChargingTime[gun_index]);
@@ -6200,7 +6205,7 @@ int main(void)
 					setLedMotion(gun_index,LED_ACTION_ALARM);
 					setRelay(gun_index, OFF);
 
-					if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode == 0))
+					if((ShmCharger->gun_info[gun_index].systemAlarmCode.SystemAlarmCode == 0) && !ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CCSboardStestFail)
 					{
 						if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus == SYS_MODE_CHARGING) ||
 						   (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PreviousSystemStatus == SYS_MODE_TERMINATING))

+ 1 - 0
EVSE/Projects/AW-CCS/Apps/main.h

@@ -78,6 +78,7 @@
 #define ALARM_METER_TIMEOUT						0x10000000
 #define ALARM_METER_IC_TIMEOUT					0x20000000
 #define ALARM_CP_NEG_ERROR 						0x40000000
+#define ALARM_QCA_FLASH_FAIL					0x80000000
 
 //=================================
 //CCS related define