diff --git a/arch/arm/src/stm32/stm32_bbsram.h b/arch/arm/src/stm32/stm32_bbsram.h index 536273f1157..bcb813d6fa1 100644 --- a/arch/arm/src/stm32/stm32_bbsram.h +++ b/arch/arm/src/stm32/stm32_bbsram.h @@ -83,9 +83,8 @@ enum bbsramdf_e { - BBSRAM_CRC_VALID = 1, /* The crc is valid */ - BBSRAM_DIRTY = 2, /* The file was closed */ - + BBSRAM_CRC_VALID = 1, /* The crc is valid */ + BBSRAM_DIRTY = 2, /* The file was closed */ }; struct bbsramd_s diff --git a/arch/arm/src/stm32f7/stm32_bbsram.c b/arch/arm/src/stm32f7/stm32_bbsram.c index 7f8a8f0783b..bd653cfe568 100644 --- a/arch/arm/src/stm32f7/stm32_bbsram.c +++ b/arch/arm/src/stm32f7/stm32_bbsram.c @@ -168,6 +168,7 @@ static struct stm32_bbsram_s g_bbsram[CONFIG_STM32F7_BBSRAM_FILES]; /**************************************************************************** * Private Functions ****************************************************************************/ + /**************************************************************************** * Name: stm32_bbsram_rd ****************************************************************************/ @@ -199,16 +200,16 @@ static void stm32_bbsram_dump(FAR struct bbsramfh_s *bbf, char *op) } #endif -/************************************************************************************ +/**************************************************************************** * Name: stm32_bbsram_semgive - ************************************************************************************/ + ****************************************************************************/ static void stm32_bbsram_semgive(FAR struct stm32_bbsram_s *priv) { sem_post(&priv->exclsem); } -/************************************************************************************ +/**************************************************************************** * Name: stm32_bbsram_semtake * * Description: @@ -504,8 +505,8 @@ static ssize_t stm32_bbsram_internal_write(FAR struct bbsramfh_s *bbf, * Name: stm32_bbsram_write ****************************************************************************/ -static ssize_t stm32_bbsram_write(FAR struct file *filep, FAR const char *buffer, - size_t len) +static ssize_t stm32_bbsram_write(FAR struct file *filep, + FAR const char *buffer, size_t len) { FAR struct inode *inode = filep->f_inode; FAR struct stm32_bbsram_s *bbr; diff --git a/arch/arm/src/stm32f7/stm32_bbsram.h b/arch/arm/src/stm32f7/stm32_bbsram.h index ce31dc585da..554a0c60df8 100644 --- a/arch/arm/src/stm32f7/stm32_bbsram.h +++ b/arch/arm/src/stm32f7/stm32_bbsram.h @@ -83,9 +83,8 @@ enum bbsramdf_e { - BBSRAM_CRC_VALID = 1, /* The crc is valid */ - BBSRAM_DIRTY = 2, /* The file was closed */ - + BBSRAM_CRC_VALID = 1, /* The crc is valid */ + BBSRAM_DIRTY = 2, /* The file was closed */ }; struct bbsramd_s diff --git a/arch/arm/src/stm32f7/stm32_dbgmcu.h b/arch/arm/src/stm32f7/stm32_dbgmcu.h index 396288a4895..0aef4d5f0a0 100644 --- a/arch/arm/src/stm32f7/stm32_dbgmcu.h +++ b/arch/arm/src/stm32f7/stm32_dbgmcu.h @@ -45,20 +45,4 @@ #include "chip/stm32_dbgmcu.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Types - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - #endif /* __ARCH_ARM_SRC_STM32F7_STM32_DBGMCU_H */ diff --git a/configs/nucleo-144/src/stm32_bbsram.c b/configs/nucleo-144/src/stm32_bbsram.c index 1810cf31209..085ee182492 100644 --- a/configs/nucleo-144/src/stm32_bbsram.c +++ b/configs/nucleo-144/src/stm32_bbsram.c @@ -106,13 +106,14 @@ /* The sizes of the files to create (-1) use rest of BBSRAM memory */ -#define BSRAM_FILE_SIZES { \ - BBSRAM_SIZE_FN0, \ - BBSRAM_SIZE_FN1, \ - BBSRAM_SIZE_FN2, \ - BBSRAM_SIZE_FN3, \ - 0 \ - } +#define BSRAM_FILE_SIZES \ +{ \ + BBSRAM_SIZE_FN0, \ + BBSRAM_SIZE_FN1, \ + BBSRAM_SIZE_FN2, \ + BBSRAM_SIZE_FN3, \ + 0 \ +} #define ARRAYSIZE(a) (sizeof((a))/sizeof(a[0])) @@ -364,16 +365,20 @@ int stm32_bbsram_int(void) { printf("There is a hard fault logged.\n"); state = (desc.lastwrite.tv_sec || desc.lastwrite.tv_nsec) ? OK : 1; + syslog(LOG_INFO, "Fault Log info File No %d Length %d flags:0x%02x " "state:%d\n",(unsigned int)desc.fileno, (unsigned int) desc.len, (unsigned int)desc.flags, state); + if (state == OK) { time_sec = desc.lastwrite.tv_sec + (desc.lastwrite.tv_nsec / 1e9); gmtime_r(&time_sec, &tt); strftime(buf, HEADER_TIME_FMT_LEN , HEADER_TIME_FMT , &tt); + syslog(LOG_INFO, "Fault Logged on %s - Valid\n", buf); } + close(rv); rv = unlink(HARDFAULT_PATH); if (rv < 0)