![]() |
ADI iSensor FX3 Firmware
v2.9.4-pub
Firmware for the Analog Devices EVAL-ADIS-FX3 IMU Evaluation Platform. This firmware can be compiled using the Cypress EZ USB Suite IDE
|
Implementation file for FX3 flash error logging module. More...
#include "ErrorLog.h"
Functions | |
static void | FindFirmwareVersion (uint8_t *outBuf) |
Parses the firmware version number from FirmwareID to a user provided buffer. More... | |
static void | WriteLogToFlash (ErrorMsg *msg) |
Writes a log data structure to flash memory. More... | |
static void | WriteLogToDebug (ErrorMsg *msg) |
Prints an error log object to the debug console. More... | |
static uint32_t | GetNewLogAddress (uint32_t *TotalLogCount) |
Gets address (in flash memory) for a new error log entry. More... | |
static uint32_t | GetLogCount () |
Gets the log count from flash. More... | |
void | AdiLogError (FileIdentifier File, uint32_t Line, uint32_t ErrorCode) |
Logs a firmware error to flash memory for later examination. More... | |
void | WriteErrorLogCount (uint32_t count) |
Sets the error log count value in flash. More... | |
Variables | |
BoardState | FX3State |
uint8_t | FirmwareID [32] |
uint8_t | LogBuffer [FLASH_PAGE_SIZE] |
Implementation file for FX3 flash error logging module.
Copyright (c) 2018-2020 Analog Devices, Inc. All Rights Reserved. This software is proprietary to Analog Devices, Inc. and its licensors.
THIS SOFTWARE UTILIZES LIBRARIES DEVELOPED AND MAINTAINED BY CYPRESS INC. THE LICENSE INCLUDED IN THIS REPOSITORY DOES NOT EXTEND TO CYPRESS PROPERTY.
Use of this file is governed by the license agreement included in this repository.
void AdiLogError | ( | FileIdentifier | File, |
uint32_t | Line, | ||
uint32_t | ErrorCode | ||
) |
Logs a firmware error to flash memory for later examination.
File | The file which produced the error |
Line | The line in the source file which produced the error |
ErrorCode | The error code which produced the error. Should be of type CyU3PReturnStatus_t. |
When calling this function, the Line parameter should be generated by the C pre-processor using the LINE macro. Internally, this function sets the unit boot time stamp (FX3 boot time), system uptime based on the FX3 RTOS tick clock, and the FX3 firmware version before logging the error to both the debugger output (serial port) and flash memory.
|
static |
Parses the firmware version number from FirmwareID to a user provided buffer.
outBuf | The buffer to place the firmware version into |
This function uses a fixed offset to get the version number from the FirmwareID string. This fixed offset works for current and past versions of the FirmwareID, but will break if the ID format is changed.
|
static |
Gets the log count from flash.
|
static |
Gets address (in flash memory) for a new error log entry.
TotalLogCount | Return by reference for the total number of error log entries stored in flash |
This function implements the error log circular buffer logic by mod-ing the count with the capacity (newer entries will overwrite the oldest error log once the buffer is full).
void WriteErrorLogCount | ( | uint32_t | count | ) |
Sets the error log count value in flash.
count | The new error log count value to write to flash |
|
static |
Prints an error log object to the debug console.
msg | The error log object to print |
|
static |
Writes a log data structure to flash memory.
msg | The error log object to write |
This function first gets the address for the new buffer entry from the flash error log ring buffer. It then clears the 32 bytes which have been allocated in flash for the current error log. The passed log is then copied byte-wise into the LogBuffer, array, then written to flash. Finally, the LOG_COUNT variable in flash is incremented.
|
extern |
Struct. which stores all run time configurable FX3 settings
uint8_t LogBuffer[FLASH_PAGE_SIZE] |
Error log buffer. Each error log entry is copied here before being written to flash