Lines Matching +full:write +full:- +full:protect

1 .. zephyr:code-sample:: usb-mass
3 :relevant-api: usbd_api usbd_msc_device _usb_device_core_api file_system_api
25 The selection between a RAM-based or a FLASH-based disk and file system
26 can be chosen passing Kconfig configuration via the -D command-line switch.
28 RAM-disk Example without any file system
31 The default configurations selects RAM-based disk without any file system.
32 This example only needs additional 96KiB RAM for the RAM-disk and is intended
35 .. zephyr-app-commands::
36 :zephyr-app: samples/subsys/usb/mass
38 :gen-args: -DEXTRA_DTC_OVERLAY_FILE="ramdisk.overlay"
47 with a RAM-disk. Alternatively it is possible with the FLASH-based disk.
48 In this example we will build the sample with a RAM-based disk:
50 .. zephyr-app-commands::
51 :zephyr-app: samples/subsys/usb/mass
53 :gen-args: -DEXTRA_DTC_OVERLAY_FILE="ramdisk.overlay" -DCONFIG_APP_MSC_STORAGE_RAM=y
58 In this example we will build the sample with a FLASH-based disk and FAT
62 .. zephyr-app-commands::
63 :zephyr-app: samples/subsys/usb/mass
65 :gen-args: -DCONFIG_APP_MSC_STORAGE_FLASH_FATFS=y
73 .. code-block:: console
75 $ journalctl -k -n 17
76 usb 2-2.4: new full-speed USB device number 29 using xhci_hcd
77 usb 2-2.4: New USB device found, idVendor=2fe3, idProduct=0008, bcdDevice= 2.03
78 usb 2-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
79 usb 2-2.4: Product: Zephyr MSC sample
80 usb 2-2.4: Manufacturer: ZEPHYR
81 usb 2-2.4: SerialNumber: 86FE679A598AC47A
82 usb-storage 2-2.4:1.0: USB Mass Storage device detected
83 scsi host3: usb-storage 2-2.4:1.0
84 scsi 3:0:0:0: Direct-Access ZEPHYR ZEPHYR USB DISK 0.01 PQ: 0 ANSI: 0 CCS
86 sd 3:0:0:0: [sdb] 256 512-byte logical blocks: (131 kB/128 KiB)
87 sd 3:0:0:0: [sdb] Write Protect is off
90 sd 3:0:0:0: [sdb] Assuming drive cache: write through
97 .. code-block:: none
99 *** Booting Zephyr OS build zephyr-v2.3.0-1991-g4c8d1496eafb ***
119 .. zephyr-app-commands::
120 :zephyr-app: samples/subsys/usb/mass
122 :gen-args: -DCONFIG_APP_MSC_STORAGE_SDCARD=y
129 .. zephyr-app-commands::
130 :zephyr-app: samples/subsys/usb/mass
133 :gen-args: -DCONFIG_APP_MSC_STORAGE_SDCARD=y
141 .. code-block:: none
143 *** Booting Zephyr OS build v2.5.0-rc3-73-gd85067f0a759 ***
161 :zephyr:code-sample:`littlefs` sample.
163 .. zephyr-app-commands::
164 :zephyr-app: samples/subsys/usb/mass
166 :gen-args: -DCONFIG_APP_MSC_STORAGE_FLASH_LITTLEFS=y
172 running a littlefs-FUSE-capable operating system. The output to the
176 .. code-block:: none
178 *** Booting Zephyr OS build zephyr-v2.2.0-1966-g7815942d5fc5 ***
183 [00:00:00.009,063] <inf> littlefs: FS at MX25R64:0x0 is 16 0x1000-byte blocks with 512 cye
200 While a FAT-based file system can be mounted by many systems automatically,
202 accomplished using the `littlefs-FUSE`_ utility.
206 .. code-block:: none
208 …Apr 25 08:10:25 tirzah kernel: [570310.921039] scsi 17:0:0:0: Direct-Access ZEPHYR ZEPHYR US…
210 …Apr 25 08:10:25 tirzah kernel: [570310.922277] sd 17:0:0:0: [sdd] 256 512-byte logical blocks: (13…
211 Apr 25 08:10:25 tirzah kernel: [570310.922696] sd 17:0:0:0: [sdd] Write Protect is off
216 .. code-block:: shell
219 brw-rw---- 1 root disk 8, 48 Apr 25 08:10 /dev/sdd
223 .. code-block:: shell
228 --read_size=16 \
229 --prog_size=16 \
230 --block_size=4096 \
231 --block_count=32 \
232 --cache_size=64 \
233 --lookahead_size=32 \
238 .. code-block:: none
240 tirzah[467]$ ls -l /tmp/lfs
242 -rwxrwxrwx 0 root root 8 Dec 31 1969 hi
243 -rwxrwxrwx 0 root root 128 Dec 31 1969 linux
244 -rwxrwxrwx 0 root root 5 Dec 31 1969 newfile
249 .. code-block:: shell
254 ----------------------------
261 .. code-block:: none
264 [00:00:00.009,063] <inf> littlefs: FS at MX25R64:0x0 is 16 0x1000-byte blocks with 512 cye
267 * ``--read_size`` corresponds to the ``rd`` size and is 16;
268 * ``--prog_size`` corresponds to the ``pr`` size and is 16;
269 * ``--block_size`` comes from ``0x1000-byte blocks`` and is 4096 (0x1000);
270 * ``--block_count`` comes from ``16 0x1000-byte blocks`` and is 16;
271 * ``--cache_size`` comes from the ``ca`` size and is 64;
272 * ``--lookahead_size`` comes from the ``la`` size and is 32
277 .. _littlefs: https://github.com/littlefs-project/littlefs
278 .. _littlefs-FUSE: https://github.com/littlefs-project/littlefs-fuse