Обновление платы на V2

This commit is contained in:
cfif 2026-05-27 16:12:32 +03:00
parent 50679e8c20
commit 3740dbb949
1 changed files with 14 additions and 7 deletions

View File

@ -1097,17 +1097,19 @@ vUDS_routine_Check_Programming_Dependancies(tCanUds *env, eUdsRoutineControlType
char *version_id_main = (char *) (ADR_HEX_BlockMain + 0x400);
int result = memcmp(version_id_main, version_id, 9);
/*
if ((env->CheckSum_BlockMain == false) || (env->CheckSum_BlockCalib == false) || (env->CheckSum_BlockMeta == false)) {
LoggerErrorStatic(LOGGER, LOG_SIGN, "At least one logical block missing");
env->dataResponse[4] = 4;
} else if (result != 0) {
return 4 + 1;
}
if (result != 0) {
LoggerErrorStatic(LOGGER, LOG_SIGN, "Software incompatibility");
env->dataResponse[4] = 3;
} else {
env->dataResponse[4] = UDS_routine_RoutineStartStopSuccess;
return 4 + 1;
}
*/
setResponseErrorPending(env, UDS_RoutineControl, UDS_error_requestCorrectlyReceived_ResponsePending);
uint32_t crc32_calc = UdsCrc32Update(0xFFFFFFFF, (uint8_t *) ADR_HEX_Mapped_BlockMain,
@ -1116,7 +1118,8 @@ vUDS_routine_Check_Programming_Dependancies(tCanUds *env, eUdsRoutineControlType
crc32_calc = UdsCrc32Finalize(crc32_calc);
memcpy(&env->data->data[1024], (uint8_t *) ADR_HEX_Mapped_BlockMeta, SIZE_HEX_BlockMeta);
(*(uint32_t *) (SIZE_HEX_BlockMeta - 4)) = crc32_calc;
uint32_t *crcFromFlash = (uint32_t *) (SIZE_HEX_BlockMeta - 4);
*crcFromFlash = crc32_calc;
result = env->clear_flash_func(ADR_HEX_Mapped_BlockMeta, SIZE_HEX_BlockMeta);
@ -1134,6 +1137,10 @@ vUDS_routine_Check_Programming_Dependancies(tCanUds *env, eUdsRoutineControlType
return 4 + 1;
}
#if (LOG_UDS == 1)
LoggerFormatInfo(LOGGER, LOG_SIGN, "Update Crc: 0x%08X", *crcFromFlash)
#endif
env->dataResponse[4] = UDS_routine_RoutineStartStopSuccess;
return 4 + 1;
@ -1492,7 +1499,7 @@ static uint16_t RequestDownload_34(tCanUds *env) {
#if (LOG_UDS == 1)
LoggerFormatInfo(LOGGER, LOG_SIGN, "RequestDownload: memoryAddress = %d memorySize = %d ", env->AdrFlash,
LoggerFormatInfo(LOGGER, LOG_SIGN, "RequestDownload: memoryAddress = %08X memorySize = %08X", env->AdrFlash,
env->DownloadFirmwareSize)
#endif