![]() |
FuSa 8-Bit Libraries Safety Framework
|
Contains API prototypes for the Memory Manager. More...
Files | |
| file | midware_memory_manager.c |
| Implements APIs for the Memory Manager. | |
| file | midware_memory_manager_diag.c |
| Implements APIs for the Memory Manager Diagnostic. | |
| file | midware_memory_manager_diag.h |
| Contains API prototypes for the Memory Manager Diagnostics. | |
| file | midware_memory_manager_diag_asm.h |
| Contains assembly APIs for the Memory Manager Diagnostics. | |
Enumerations | |
| enum | persistentFlag_t { PFLAG_ERRINJ_ONGOING , PFLAG_CPU_INJ_FAULT , PFLAG_WDT_INJ_FAULT , PFLAG_SWDT_INJ_FAULT , PFLAG_IO_FLOAT_FAULT , PFLAG_MAX } |
| Enum for persistent flags used to store data between non-POR/BOR device resets. More... | |
| enum | persistentVal_t { PVAL_ERRID_REASON , PVAL_RESET_REASON , PVAL_ERRINJ_REASON , PVAL_MAX } |
| Enum for persistent values used to store data between non-POR/BOR device resets. More... | |
| enum | eccAllOnes_t { ECC_ALL_ONES_NONE = 0U , ECC_ALL_ONES_ALL , ECC_ALL_ONES_DATA1 , ECC_ALL_ONES_DATA2 , ECC_ALL_ONES_MAX } |
| Type defines for available "ECC all ones" (ECCALL1) options. More... | |
Functions | |
| errFlag_t | MW_GetClearBusError (void) |
| Reads and clears the flag indicating an error in the Bus Matrix. | |
| errFlag_t | MW_GetClearCpuDataParityError (void) |
| Reads and clears the flag indicating a data bus parity error in the CPU. | |
| errFlag_t | MW_GetClearCpuInstrParityError (void) |
| Reads and clears the flag indicating a instruction bus parity error in the CPU. | |
| errFlag_t | MW_GetClearCpuOpcodeError (void) |
| Reads and clears the flag indicating an illegal opcode error in the CPU. | |
| errFlag_t | MW_GetClearRamStackError (void) |
| Reads and clears the flag indicating a stack pointer limit error in SRAM. | |
| errFlag_t | MW_GetClearRamEccCompError (void) |
| Reads and clears the flag indicating a ECC comparator error in the RAM controller. | |
| errFlag_t | MW_GetClearRamEcc1Error (void) |
| Reads and clears the flag indicating an ECC single-bit error in SRAM. | |
| errFlag_t | MW_GetClearRamEcc2Error (void) |
| Reads and clears the flag indicating an ECC multi-bit error in SRAM. | |
| errFlag_t | MW_GetClearRamParityError (void) |
| Reads and clears the flag indicating a bus parity error detected in the RAM controller. | |
| errFlag_t | MW_GetClearNvmEccCompError (void) |
| Reads and clears the flag indicating a ECC comparator error in the NVM controller. | |
| errFlag_t | MW_GetClearNvmFlashEcc1Error (void) |
| Reads and clears the flag indicating a ECC single-bit error in Flash. | |
| errFlag_t | MW_GetClearNvmFlashEcc2Error (void) |
| Reads and clears the flag indicating a ECC multi-bit error in Flash. | |
| errFlag_t | MW_GetClearNvmParityError (void) |
| Reads and clears the flag indicating a bus parity error detected in the NVM controller. | |
| errFlag_t | MW_GetClearNvmEepromEcc1Error (void) |
| Reads and clears the flag indicating an ECC single-bit error in EEPROM. | |
| errFlag_t | MW_GetClearNvmEepromEcc2Error (void) |
| Reads and clears the flag indicating an ECC multi-bit error in EEPROM. | |
| errFlag_t | MW_SetNvmEccAllOnes (eccAllOnes_t config) |
| Sets ECC all Ones (ECCALL1) scheme. | |
| errFlag_t | MW_SetRamStackLimit (uint16_t splimAddr, bool lockEnable) |
| Sets the Stack Pointer Limit value and optionally locks the value to prevent modification. | |
| void | MW_StorePersistentFlag (persistentFlag_t flagType, bool flag) |
| Stores two redundant boolean flags in General Purpose Registers (GPR) for perserving data between resets. | |
| void | MW_StorePersistentVal (persistentVal_t valueType, uint8_t value) |
| Stores a value in General Purpose Registers (GPR) for perserving data between resets. | |
| bool | MW_GetPersistentFlag (persistentFlag_t flagType) |
| Reads two redundant bits for each boolean flags in General Purpose Registers (GPR) that is stored for preserving data between resets. | |
| uint8_t | MW_GetPersistentVal (persistentVal_t valueType) |
| Reads a value in General Purpose Registers (GPR) that is stored for preserving data between resets. | |
| bool | MW_IsPersistentFlagsCorrupt (void) |
| Compares two redundant bits for each boolean flags in General Purpose Registers (GPR) and checks if any of the flags are corrupted. | |
| bool | MW_IsPersistentValsCorrupt (void) |
| Checks if any of the stored persistent values are corrupted. | |
| void | MW_ClearPersistentFlags (void) |
| Clears all stored persistent flags in GPR. | |
| void | MW_ClearPersistentVals (void) |
| Clears all stored persistent values in GPR. | |
| errFlag_t | MW_DiagRamParity (void) |
| This function performs error injection diagnostic to detect faults in the RAM parity checker triggered by RAM access. | |
| errFlag_t | MW_DiagNvmParity (void) |
| This function performs error injection diagnostic to detect faults in the CPU and NVM bus parity checkers triggered by NVM access. | |
| errFlag_t | MW_DiagRamEcc (void) |
| This function performs error injection diagnostic to detect faults in the redundant RAMCTRL ECC checkers. | |
| errFlag_t | MW_DiagNvmFlashEcc (void) |
| This function performs error injection diagnostic to detect faults in the NVMCTRL ECC checkers with Flash read trigger. | |
| errFlag_t | MW_DiagNvmEepromEcc (void) |
| This function performs error injection diagnostic to detect faults in the NVMCTRL ECC checkers with EEPROM read trigger. | |
| void | ASM_InjectCpuDataParityRam (void) |
| This function makes the CPU inject a parity error in the data of the following RAM write, which is detected by the RAM Data Parity Checker. | |
| void | ASM_InjectCpuAddressParityRam (void) |
| This function makes the CPU inject a parity error in the address of the following RAM read, which is detected by the RAM address Parity Checker. | |
| void | ASM_InjectCpuControlParityRam (void) |
| This function makes the CPU inject a parity error in the control of the following RAM read, which is detected by the RAM control Parity Checker. | |
| void | ASM_InjectNvmDataParity (uint8_t *flashDiagAddr) |
| This function makes the NVMCTRL inject a parity error in the data of the following NVM (Flash) read, which is detected by the CPU data Parity Checker. | |
| void | ASM_InjectNvmInstructionParity (void) |
| This function makes the NVMCTRL inject a parity error in the instruction of the following NVM fetch, which is detected by the CPU instruction Parity Checker. | |
| void | ASM_InjectCpuDataParityNvm (uint8_t *eepromDiagAddr) |
| This function makes the CPU inject a parity error in the data of the following NVM (EEPROM) write, which is detected by the NVM control Parity Checker. | |
| void | ASM_InjectCpuAddressParityNvm (uint8_t *flashDiagAddr) |
| This function makes the CPU inject a parity error in the address of the following NVM (Flash) read, which is detected by the NVM address Parity Checker. | |
| void | ASM_InjectCpuControlParityNvm (uint8_t *flashDiagAddr) |
| This function makes the CPU inject a parity error in the control of the following NVM (Flash) read, which is detected by the NVM control Parity Checker. | |
| void | ASM_InjectRamEccComp (void) |
| This function makes the RAM controller inject a comparator error in the following RAM read, which is detected by the RAM ECC Checker. | |
| void | ASM_InjectRamEcc1 (volatile uint8_t *ramDiagAddr) |
| This function makes the RAM controller inject a 1-bit ECC error in the following RAM read, which is detected by the RAM ECC Checker. | |
| void | ASM_InjectRamEcc2 (volatile uint8_t *ramDiagAddr) |
| This function makes the RAM controller inject a 2-bit ECC error in the following RAM read, which is detected by the RAM ECC Checker. | |
Contains API prototypes for the Memory Manager.
The Memory Manager provides services to Tasks to ensure correct interaction with features of the RAMCTRL, NVMCTRL, CPU and GPR peripherals.
| enum eccAllOnes_t |
Type defines for available "ECC all ones" (ECCALL1) options.
When this feature is enabled, it disregards the ECC check on Non-volatile Memory words read as all 1's from the specified memory sections.
Definition at line 94 of file midware_memory_manager.h.
| enum persistentFlag_t |
Enum for persistent flags used to store data between non-POR/BOR device resets.
Several diagnostics triggers a reset of the device to verify the functionality of a safety mechanism. These flags are used to store data between resets and indicate if diagnostics are ongoing or if a fault has occurred. The flags are written to General Purpose Registers (GPR) and are stored redundantly, meaning each flag consists of two bits stored in two different locations.
Definition at line 49 of file midware_memory_manager.h.
| enum persistentVal_t |
Enum for persistent values used to store data between non-POR/BOR device resets.
Whenever the device is reset, it may be necessary to determine the cause of the reset initiated by software. These values are used to store data between resets and indicate the reason for the reset and any associated Error ID or Error Injection reason. The persistent value types are used to write data to and read data from specific locations in the General Purpose registers (GPR). A checksum is always calculated when storing a value and can be verified when reading from these locations.
Definition at line 75 of file midware_memory_manager.h.
| void ASM_InjectCpuAddressParityNvm | ( | uint8_t * | flashDiagAddr | ) |
This function makes the CPU inject a parity error in the address of the following NVM (Flash) read, which is detected by the NVM address Parity Checker.
| flashDiagAddr | An address to data in Flash, used to trigger the Flash read instruction. |
| void ASM_InjectCpuControlParityNvm | ( | uint8_t * | flashDiagAddr | ) |
This function makes the CPU inject a parity error in the control of the following NVM (Flash) read, which is detected by the NVM control Parity Checker.
| flashDiagAddr | An address to data in Flash, used to trigger the Flash read instruction. |
| void ASM_InjectCpuDataParityNvm | ( | uint8_t * | eepromDiagAddr | ) |
This function makes the CPU inject a parity error in the data of the following NVM (EEPROM) write, which is detected by the NVM control Parity Checker.
| eepromDiagAddr | An address to data in EEPROM, used to trigger the EEPROM write instruction. |
| void ASM_InjectNvmDataParity | ( | uint8_t * | flashDiagAddr | ) |
This function makes the NVMCTRL inject a parity error in the data of the following NVM (Flash) read, which is detected by the CPU data Parity Checker.
| flashDiagAddr | An address to data in Flash, used to trigger the Flash read instruction. |
| void ASM_InjectRamEcc1 | ( | volatile uint8_t * | ramDiagAddr | ) |
This function makes the RAM controller inject a 1-bit ECC error in the following RAM read, which is detected by the RAM ECC Checker.
| ramDiagAddr | An address to data in RAM, used to trigger the RAM read instruction. |
| void ASM_InjectRamEcc2 | ( | volatile uint8_t * | ramDiagAddr | ) |
This function makes the RAM controller inject a 2-bit ECC error in the following RAM read, which is detected by the RAM ECC Checker.
| ramDiagAddr | An address to data in RAM, used to trigger the RAM read instruction. |
| void MW_ClearPersistentFlags | ( | void | ) |
Clears all stored persistent flags in GPR.
Definition at line 589 of file midware_memory_manager.c.
| void MW_ClearPersistentVals | ( | void | ) |
Clears all stored persistent values in GPR.
Definition at line 599 of file midware_memory_manager.c.
| errFlag_t MW_DiagNvmEepromEcc | ( | void | ) |
This function performs error injection diagnostic to detect faults in the NVMCTRL ECC checkers with EEPROM read trigger.
The diagnostic starts by disabling global and non-maskable interrupts. This is done to prevent the interrupt routines from triggering and reporting actual errors. The error channels that will trigger due to the diagnostic are configured by disabling float and setting the severity to NOTIFICATION.
The diagnostic runs injection tests on the NVM ECC checkers using EEPROM as the trigger. The injection tests are done by setting the injection bit for the specific checker in the correct control register before performing an instruction that triggers that checker.
This diagnostic does the following error injection tests:
The interrupt flags and error channels are cleared after the injection tests have been completed. This is done regardless of whether the tests succeeded or failed.
After clearing the interrupts and error channels the diagnostic restores the global interrupt state, reenables the NMI and restores the error channels used to their original configuration.
| ERROR | Fault detected in the NVMCTRL ECC1 or ECC2 error detection mechanisms or diagnostic failed to start due to illegal conditions. |
| NO_ERROR | No fault detected in the redundant NVMCTRL ECC checkers. |
Definition at line 267 of file midware_memory_manager_diag.c.
| errFlag_t MW_DiagNvmFlashEcc | ( | void | ) |
This function performs error injection diagnostic to detect faults in the NVMCTRL ECC checkers with Flash read trigger.
The diagnostic starts by disabling global and non-maskable interrupts. This is done to prevent the interrupt routines from triggering and reporting actual errors. The error channels that will trigger due to the diagnostic are configured by disabling float and setting the severity to NOTIFICATION.
The diagnostic runs injection tests on the NVM ECC checkers using Flash as the trigger. The injection tests are done by setting the injection bit for the specific checker in the correct control register before performing an instruction that triggers that checker.
This diagnostic does the following error injection tests:
The interrupt flags and error channels are cleared after the injection tests have been completed. This is done regardless of whether the tests succeeded or failed.
After clearing the interrupts and error channels the diagnostic restores the global interrupt state, reenables the NMI and restores the error channels used to their original configuration.
| ERROR | Fault detected in the NVMCTRL ECC error detection mechanisms or diagnostic failed to start due to illegal conditions. |
| NO_ERROR | No fault detected in the redundant NVMCTRL ECC checkers. |
Definition at line 222 of file midware_memory_manager_diag.c.
| errFlag_t MW_DiagNvmParity | ( | void | ) |
This function performs error injection diagnostic to detect faults in the CPU and NVM bus parity checkers triggered by NVM access.
The diagnostic starts by disabling global and non-maskable interrupts. This is done to prevent the interrupt routines from triggering and reporting actual errors. The error channels that will trigger due to the diagnostic are configured by disabling float and setting the severity to NOTIFICATION.
The diagnostic runs several injection test on different parity checkers on the device. The injection tests are done by setting the injection bit for the specific checker in the correct control register before performing an instruction that triggers that checker. To make sure that the trigger instruction is known, and not a random instruction, the injection and trigger actions are done using assembly functions.
This diagnostic does the following error injection tests:
The interrupt flags and error channels are cleared after the injection tests have been completed. This is done regardless of whether the tests succeeded or failed.
After clearing the interrupts and error channels the diagnostic restores the global interrupt state, reenables the NMI and restores the error channels used to their original configuration.
| ERROR | Fault detected in the CPU or NVM bus parity checkers or diagnostic failed to start due to illegal conditions. |
| NO_ERROR | No fault detected in the CPU or NVM bus parity checkers. |
Definition at line 126 of file midware_memory_manager_diag.c.
| errFlag_t MW_DiagRamEcc | ( | void | ) |
This function performs error injection diagnostic to detect faults in the redundant RAMCTRL ECC checkers.
The diagnostic starts by disabling global and non-maskable interrupts. This is done to prevent the interrupt routines from triggering and reporting actual errors. The error channels that will trigger due to the diagnostic are configured by disabling float and setting the severity to NOTIFICATION.
The diagnostic runs injection tests on the RAM ECC checkers. The injection tests are done by setting the injection bit for the specific checker in the correct control register before performing an instruction that triggers that checker. To make sure that the trigger instruction is known, and not a random instruction, the injection and trigger actions are done using assembly functions.
This diagnostic does the following error injection tests:
The interrupt flags and error channels are cleared after the injection tests have been completed. This is done regardless of whether the tests succeeded or failed.
After clearing the interrupts and error channels the diagnostic restores the global interrupt state, reenables the NMI and restores the error channels used to their original configuration.
| ERROR | Fault detected in the RAMCTRL ECC error detection mechanisms or diagnostic failed to start due to illegal conditions. |
| NO_ERROR | No fault detected in the redundant RAMCTRL ECC checkers. |
Definition at line 177 of file midware_memory_manager_diag.c.
| errFlag_t MW_DiagRamParity | ( | void | ) |
This function performs error injection diagnostic to detect faults in the RAM parity checker triggered by RAM access.
The diagnostic starts by disabling global and non-maskable interrupts. This is done to prevent the interrupt routines from triggering and reporting actual errors. The error channels that will trigger due to the diagnostic are configured by disabling float and setting the severity to NOTIFICATION.
The diagnostic runs several injection test on different parity checkers on the device. The injection tests are done by setting the injection bit for the specific checker in the correct control register before performing an instruction that triggers that checker. To make sure that the trigger instruction is known, and not a random instruction, the injection and trigger actions are done using assembly functions.
This diagnostic does the following error injection tests:
The interrupt flags and error channels are cleared after the injection tests have been completed. This is done regardless of whether the tests succeeded or failed.
After clearing the interrupts and error channels the diagnostic restores the global interrupt state, reenables the NMI and restores the error channels used to their original configuration.
| ERROR | Fault detected in the CPU bus parity checker or diagnostic failed to start due to illegal conditions. |
| NO_ERROR | No fault detected in the CPU bus parity checker. |
Definition at line 83 of file midware_memory_manager_diag.c.
| errFlag_t MW_GetClearBusError | ( | void | ) |
Reads and clears the flag indicating an error in the Bus Matrix.
This function checks whether the BUSERR interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | Bus error flag set. |
| NO_ERROR | Bus error flag not set. |
Definition at line 130 of file midware_memory_manager.c.
| errFlag_t MW_GetClearCpuDataParityError | ( | void | ) |
Reads and clears the flag indicating a data bus parity error in the CPU.
This function checks whether the PARITYD interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | Data bus parity error flag set. |
| NO_ERROR | Data bus parity error flag not set. |
Definition at line 146 of file midware_memory_manager.c.
| errFlag_t MW_GetClearCpuInstrParityError | ( | void | ) |
Reads and clears the flag indicating a instruction bus parity error in the CPU.
This function checks whether the PARITYI interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | Instruction bus parity error flag set. |
| NO_ERROR | Instruction bus parity error flag not set. |
Definition at line 162 of file midware_memory_manager.c.
| errFlag_t MW_GetClearCpuOpcodeError | ( | void | ) |
Reads and clears the flag indicating an illegal opcode error in the CPU.
This function checks whether the OPC interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | Illegal opcode error flag set. |
| NO_ERROR | Illegal opcode error flag not set. |
Definition at line 178 of file midware_memory_manager.c.
| errFlag_t MW_GetClearNvmEccCompError | ( | void | ) |
Reads and clears the flag indicating a ECC comparator error in the NVM controller.
This function checks whether the COMP interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | ECC Comparator error flag set. |
| NO_ERROR | ECC Comparator error flag not set. |
Definition at line 279 of file midware_memory_manager.c.
| errFlag_t MW_GetClearNvmEepromEcc1Error | ( | void | ) |
Reads and clears the flag indicating an ECC single-bit error in EEPROM.
This function checks whether the EECC1 interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | ECC single-bit error flag set. |
| NO_ERROR | ECC single-bit error flag not set. |
Definition at line 348 of file midware_memory_manager.c.
| errFlag_t MW_GetClearNvmEepromEcc2Error | ( | void | ) |
Reads and clears the flag indicating an ECC multi-bit error in EEPROM.
This function checks whether the EECC2 interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | ECC multi-bit error flag set. |
| NO_ERROR | ECC multi-bit error flag not set. |
Definition at line 364 of file midware_memory_manager.c.
| errFlag_t MW_GetClearNvmFlashEcc1Error | ( | void | ) |
Reads and clears the flag indicating a ECC single-bit error in Flash.
This function checks whether the FECC1 interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | ECC single-bit error flag set. |
| NO_ERROR | ECC single-bit error flag not set. |
Definition at line 295 of file midware_memory_manager.c.
| errFlag_t MW_GetClearNvmFlashEcc2Error | ( | void | ) |
Reads and clears the flag indicating a ECC multi-bit error in Flash.
This function checks whether the FECC2 interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | ECC multi-bit error flag set. |
| NO_ERROR | ECC multi-bit error flag not set. |
Definition at line 311 of file midware_memory_manager.c.
| errFlag_t MW_GetClearNvmParityError | ( | void | ) |
Reads and clears the flag indicating a bus parity error detected in the NVM controller.
This function checks whether the PARITYD, PARITYA or PARITYC interrupt flag has been set or not. If set, clears the flags and returns ERROR.
| ERROR | Flash parity error flag set. |
| NO_ERROR | Flash parity error flag not set. |
Definition at line 327 of file midware_memory_manager.c.
| errFlag_t MW_GetClearRamEcc1Error | ( | void | ) |
Reads and clears the flag indicating an ECC single-bit error in SRAM.
This function checks whether the ECC1 interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | ECC single-bit error flag set. |
| NO_ERROR | ECC single-bit error flag not set. |
Definition at line 226 of file midware_memory_manager.c.
| errFlag_t MW_GetClearRamEcc2Error | ( | void | ) |
Reads and clears the flag indicating an ECC multi-bit error in SRAM.
This function checks whether the ECC2 interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | ECC multi-bit error flag set. |
| NO_ERROR | ECC multi-bit error flag not set. |
Definition at line 242 of file midware_memory_manager.c.
| errFlag_t MW_GetClearRamEccCompError | ( | void | ) |
Reads and clears the flag indicating a ECC comparator error in the RAM controller.
This function checks whether the COMP interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | ECC comparator error flag set. |
| NO_ERROR | ECC comparator error flag not set. |
Definition at line 210 of file midware_memory_manager.c.
| errFlag_t MW_GetClearRamParityError | ( | void | ) |
Reads and clears the flag indicating a bus parity error detected in the RAM controller.
This function checks whether the PARITYD, PARITYA or PARITYC interrupt flag has been set or not. If set, clears the flags and returns ERROR.
| ERROR | Bus parity error flag set. |
| NO_ERROR | Bus parity error flag not set. |
Definition at line 258 of file midware_memory_manager.c.
| errFlag_t MW_GetClearRamStackError | ( | void | ) |
Reads and clears the flag indicating a stack pointer limit error in SRAM.
This function checks whether the SPLIM interrupt flag has been set or not. If set, clears the flag and returns ERROR.
| ERROR | Stack pointer limit error flag set. |
| NO_ERROR | Stack pointer limit flag not set. |
Definition at line 194 of file midware_memory_manager.c.
| bool MW_GetPersistentFlag | ( | persistentFlag_t | flagType | ) |
Reads two redundant bits for each boolean flags in General Purpose Registers (GPR) that is stored for preserving data between resets.
| flagType | The flag type to read. |
| true | Both redundant bits are set, flag is true. |
| false | One or both bits are not set, flag is false. |
Definition at line 475 of file midware_memory_manager.c.
| uint8_t MW_GetPersistentVal | ( | persistentVal_t | valueType | ) |
Reads a value in General Purpose Registers (GPR) that is stored for preserving data between resets.
| valueType | The value type to read. |
Definition at line 504 of file midware_memory_manager.c.
| bool MW_IsPersistentFlagsCorrupt | ( | void | ) |
Compares two redundant bits for each boolean flags in General Purpose Registers (GPR) and checks if any of the flags are corrupted.
This function reads both bits of a flag and compare their value. If both bits of a flag are zero, the flag is false. If both bits of the flag is one, the flag is true. If the two bits of a flag differ (one is zero and the other is one), the flag is considered corrupt due to a bit-flip or other issue. If any flag is found to be corrupt, it is assumed that all flags are corrupt. This is because the integrity of the operations to reset and write to the flags cannot be trusted if any data is corrupted. Additionally, this function checks whether the invalid input flag has been set or not.
| true | One or more flags have been corrupted, or invalid input flag is set. |
| false | No flag corruption detected. |
Definition at line 536 of file midware_memory_manager.c.
| bool MW_IsPersistentValsCorrupt | ( | void | ) |
Checks if any of the stored persistent values are corrupted.
This function calculates a new checksum for the stored values and compares it to the stored checksum. If the checksums do not match, the values are considered corrupted. Additionally, this function checks whether the invalid input flag has been set or not, indicating that he integrity of the operations to reset and write to the values cannot be trusted.
| true | Fault detected in the checksum or invalid input flag has been set. |
| false | No value corruption detected. |
Definition at line 579 of file midware_memory_manager.c.
| errFlag_t MW_SetNvmEccAllOnes | ( | eccAllOnes_t | config | ) |
Sets ECC all Ones (ECCALL1) scheme.
This function sets the ECC all ones scheme for the specified memory sections.
| config | Configuration of which NVM memory sections have the feature enabled or disabled. |
| ERROR | Invalid config value. |
| NO_ERROR | Valid config value. |
Definition at line 380 of file midware_memory_manager.c.
| errFlag_t MW_SetRamStackLimit | ( | uint16_t | splimAddr, |
| bool | lockEnable ) |
Sets the Stack Pointer Limit value and optionally locks the value to prevent modification.
The Stack Pointer Limit (SPLIM) feature compares the current Stack Pointer (SP) RAM address with the configured SPLIM RAM address. The SP in the CPU points to the top of the stack in RAM and typically starts on the highest RAM address. If the stack grows larger than the specified limit, an error flag is set.
| splimAddr | The Stack Pointer Limit RAM address. |
| lockEnable | Enable or disable stack pointer lock. |
| ERROR | Invalid RAM address. |
| NO_ERROR | Valid RAM address. |
Definition at line 395 of file midware_memory_manager.c.
| void MW_StorePersistentFlag | ( | persistentFlag_t | flagType, |
| bool | flag ) |
Stores two redundant boolean flags in General Purpose Registers (GPR) for perserving data between resets.
This function stores the specified value for the specified persistentFlag_t in General Purpose Registers (GPR) in order to preserve data between non-POR/BOR device resets. Each flag value is stored using two redundant bits to detect data corruption. The stored flag value can be read using MW_GetPersistentFlag.
| flagType | The type of flag to store. |
| flag | Boolean value to store. |
Definition at line 416 of file midware_memory_manager.c.
| void MW_StorePersistentVal | ( | persistentVal_t | valueType, |
| uint8_t | value ) |
Stores a value in General Purpose Registers (GPR) for perserving data between resets.
This function stores the specified value for the specified persistentVal_t in General Purpose Registers (GPR) in order to preserve data between non-POR/BOR device resets. Each value is stored in specific locations which is protected by a checksum. The stored values can be read using MW_GetPersistentVal.
| valueType | The value type to store. |
| value | The value to store. |
Definition at line 437 of file midware_memory_manager.c.