![]() |
iSensor-SPI-Buffer
1.15
Firmware for the iSensor-SPI-Buffer board to enable full throughput buffered data capture on Analog Devices IMUs
|
iSensor-SPI-Buffer flash memory interfacing functions. More...
Functions | |
static void | PrepareRegsForFlash () |
Clears all non-volatile registers in RAM and updates reg signature. More... | |
static uint16_t | CalcRegSig (uint16_t *regs, uint32_t count) |
Calculate a signature of a block of RAM. Used for verifying flash memory contents. More... | |
void | Flash_Update () |
Flash update command handler. More... | |
void | Flash_Load_Registers () |
Load register values from flash memory to SRAM. More... | |
void | Flash_Check_Logged_Fault () |
Checks for error codes which may have been logged to flash, and sets the status register bit. More... | |
void | Flash_Log_Fault (uint32_t faultCode) |
Stores an error code to flash memory. More... | |
void | Flash_Fault_Log_Init () |
Initialize flash error logging. More... | |
iSensor-SPI-Buffer flash memory interfacing functions.
Copyright (c) Analog Devices Inc, 2020 All Rights Reserved.
|
static |
Calculate a signature of a block of RAM. Used for verifying flash memory contents.
void Flash_Check_Logged_Fault | ( | ) |
Checks for error codes which may have been logged to flash, and sets the status register bit.
Loads the previously stored error code from flash memory to the designated flash error register. If the error code is non-zero, sets the status register fault bit.
void Flash_Fault_Log_Init | ( | ) |
Initialize flash error logging.
This function is intended to be called as part of the initialization process. It checks the validity of stored error log. If the log is invalid, error logging has not been initialized, and the log is cleared. Updates the FAULT_CODE and STATUS registers.
void Flash_Load_Registers | ( | ) |
Load register values from flash memory to SRAM.
After loading registers from flash, the signature of the loaded registers is compared to the signature stored in flash. If there is a mis-match, the STATUS FLASH_ERROR bit is set. Register values on page 253 - 254 are stored.
void Flash_Log_Fault | ( | uint32_t | faultCode | ) |
Stores an error code to flash memory.
faultCode | The error code to store. Should be one of the defined fault types |
This function is called when a fatal error is encountered by the system. Data is logged about the source of the error, and then a system reset is triggered. Once an error has been logged, it will be persistent until a fault code clear command is executed. We also don't care about error handling within this routine - as soon as it returns, the system will be reset.
void Flash_Update | ( | ) |
Flash update command handler.
Saves all non-volatile registers to flash memory. They will be retrieved on the next system boot. Also saves a signature of the registers, which is used for register contents validation on the next boot. Registers are backed up to flash starting at an offset of 62KB in flash memory
|
static |
Clears all non-volatile registers in RAM and updates reg signature.