1. 程式人生 > >MicroPython在安全模式和出廠重置檔案系統下的系統修復問題

MicroPython在安全模式和出廠重置檔案系統下的系統修復問題

7.2. Factory reset the filesystem

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.pyREADME.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.

7.安全模式和出廠重置

如果你的黑板出了問題,不要驚慌!通過編寫錯誤的東西來破壞pyboard幾乎是不可能的。

首先要嘗試的是進入安全模式:這暫時跳過執行boot.pymain.py和給出預設的USB設定。

如果您在檔案系統上遇到問題,則可以執行恢復出廠設定,將檔案系統恢復到原始狀態。

7.1。安全模式

要進入安全模式,請執行以下步驟:

  1. 將黑板連線到USB,以便啟動。
  2. 按住USR開關。
  3. 在按住USR的同時,按下並釋放RST開關。
  4. 然後,LED將以綠色迴圈至橙色至綠色+橙色,然後再次返回。
  5. 繼續按住USR直到只有橙色LED亮起,然後鬆開USR開關。
  6. 橙色LED應快速閃爍4次,然後熄滅。
  7. 你現在處於安全模式。

在安全模式下,檔案boot.pymain.py檔案不會執行,所以pyboard啟動預設設定。這意味著您現在可以訪問檔案系統(應該顯示USB驅動器),您可以編輯boot.py 和main.py修復任何問題。

進入安全模式是暫時的,並且不會對pyboard上的檔案進行任何更改。

7.2。出廠重置檔案系統

如果你的pyboard的檔案系統被損壞(例如,你忘記彈出/解除安裝它),或者你有一些程式碼boot.py或者main.py你不能逃避,那麼你可以重置檔案系統。

重置檔案系統刪除的內部pyboard儲存(不是SD卡)的所有檔案,並恢復檔案boot.pymain.pyREADME.txt 並pybcdc.inf返回到原來的狀態。

要執行檔案系統的出廠重置,請按照與進入安全模式相似的步驟進行操作,但以綠色+橙色釋放USR:

  1. 將黑板連線到USB,以便啟動。
  2. 按住USR開關。
  3. 在按住USR的同時,按下並釋放RST開關。
  4. 然後,LED將以綠色迴圈至橙色至綠色+橙色,然後再次返回。
  5. 繼續按住USR,直到綠色和橙色指示燈亮起,然後鬆開USR開關。
  6. 綠色和橙色LED應快速閃爍4次。
  7. 紅色LED將亮起(紅色,綠色和橙色現在亮起)。
  8. pyboard現在重置檔案系統(這需要幾秒鐘)。
  9. LED全部熄滅。
  10. 您現在有一個重置檔案系統,並處於安全模式。
  11. 按下並釋放RST開關以正常啟動。