summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-03-04 07:00:29 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-03-04 07:00:29 -0600
commitbcbdb2135a6aca11ad081ab9a6c65e95a91ae78a (patch)
treea56f13e576e4b7ec58b709c95b40661dc536a673 /nuttx/include
parented21da90e783fc6b944413e69de0901b2aac4462 (diff)
downloadpx4-nuttx-bcbdb2135a6aca11ad081ab9a6c65e95a91ae78a.tar.gz
px4-nuttx-bcbdb2135a6aca11ad081ab9a6c65e95a91ae78a.tar.bz2
px4-nuttx-bcbdb2135a6aca11ad081ab9a6c65e95a91ae78a.zip
Add support for dumping board-specific information on assertion. From David Sidrane
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/board.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/nuttx/include/nuttx/board.h b/nuttx/include/nuttx/board.h
index 55aa85b60..4c9e1731f 100644
--- a/nuttx/include/nuttx/board.h
+++ b/nuttx/include/nuttx/board.h
@@ -291,4 +291,34 @@ uint8_t board_buttons(void);
xcpt_t board_button_irq(int id, xcpt_t irqhandler);
#endif
+/****************************************************************************
+ * Name: board_crashdump
+ *
+ * Description:
+ * If CONFIG_BOARD_CRASHDUMP is selected then up_asseert will call out to
+ * board_crashdump prior to calling exit in the case of an assertion failure.
+ * Or in the case of a hardfault looping indefinitely. board_crashdump then
+ * has a chance to save the state of the machine. The provided
+ * board_crashdump should save as much information as it can about the cause
+ * of the fault and then most likely reset the system.
+ *
+ * N.B. There are limited system resources that can be used by the provided
+ * board_crashdump function. The tems from the fact that most critical/fatal
+ * crashes are because of a hard fault or during interrupt processing.
+ * In these cases, up_assert is running from the context of an interrupt
+ * handlerand it is impossible to use any device driver in this context.
+ *
+ * Also consider the following: Who knows what state the system is in? Is
+ * memory trashed? Is the Heap intact? Therefore all we can expect to do in
+ * board_crashdump is save the "machine state" in a place where on the next
+ * reset we can write it to more sophisticated storage in a sane operating
+ * environment.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_BOARD_CRASHDUMP
+void board_crashdump(uint32_t currentsp, void *tcb, uint8_t *filename,
+ int lineno);
+#endif
+
#endif /* __INCLUDE_NUTTX_BOARD_H */