File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ is inserted into the slot, it is available as ``/sd``.
1111When the pyboard boots up, it needs to choose a filesystem to boot from. If
1212there is no SD card, then it uses the internal filesystem ``/flash `` as the boot
1313filesystem, otherwise, it uses the SD card ``/sd ``.
14+ If needed, you can prevent the use of the SD card by creating an empty file
15+ called ``/flash/SKIPSD ``. If this file exists when the pyboard boots
16+ up then the SD card will be skipped and the pyboard will always boot from the
17+ internal filesystem (in this case the SD card won't be mounted but you can still
18+ mount and use it later in your program using ``os.mount ``).
1419
1520(Note that on older versions of the board, ``/flash `` is called ``0:/ `` and ``/sd ``
1621is called ``1:/ ``).
Original file line number Diff line number Diff line change @@ -568,7 +568,10 @@ int main(void) {
568568#if MICROPY_HW_HAS_SDCARD
569569 // if an SD card is present then mount it on /sd/
570570 if (sdcard_is_present ()) {
571- mounted_sdcard = init_sdcard_fs (first_soft_reset );
571+ // if there is a file in the flash called "SKIPSD", then we don't mount the SD card
572+ if (!mounted_flash || f_stat (& fs_user_mount_flash .fatfs , "/SKIPSD" , NULL ) != FR_OK ) {
573+ mounted_sdcard = init_sdcard_fs (first_soft_reset );
574+ }
572575 }
573576#endif
574577
You can’t perform that action at this time.
0 commit comments