summaryrefslogtreecommitdiffstatshomepage
path: root/docs/library
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-02-06 13:19:52 +1100
committerDamien George <damien.p.george@gmail.com>2017-02-06 13:22:17 +1100
commit27c149efe030b6fd24c0cc1475ea509da1a72821 (patch)
tree15a873f0cdb89001564cfd63da08ba11dcd04ed5 /docs/library
parentbffda451542854fb06021e2f7fac57534e9d2768 (diff)
downloadmicropython-27c149efe030b6fd24c0cc1475ea509da1a72821.tar.gz
micropython-27c149efe030b6fd24c0cc1475ea509da1a72821.zip
stmhal: Add pyb.fault_debug() function, to control hard-fault behaviour.
This new function controls what happens on a hard-fault: - debugging disabled: board will do a reset - debugging enabled: board will print registers and stack and flash LEDs The default is disabled, ie to do a reset. This is different to previous behaviour which flashed the LEDs and waited indefinitely.
Diffstat (limited to 'docs/library')
-rw-r--r--docs/library/pyb.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/library/pyb.rst b/docs/library/pyb.rst
index 910b2f45b4..9c4933808a 100644
--- a/docs/library/pyb.rst
+++ b/docs/library/pyb.rst
@@ -80,6 +80,19 @@ Reset related functions
Activate the bootloader without BOOT\* pins.
+.. function:: fault_debug(value)
+
+ Enable or disable hard-fault debugging. A hard-fault is when there is a fatal
+ error in the underlying system, like an invalid memory access.
+
+ If the `value` argument is `False` then the board will automatically reset if
+ there is a hard fault.
+
+ If `value` is `True` then, when the board has a hard fault, it will print the
+ registers and the stack trace, and then cycle the LEDs indefinitely.
+
+ The default value is disabled, i.e. to automatically reset.
+
Interrupt related functions
---------------------------