Modifications

Sauter à la navigation Sauter à la recherche
2 698 octets ajoutés ,  26 mars 2017 à 20:28
Ligne 35 : Ligne 35 :  
REPL signifie '''R'''ead '''E'''valuate '''P'''rint '''L'''oop (boucle de lecture-évaluation-affichage), c'est le nom donné à la ligne de commande interactive de MicroPython qui vous offre un accès en ligne de commande sur votre plateforme MicroPython (PyBoard, WiPy, WiPy2, LoPy).  
 
REPL signifie '''R'''ead '''E'''valuate '''P'''rint '''L'''oop (boucle de lecture-évaluation-affichage), c'est le nom donné à la ligne de commande interactive de MicroPython qui vous offre un accès en ligne de commande sur votre plateforme MicroPython (PyBoard, WiPy, WiPy2, LoPy).  
   −
Nous avons traité ce point en détail dans notre [[Hack-pycom-lopy-ftp|"Telnet et FTP" pour WiPy2 et LoPy]].
+
<font color="red">Nous avons traité ce point en détail dans notre [[Hack-pycom-lopy-ftp|"Telnet et FTP" pour WiPy2 et LoPy]].</font>
   −
* Les modules
+
== Boot Mode et Safe Boot ==
* REPL, FTP --> rediriger vers les tutos existant/WiPy1
+
If you power up normally, or press the reset button, the LoPy will boot into standard mode; the {{fname|boot.py}} file will be executed first, then {{fname|main.py}} will run.
* Boot Mode
+
 
* Interruption
+
You can override this boot sequence by pulling {{fname|P12}} (G28) '''up''' (connect it to the 3V3 output pin) during reset. This procedure also allows going back in time to old firmware versions. The LoPy can hold up to 3 different firmware versions, which are: the factory firmware plus 2 OTA images.
* Pymakr IDE --> rediriger vers la page Pymakr
+
 
 +
After reset, if {{fname|P12}} is held high, the heartbeat LED will start flashing slowly in orange color, if after 3 seconds the pin is still being held high, the LED will start blinking a bit faster and the LoPy will select the previous OTA image to boot. If the previous user update is the desired firmware image, {{fname|P12}} must be released before 3 more seconds elapse. If after 3 seconds later, the pin is still high the factory firmware will be selected, the LED will flash quickly for 1.5 seconds and the LoPy will proceed to boot. The firmware selection mechanism is as follows:
 +
 
 +
'''Safe Boot Pin {{fname|P12}} released during:'''
 +
* '''Les 3 premières secondes''' - Safe boot, ''latest'' firmware is selected
 +
* '''Les 3 secondes suivantes''' - Safe boot, '''previous''' user update selected
 +
* '''La dernière seconde et demi''' - Safe boot, the '''factory''' firmware is selected
 +
 
 +
On all of the above 3 scenarios, safe boot mode is entered, meaning that the execution of both {{fname|boot.py}} and {{fname|main.py}} is skipped. This is useful to recover from crash situations caused by the user scripts. The selection made during safe boot is not persistent, therefore after the next normal reset the latest firmware will run again.
 +
 
 +
If you have problems with the filesystem you can format the internal flash drive.
 +
 
 +
== Reset / Réinitialisation ==
 +
 
 +
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:
 +
 
 +
<nowiki>>>> import sys
 +
>>> sys.exit()</nowiki>
 +
 
 +
A hard reset is the same as performing a power cycle to the board. In order to hard reset the LoPy, press the switch on the board or:
 +
 
 +
<nowiki>>>> import machine
 +
>>> machine.reset()</nowiki>
 +
 
 +
== Réinitialisation du système de fichier ==
 +
If you device’s filesystem gets corrupted (very unlikely, but possible), you can format it very easily by doing:
 +
 
 +
<nowiki>>>> import os
 +
>>> os.mkfs('/flash')</nowiki>
 +
 
 +
Resetting the flash filesystem deletes all files inside the internal LoPy storage (not the SD card), and restores the files {{fname|boot.py}} and {{fname|main.py}} back to their original states after the next reset.
 +
 
 +
== Gestion des interruptions ==
 +
x
    
{{LOPY-TRAILER}}
 
{{LOPY-TRAILER}}
29 917

modifications

Menu de navigation