Обновление

This commit is contained in:
cfif 2026-04-15 16:28:57 +03:00
parent 4ec19cd2d8
commit 7427ed704d
1 changed files with 13 additions and 1 deletions

View File

@ -11,6 +11,7 @@
#include "SystemDelayInterface.h" #include "SystemDelayInterface.h"
#include "candb.h" #include "candb.h"
#include "stdio.h" #include "stdio.h"
#include "fc7xxx_driver_flash.h"
#define LOG_SIGN "CAN_UDS" #define LOG_SIGN "CAN_UDS"
#define LOGGER env->logger #define LOGGER env->logger
@ -953,6 +954,8 @@ static uint16_t vUDS_routine_Compare_Checksum(tCanUds *env, eUdsRoutineControlTy
return 4 + 1; return 4 + 1;
} }
uint8_t zzz[2048];
static uint16_t vUDS_routine_Erase_Memory(tCanUds *env, eUdsRoutineControlType udsRoutineControlType) { static uint16_t vUDS_routine_Erase_Memory(tCanUds *env, eUdsRoutineControlType udsRoutineControlType) {
eUdsRoutineStartStopRoutineResult udsStartStopRoutineResult = UDS_routine_RoutineStartStopSuccess; eUdsRoutineStartStopRoutineResult udsStartStopRoutineResult = UDS_routine_RoutineStartStopSuccess;
@ -960,7 +963,16 @@ static uint16_t vUDS_routine_Erase_Memory(tCanUds *env, eUdsRoutineControlType u
if ((udsRoutineControlType == UDS_routine_StartRoutine) || (udsRoutineControlType == UDS_routine_StopRoutine)) { if ((udsRoutineControlType == UDS_routine_StartRoutine) || (udsRoutineControlType == UDS_routine_StopRoutine)) {
bool result = env->clear_flash_func(0x01010000, 1 * 2048); bool result = env->clear_flash_func(0x01100000, 512 * 1024);
// bool result = FLASHDRIVER_FlashEraseBlock(FLASH_BLOCK_SELECT1);
uint32_t adr = 0x01100000;
for (uint32_t i = 0; i < 256; ++i) {
env->write_flash_func(adr, zzz, 2048);
adr += 2048;
}
if (result) { if (result) {
env->dataResponse[4] = UDS_routine_RoutineStartStopSuccess; env->dataResponse[4] = UDS_routine_RoutineStartStopSuccess;