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
Data Structures | Macros | Typedefs | Enumerations | Functions
ErrorLog.h File Reference

Header file for the FX3 flash error logging module. More...

#include "main.h"

Go to the source code of this file.

Data Structures

struct  ErrorMsg
 Structure which holds all information about a given error event. More...
 

Macros

#define LOG_BASE_ADDR   (0x34040)
 
#define LOG_CAPACITY   1500
 
#define LOG_COUNT_ADDR   (0x34000)
 

Typedefs

typedef enum FileIdentifier FileIdentifier
 
typedef struct __packed__ ErrorMsg ErrorMsg
 Structure which holds all information about a given error event. More...
 

Enumerations

enum  FileIdentifier {
  Unknown = 0, Main_c = 1, AppThread_c = 2, StreamThread_c = 3,
  PinFunctions_c = 4, SpiFunctions_c = 5, StreamFunctions_c = 6, Flash_c = 7,
  ErrorLog_c = 8, I2cFunctions_c = 9, HelperFunctions_c = 10
}
 

Functions

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...
 

Detailed Description

Header file for the 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.

Date
12/6/2019
Author
A. Nolan (alex..nosp@m.nola.nosp@m.n@ana.nosp@m.log..nosp@m.com)

Macro Definition Documentation

◆ LOG_BASE_ADDR

#define LOG_BASE_ADDR   (0x34040)

The log start address in flash (have to leave space for bootloader starting at flash address 0x0)

◆ LOG_CAPACITY

#define LOG_CAPACITY   1500

The max log capacity for the ring buffer (32 bytes per entry)

◆ LOG_COUNT_ADDR

#define LOG_COUNT_ADDR   (0x34000)

The flash address of the current log count. This is used to track the head of the error log

Typedef Documentation

◆ ErrorMsg

typedef struct __packed__ ErrorMsg ErrorMsg

Structure which holds all information about a given error event.

This struct contains all pertinent information about a given hard crash event. This struct is generated By AdiLogError, and stored to flash in a ring buffer. The total size of this struct is 32 bytes

◆ FileIdentifier

Enum to identify the source file which threw an error. More RAM efficient than the FILE directive (gives full path as string)

Enumeration Type Documentation

◆ FileIdentifier

Enum to identify the source file which threw an error. More RAM efficient than the FILE directive (gives full path as string)

Enumerator
Unknown 

Error originated from an unknown file

Main_c 

Error originated from main.c

AppThread_c 

Error originated from AppThread.c

StreamThread_c 

Error originated from StreamThread.c

PinFunctions_c 

Error originated from PinFunctions.c

SpiFunctions_c 

Error originated from SpiFunctions.c

StreamFunctions_c 

Error originated from StreamFunctions.c

Flash_c 

Error originated from Flash.c

ErrorLog_c 

Error originated from ErrorLog.c

I2cFunctions_c 

Error originating from I2cFunctions.c

HelperFunctions_c 

Error originating from HelperFunctions.c

Function Documentation

◆ AdiLogError()

void AdiLogError ( FileIdentifier  File,
uint32_t  Line,
uint32_t  ErrorCode 
)

Logs a firmware error to flash memory for later examination.

Parameters
FileThe file which produced the error
LineThe line in the source file which produced the error
ErrorCodeThe error code which produced the error. Should be of type CyU3PReturnStatus_t.
Returns
void

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.

◆ WriteErrorLogCount()

void WriteErrorLogCount ( uint32_t  count)

Sets the error log count value in flash.

Parameters
countThe new error log count value to write to flash
Returns
void