From 2a765a405658de35429ddbef5ee915cec647aaa3 Mon Sep 17 00:00:00 2001 From: cfif Date: Wed, 15 Apr 2026 16:28:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Src/InternalFlashPage_PFlash.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Src/InternalFlashPage_PFlash.c b/Src/InternalFlashPage_PFlash.c index ae2e4f0..5b1a09e 100644 --- a/Src/InternalFlashPage_PFlash.c +++ b/Src/InternalFlashPage_PFlash.c @@ -50,7 +50,6 @@ bool P_bInternalFlashPage_Clear( .wdTriggerFct = (void *) 0 }; - FLASHDRIVER_FlashEraseBlock(FLASH_DATA_BLOCK_SELECT0); tFlashParam.u32Address = pageAddress; tFlashParam.u32Length = FLASH_PAGE_SIZE; @@ -83,6 +82,24 @@ bool P_bInternalFlashPage_ClearRange( return false; } + FLASHDRIVER_Init(); + + FLASH_DRIVER_ParamType tFlashParam = { + .pData = NULL, + .wdTriggerFct = (void *)0, + .u32Address = firstPageAddr, + .u32Length = totalSize + }; + + FLASH_StatusType Res = FLASHDRIVER_PFlashEraseSector(&tFlashParam); + + bool result = false; + if (FLASH_ERROR_OK == Res) { + result = true; + } + + return result; + /* uint32_t endAddr = firstPageAddr + totalSize; for (; firstPageAddr < endAddr; firstPageAddr += FLASH_PAGE_SIZE) { if (!P_bInternalFlashPage_Clear(firstPageAddr)) { @@ -91,6 +108,8 @@ bool P_bInternalFlashPage_ClearRange( } return true; +*/ + } bool P_bInternalFlashPage_CopyRange(