README.rst
1.. zephyr:code-sample:: fs-format
2 :name: Format filesystem
3 :relevant-api: file_system_api
4
5 Format different storage devices for different file systems.
6
7Overview
8***********
9
10This sample shows how to format different storage
11devices for different file systems. There are 2 scenarios prepared for this
12sample:
13
14* littleFS on flash device
15* FAT file system on RAM disk
16
17Building and running
18********************
19
20To run this sample, build it for the desired board and scenario and flash it.
21
22The Flash scenario is supported on the nrf52dk/nrf52832 board.
23The RAM disk scenario is supported on the mimxrt1064_evk board.
24To build the RAM disk sample, the configuration :file:`prj_ram.conf` needs to be used by setting
25``CONF_FILE=prj_ram.conf``.
26
27The Flash sample for the nrf 52DK board can be built as follow:
28
29.. zephyr-app-commands::
30 :zephyr-app: samples/subsys/fs/format
31 :board: nrf52dk/nrf52832
32 :goals: build flash
33 :compact:
34
35The RAM disk sample for the MIMXRT1064-EVK board can be built as follow:
36
37.. zephyr-app-commands::
38 :zephyr-app: samples/subsys/fs/format
39 :board: mimxrt1064_evk
40 :conf: "prj_ram.conf"
41 :goals: build flash
42 :compact:
43
44Sample Output
45=============
46
47When the sample runs successfully you should see following message on the screen:
48.. code-block:: console
49
50 I: LittleFS version 2.4, disk version 2.0
51 I: FS at flash-controller@4001e000:0x7a000 is 6 0x1000-byte blocks with 512 cycle
52 I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
53 I: Format successful
54