Skip to content

Commit 02738b7

Browse files
author
Rohit Grover
committed
Add a separate error code for runtime/intergrity-check failures
1 parent 8396aaf commit 02738b7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

hal/hal/storage_abstraction/Driver_Storage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ extern "C" {
4242
#define ARM_STORAGE_ERROR_NOT_ERASABLE (ARM_DRIVER_ERROR_SPECIFIC - 1) ///< Part (or all) of the range provided to Erase() isn't erasable.
4343
#define ARM_STORAGE_ERROR_NOT_PROGRAMMABLE (ARM_DRIVER_ERROR_SPECIFIC - 2) ///< Part (or all) of the range provided to ProgramData() isn't programmable.
4444
#define ARM_STORAGE_ERROR_PROTECTED (ARM_DRIVER_ERROR_SPECIFIC - 3) ///< Part (or all) of the range to Erase() or ProgramData() is protected.
45+
#define ARM_STORAGE_ERROR_RUNTIME_OR_INTEGRITY_FAILURE (ARM_DRIVER_ERROR_SPECIFIC - 4) ///< Runtime or sanity-check failure.
4546

4647
/**
4748
* \brief Attributes of the storage range within a storage block.

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_K64F/storage_driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ static int32_t executeCommand(struct mtd_k64f_data *context)
591591
return ARM_DRIVER_ERROR_PARAMETER;
592592
}
593593
if (failedWithRunTimeError()) {
594-
return ARM_DRIVER_ERROR; /* unspecified runtime error. */
594+
return ARM_STORAGE_ERROR_RUNTIME_OR_INTEGRITY_FAILURE;
595595
}
596596

597597
/* signal synchronous completion. */
@@ -638,7 +638,7 @@ static void ftfe_ccie_irq_handler(void)
638638
}
639639
if (failedWithRunTimeError()) {
640640
if (context->commandCompletionCallback) {
641-
context->commandCompletionCallback(ARM_DRIVER_ERROR, context->currentCommand);
641+
context->commandCompletionCallback(ARM_STORAGE_ERROR_RUNTIME_OR_INTEGRITY_FAILURE, context->currentCommand);
642642
}
643643
return;
644644
}

0 commit comments

Comments
 (0)