summaryrefslogtreecommitdiffstatshomepage
path: root/docs/wipy/tutorial/reset.rst
diff options
context:
space:
mode:
authordanicampora <daniel@wipy.io>2015-10-21 14:58:04 +0200
committerdanicampora <daniel@wipy.io>2015-10-21 15:30:57 +0200
commit109b363ddc1a83ec35511bde0eea8bb8a0ec206b (patch)
treec116a491ff155e9337d33ef91d94e48628b84c2c /docs/wipy/tutorial/reset.rst
parent075ca645219a2cb90f886eabdedd80d6b3fc0501 (diff)
downloadmicropython-109b363ddc1a83ec35511bde0eea8bb8a0ec206b.tar.gz
micropython-109b363ddc1a83ec35511bde0eea8bb8a0ec206b.zip
docs/wipy: Add more tutorials and examples.
Diffstat (limited to 'docs/wipy/tutorial/reset.rst')
-rw-r--r--docs/wipy/tutorial/reset.rst53
1 files changed, 53 insertions, 0 deletions
diff --git a/docs/wipy/tutorial/reset.rst b/docs/wipy/tutorial/reset.rst
new file mode 100644
index 0000000000..970f8d1ddc
--- /dev/null
+++ b/docs/wipy/tutorial/reset.rst
@@ -0,0 +1,53 @@
+Reset and boot modes
+====================
+
+There are soft resets and hard resets.
+
+ - A soft reset simply clears the state of the MicroPython virtual machine,
+ but leaves hardware peripherals unaffected. To do a soft reset, simply press
+ **Ctrl+D** on the REPL, or within a script do::
+
+ import sys
+ sys.exit()
+
+ - A hard reset is the same as performing a power cycle to the board. In order to
+ hard reset the WiPy, press the switch on the board or::
+
+ import machine
+ machine.reset()
+
+Safe boot
+---------
+
+If something goes wrong with your WiPy, don't panic! It is almost
+impossible for you to break the WiPy by programming the wrong thing.
+
+The first thing to try is to boot in safe mode: this temporarily skips
+execution of ``boot.py`` and ``main.py`` and gives default WLAN settings.
+
+If you have problems with the filesystem you can :ref:`format the internal flash
+drive <wipy_factory_reset>`.
+
+To boot in safe mode, follow the detailed instructions described :ref:`here <wipy_boot_modes>`.
+
+In safe mode, the ``boot.py`` and ``main.py`` files are not executed, and so
+the WiPy boots up with default settings. This means you now have access
+to the filesystem, and you can edit ``boot.py`` and ``main.py`` to fix any problems.
+
+Entering safe mode is temporary, and does not make any changes to the
+files on the WiPy.
+
+.. _wipy_factory_reset:
+
+Factory reset the filesystem
+----------------------------
+
+If you WiPy's filesystem gets corrupted (very unlikely, but possible), you
+can format it very easily byt doing::
+
+ >>> import os
+ >>> os.mkfs('/flash')
+
+Resetting the filesystem deletes all files on the internal WiPy storage
+(not the SD card), and restores the files ``boot.py``, ``main.py``, ``README.txt``
+and ``pybcdc.inf`` back to their original state after the next reset.