MicroPython-Hack-safemode

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Introduction

La carte dispose d'un Safe Mode et d'une réinitialisation d'usine (factory reset).

Ne vous inquiétez pas si votre pyboard ne fonctionne plus comme attendu (ou fonctionne mal). Il est presque impossible de détruire une carte PyBoard en la programmant mal.

La première chose à essayer est d'entrer en "safe mode": ce mode évite temporairement l'exécution de boot.py et main.py tout en activant la configuration USB par défaut.

Si vous avez rencontrez des problèmes avec le système de fichier, vous pouvez utiliser la réinitialisation d'usine (dit factory reset) qui réinitialise le système de fichier à son état d'origine.

Safe mode

Le Safe Mode (mode de sécurité) this temporarily skips execution of boot.py and main.py and gives default USB settings.

To enter safe mode, do the following steps:

  1. Connect the pyboard to USB so it powers up.
  2. Hold down the USR switch.
  3. While still holding down USR, press and release the RST switch.
  4. The LEDs will then cycle green to orange to green+orange and back again.
  5. Keep holding down USR until only the orange LED is lit, and then let go of the USR switch.
  6. The orange LED should flash quickly 4 times, and then turn off.
  7. You are now in safe mode.

In safe mode, the boot.py and main.py files are not executed, and so the pyboard boots up with default settings. This means you now have access to the filesystem (the USB drive should appear), 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 pyboard.

Réinitialisation d'usine

If you pyboard’s filesystem gets corrupted (for example, you forgot to eject/unmount it), or you have some code in boot.py or main.py which you can’t escape from, then you can reset the filesystem.

Resetting the filesystem deletes all files on the internal pyboard storage (not the SD card), and restores the files boot.py, main.py, README.txt and pybcdc.inf back to their original state.

To do a factory reset of the filesystem you follow a similar procedure as you did to enter safe mode, but release USR on green+orange:

  1. Connect the pyboard to USB so it powers up.
  2. Hold down the USR switch.
  3. While still holding down USR, press and release the RST switch.
  4. The LEDs will then cycle green to orange to green+orange and back again.
  5. Keep holding down USR until both the green and orange LEDs are lit, and then let go of the USR switch.
  6. The green and orange LEDs should flash quickly 4 times.
  7. The red LED will turn on (so red, green and orange are now on).
  8. The pyboard is now resetting the filesystem (this takes a few seconds).
  9. The LEDs all turn off.
  10. You now have a reset filesystem, and are in safe mode.
  11. Press and release the RST switch to boot normally.



Source: Safe mode and factory reset écrit par/written by Damien P.George

Traduit par Meurisse D. pour MCHobby.be - Translated by Meurisse D. for MCHobby.be

Traduit avec l'autorisation de micropython.org - Translated with the authorisation of micropython.org

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.