38 #include <px4_platform_common/px4_config.h> 44 #define HARDFAULT_REBOOT_FILENO 0 45 #define HARDFAULT_REBOOT_PATH BBSRAM_PATH "" STRINGIFY(HARDFAULT_REBOOT_FILENO) 46 #define HARDFAULT_ULOG_FILENO 3 47 #define HARDFAULT_ULOG_PATH BBSRAM_PATH "" STRINGIFY(HARDFAULT_ULOG_FILENO) 48 #define HARDFAULT_FILENO 4 49 #define HARDFAULT_PATH BBSRAM_PATH "" STRINGIFY(HARDFAULT_FILENO) 51 #define HARDFAULT_MAX_ULOG_FILE_LEN 64 53 #define BBSRAM_SIZE_FN0 (sizeof(int)) 54 #define BBSRAM_SIZE_FN1 384 55 #define BBSRAM_SIZE_FN2 384 56 #define BBSRAM_SIZE_FN3 HARDFAULT_MAX_ULOG_FILE_LEN 57 #define BBSRAM_SIZE_FN4 -1 64 #define BBSRAM_HEADER_SIZE 20 65 #define BBSRAM_USED ((5*BBSRAM_HEADER_SIZE)+(BBSRAM_SIZE_FN0+BBSRAM_SIZE_FN1+BBSRAM_SIZE_FN2+BBSRAM_SIZE_FN3)) 66 #define BBSRAM_REAMINING (PX4_BBSRAM_SIZE-BBSRAM_USED) 67 #if CONFIG_ARCH_INTERRUPTSTACK <= 3 68 # define BBSRAM_NUMBER_STACKS 1 70 # define BBSRAM_NUMBER_STACKS 2 72 #define BBSRAM_FIXED_ELEMENTS_SIZE (sizeof(info_s)) 73 #define BBSRAM_LEFTOVER (BBSRAM_REAMINING-BBSRAM_FIXED_ELEMENTS_SIZE) 75 #define CONFIG_ISTACK_SIZE (BBSRAM_LEFTOVER/BBSRAM_NUMBER_STACKS/sizeof(stack_word_t)) 76 #define CONFIG_USTACK_SIZE (BBSRAM_LEFTOVER/BBSRAM_NUMBER_STACKS/sizeof(stack_word_t)) 79 #define BBSRAM_PATH "/fs/bbr" 81 #define BSRAM_FILE_SIZES { \ 91 #define MAX_FILE_PATH_LENGTH 40 99 #define LOG_PATH_BASE "/fs/microsd/" 100 #define LOG_PATH_BASE_LEN ((arraySize(LOG_PATH_BASE))-1) 102 #define LOG_NAME_FMT "fault_%s.log" 103 #define LOG_NAME_NUM ( -2 ) 104 #define LOG_NAME_LEN ((arraySize(LOG_NAME_FMT)-1) + LOG_NAME_NUM) 106 #define TIME_FMT "%Y_%m_%d_%H_%M_%S" 107 #define TIME_FMT_NUM (2+ 0+ 0+ 0+ 0+ 0) 108 #define TIME_FMT_LEN (((arraySize(TIME_FMT)-1) + TIME_FMT_NUM)) 110 #define LOG_PATH_LEN ((LOG_PATH_BASE_LEN + LOG_NAME_LEN + TIME_FMT_LEN)) 112 #define HEADER_TIME_FMT "%Y-%m-%d-%H:%M:%S" 113 #define HEADER_TIME_FMT_NUM (2+ 0+ 0+ 0+ 0+ 0) 114 #define HEADER_TIME_FMT_LEN (((arraySize(HEADER_TIME_FMT)-1) + HEADER_TIME_FMT_NUM)) 119 #define HARDFAULT_DISPLAY_FORMAT 1 120 #define HARDFAULT_FILE_FORMAT 0 140 #if CONFIG_ARCH_INTERRUPTSTACK > 3 241 uint32_t regs[XCPTCONTEXT_REGS];
244 #if CONFIG_TASK_NAME_SIZE > 0 245 char name[CONFIG_TASK_NAME_SIZE + 1];
254 #if CONFIG_ARCH_INTERRUPTSTACK > 3
int hardfault_rearm(char *caller) weak_function
A set of useful macros for enhanced runtime and compile time error detection and warning suppression...
int reset(enum LPS22HB_BUS busid)
Reset the driver.
#define CONFIG_ISTACK_SIZE
int hardfault_write(char *caller, int fd, int format, bool rearm) weak_function
__BEGIN_DECLS int hardfault_check_status(char *caller) weak_function
#define MAX_FILE_PATH_LENGTH
int hardfault_increment_reboot(char *caller, bool reset) weak_function
#define CONFIG_USTACK_SIZE