增加OTA功能

This commit is contained in:
LGM 2024-05-07 17:04:36 +08:00
parent c0566fa91b
commit ffe5d7b515
15 changed files with 4550 additions and 4507 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -5,7 +5,8 @@
#pragma anon_unions
#define PROGRAMMING_PASS_TIMEOUT_TIME 500 //5s
#define PROGRAMMING_PASS_TIMEOUT_TIME 500 //5s base:10ms
#define OTA_TIMEOUT_TIME (6) //30min base:5min
/*
INPUT_OVERVOLTAGE) \
@ -46,7 +47,7 @@ typedef struct {
uint16_t CurrDcVolt; //当前直流电压 0.1V
uint8_t ChargeTemp; //充电座温度值 °C
uint8_t BoardTemp; //板载温度值 °C
uint8_t OtaModeSts; //OTA ģʽ״̬ 0:not in ota 1:in transition ota 2:in ota
// uint8_t OtaModeSts; //OTA ģʽ״̬ 0:not in ota 1:in transition ota 2:in ota
uint8_t BusoffCnt; //busoff计数器进入busoff后每恢复一次就累加1。CAN总线正常后退出busoff就清零。
DTC_SnapshotType Snapshot;
}VehicleInfo2UdsType;
@ -66,6 +67,7 @@ typedef struct {
uint16_t InsulDetVoltVal; // 绝缘检测电压 0.1V
uint8_t DTCNum; //DTC个数
uint8_t DTCList[DTC_ID_NUM];
uint8_t OtaModeSts; //OTA ģʽ״̬ 0:not in ota 1:in transition ota 2:in ota
}UdsInfo2VehicleType;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -246,6 +246,7 @@ void GotoDefaultSession(void)
//INT8U Tmp[10];
static INT16U Timer1sCnt=0;
static INT16U Timer10msCnt=0;
// static INT16U Timer5minCnt=0;
//if(++Timer1sCnt >= 1000)
if(++Timer10msCnt >= 10) {
@ -320,15 +321,25 @@ void GotoDefaultSession(void)
}
}
if (UdsService.IsUdsFlg) {
udsInfo2Vehicle.UdsOffLine = false;
} else {
udsInfo2Vehicle.UdsOffLine = true;
udsInfo2Vehicle.OtaModeSts = 0;
#if BOOTLOADER_CODE_FLAG == 0
IO_InputOutputRelease();
#endif
}
// if (++Timer5minCnt >= 300) {
// Timer5minCnt = 0;
// if (UdsService.OtaTimeoutTimer) {
// UdsService.OtaTimeoutTimer--;
// }
// if (UdsService.OtaTimeoutTimer == 0) {
// udsInfo2Vehicle.OtaModeSts = 0;
// }
// }
}
return;

View File

@ -166,10 +166,13 @@ typedef struct{
uint16_t IoDid;
uint16_t Nrc78Timer;
uint16_t ProgrammingPassTimer;
// uint8_t OtaTimeoutTimer; //5min
}__UDSService;
typedef struct {
uint8_t SA_FailureCounter;
// uint8_t OtaModeSts;
// uint8_t OtaTimeoutTimer; //5min
uint8_t resever[7];
uint8_t crc16[2];
}UDS_ParameterType;

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1259,7 +1259,7 @@
<Group>
<GroupName>Sleep</GroupName>
<tvExp>0</tvExp>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>