I have this:
Code: Select all
import os, pyb
flash = pyb.Flash()
os.umount('/flash')
os.VfsFat(flash)
os.mount(flash, '/flash')
I am also curious why it is getting corrupted, but as long as I can fix it I am less concerned at this point.
here is what I see in dmesg when it breaks:
Code: Select all
[769301.624124] usb 3-2.2: new full-speed USB device number 63 using xhci_hcd
[769301.726417] usb 3-2.2: New USB device found, idVendor=f055, idProduct=9800
[769301.726421] usb 3-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[769301.726424] usb 3-2.2: Product: Pyboard Virtual Comm Port in FS Mode
[769301.726426] usb 3-2.2: Manufacturer: MicroPython
[769301.726428] usb 3-2.2: SerialNumber: 20553687424D
[769301.727145] usb-storage 3-2.2:1.0: USB Mass Storage device detected
[769301.729332] scsi host6: usb-storage 3-2.2:1.0
[769301.729816] cdc_acm 3-2.2:1.1: ttyACM0: USB ACM device
[769302.756673] scsi 6:0:0:0: Direct-Access MicroPy pyboard Flash 1.00 PQ: 0 ANSI: 2
[769302.757091] sd 6:0:0:0: Attached scsi generic sg2 type 0
[769302.757316] sd 6:0:0:0: [sdc] 480 512-byte logical blocks: (246 kB/240 KiB)
[769302.757477] sd 6:0:0:0: [sdc] Write Protect is off
[769302.757479] sd 6:0:0:0: [sdc] Mode Sense: 03 00 00 00
[769302.757646] sd 6:0:0:0: [sdc] No Caching mode page found
[769302.757651] sd 6:0:0:0: [sdc] Assuming drive cache: write through
[769302.763514] sdc: sdc1
[769302.764623] sd 6:0:0:0: [sdc] Attached SCSI removable disk
[769303.008314] FAT-fs (sdc1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[769303.079401] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 48)
[769303.079405] FAT-fs (sdc1): Filesystem has been set read-only
[769303.079409] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 48)
[769303.079411] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 48)
[769303.081381] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 48)
[769303.081384] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 48)
[769303.092506] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 48)
[769303.092510] FAT-fs (sdc1): error, fat_get_cluster: invalid cluster chain (i_pos 48)