AVR SD Safety Framework 1.0.0
Loading...
Searching...
No Matches
midware_memory_manager_diag.c File Reference

Implements APIs for the Memory Manager Diagnostic. More...

#include <stdbool.h>
#include <stdint.h>
#include <define_error_flags.h>
#include <driver_cpuctrl.h>
#include <driver_errctrl.h>
#include <driver_nvmctrl.h>
#include <driver_ramctrl.h>
#include <midware_memory_manager_diag.h>
#include <midware_memory_manager_diag_asm.h>
#include <midware_shared_diag_private.h>
#include <xc.h>

Macros

#define RAM_ECC_32BIT_WORD_ADDRESS_MASK   0x0003U
#define PASSING_ECC_SYNDROME   0x00U
#define WORD_SIZE_RAM_BYTES   4U
#define RAM_ECC_DIAG_DATA_SIZE   (WORD_SIZE_RAM_BYTES * 2U)
#define RAM_ECC_DIAG_INJECT_INDEX   (WORD_SIZE_RAM_BYTES - 1U)
#define NVM_ADDR_FLASH_WORD_SHIFT   1U

Functions

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 (uint16_t eepromDiagAddr)
 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 (uint16_t flashDiagAddr)
 This function performs error injection diagnostic to detect faults in the NVMCTRL ECC checkers with Flash read trigger.
errFlag_t MW_DiagNvmEepromEcc (uint16_t eepromDiagAddr)
 This function performs error injection diagnostic to detect faults in the NVMCTRL ECC checkers with EEPROM read trigger.

Detailed Description

Implements APIs for the Memory Manager Diagnostic.

Macro Definition Documentation

◆ NVM_ADDR_FLASH_WORD_SHIFT

#define NVM_ADDR_FLASH_WORD_SHIFT   1U

ADDR is a Flash word address

◆ PASSING_ECC_SYNDROME

#define PASSING_ECC_SYNDROME   0x00U

Bit location for 1-bit ECC injection

◆ RAM_ECC_32BIT_WORD_ADDRESS_MASK

#define RAM_ECC_32BIT_WORD_ADDRESS_MASK   0x0003U

Used for masking 2 LSb in address

◆ RAM_ECC_DIAG_DATA_SIZE

#define RAM_ECC_DIAG_DATA_SIZE   (WORD_SIZE_RAM_BYTES * 2U)

RAM ECC diag data size

◆ RAM_ECC_DIAG_INJECT_INDEX

#define RAM_ECC_DIAG_INJECT_INDEX   (WORD_SIZE_RAM_BYTES - 1U)

RAM ECC diag index

◆ WORD_SIZE_RAM_BYTES

#define WORD_SIZE_RAM_BYTES   4U

Size of a RAM word