From 41f087b7183a5730e46b7eaa322b6852d602babf Mon Sep 17 00:00:00 2001
From: tao_z <tzj0429@163.com>
Date: Tue, 31 May 2022 01:04:15 +0800
Subject: [PATCH] 调试更新,非完全体

---
 Application/source/uds_modules/uds.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Application/source/uds_modules/uds.c b/Application/source/uds_modules/uds.c
index 7f1040c..f65d787 100644
--- a/Application/source/uds_modules/uds.c
+++ b/Application/source/uds_modules/uds.c
@@ -1773,11 +1773,15 @@
                 if (transferType == DOWNLOAD_FLASH)
                 {
                     UDS_L_CRCCheckFail_b = !MEM_PartitionCRCOK((uint8_t)MEM_PARTITION_CODEFLASH);
+                    if (UDS_L_CRCCheckFail_b == false)
+                    {
+                        NVM_ReInitFlashDriveRam(); // CLEAR FLASH DRIVE IN RAM
+                    }
                 }
                 else
                 {
                     UDS_L_CRCCheckFail_b = !MEM_PartitionCRCOK((uint8_t)MEM_PARTITION_RAM);
-                    if (UDS_L_CRCCheckFail_b == false)
+                    if (UDS_L_CRCCheckFail_b == true)
                     {
                         NVM_ReInitFlashDriveRam(); // CLEAR FLASH DRIVE IN RAM
                     }
@@ -1914,7 +1918,7 @@
         UDS_L_tx_msg_buffer[1] = 0x01;
         UDS_L_tx_msg_buffer[2] = 0xff;
         UDS_L_tx_msg_buffer[3] = 0x00;
-        UDS_L_tx_msg_buffer[4] = (uint8_t) true;
+        UDS_L_tx_msg_buffer[4] = 0; // 0:ok 1��error
         /* Specify the send payload size */
         UDS_L_tx_msg_size = 5;
         UDS_RespTxMessage();
@@ -2184,6 +2188,7 @@
     operation_write.current_sequenc = expectedSequenceCnt;
     operation_write.prev_seqence = currentSequenceCnt;
 
+    UDS_SendNegResp(NRC_SERVICE_BUSY);              // first send busy
     write_result = NEM_WriteData(&operation_write); // todo write all data at this function
     if (write_result == OP_STATUS_OK)
     {

--
Gitblit v1.8.0