Starting socket index and first partition index;
0 ≥ index ≥15. The default is 0,0.
Use this to give multiple drivers unique IDs.
The -i option is just a suggestion for the resource
database manager; the selected indexes can be larger.

-Llimit

The number of retries to make if the physical flash erase function for a unit fails.
The default is 0.

-l

List the available flash databases and then exit.

-mmountover

Override the mountpoints assigned to the file system that are formatted
with an empty (i.e., flashctl -p/dev/fs0p0 -f -n "") mountpoint. The mountover
argument can include two
%X format specifiers (like those for printf())
that are replaced by the socket index and the partition index.

Set the background-reclaim percentage trigger (stale space over free
space) and, optionally, the superseded extent limit before reclaim.
The default is 100,16.

-R

Mount any automount filesystems as read-only.
This option doesn't affect raw partition mounts, and it has an effect
only at startup and initialization.
Any subsequent mounting (with either
flashctl
or
mount)
ignores the -R option.
If you also specify the -a option, the driver ignores the
-R option.

If you don't specify -r, and a power failure occurs,
the following can happen:

You can waste space.
If an erasure was happening when the power was cut off,
there will be some "dangling" extents (i.e., marked for
deletion, but not actually deleted).
If you specify the -vv option, the driver prints
dangle for every dangling extent found.
These extents will continue to occupy space forever, until they're
deleted.
Using the -r option will cause them to be reclaimed.

The system may be marked as read-only.
If the driver detects an error in the structure of the filesystem,
and you haven't specified the
-r option, the driver marks the partition as read-only,
so that it can't be further damaged.

If a reclaim operation is interrupted by a power loss, the spare block
may be unusable.
In this case, if you specify the -vv option, the driver prints
partial to the console.
The partition is still read-write, but reclaims are turned off;
if you continue to overwrite files, you'll eventually fill the
filesystem with stale data.

-Ssector_erase_latency

Set the simulated sector erase latency in milliseconds (max = 10000).

-sbase[,wsize[,aoffset[,asize[,usize[,bwidth[,ileave]]]]]]

Set socket options, normally the base physical address, window size,
array offset, array size, unit size, bus width, and interleave. The format is left flexible
for socket services with customized drivers. This option must be specified.

The arguments are:

base

Physical base address of the flash part. This value is board-specific.

wsize

Size of the physically contiguous flash part.

aoffset

For SRAM, the offset from the base address to the start of the flash array.

asize

For SRAM, the size of the flash array. The default is equal to
wsize.

usize

The size of a physical erase sector. For SRAM, this number can be any
power of two. 64 KB should be the minimum, for performance reasons.

bwidth

The total width of the data bus, as seen from the microprocessor's
perspective. This is the width of one flash chip multiplied by the
interleave.
The value must be a power of 2 (1, 2, 4, or 8).

ileave

The number of flash chips arranged on the data bus.
Two 16-bit wide chips used as the upper and lower halves of a 32-bit
databus give an interleave of 2.
This number must be a power of 2 (1, 2, 4, or 8).

You can specify the base physical address, sizes, and offset
in octal (1000), hexadecimal (0x200), or
decimal (512).
The sizes must be a power of two, and you can specify them with any of
the following suffixes:

(nothing) — bytes

k — kilobytes

m — megabytes

-Tmax_erase_diff

Set the threshold value (maximum erase count − minimum erase count
in a partition) to trigger wear-levelling.
The default value is two times the sector number in the partition.
Typically, for very large partitions containing more than 1000 sectors,
you should use this option to specify a threshold (for example, 1000)
to make the sector erasure counts more evenly distributed across the
entire partition.

-thi_water[,lo_water[,max]]

Set the high water, low water, and maximum attributes of the thread pool;
the increment (i.e., the number of threads created at one time) is 1.
The default is 4,2,100.
The values must be related as follows:

0 < hi_water < max

0 ≤ lo_water ≤ hi_water

hi_water < max ≤ 100

-uupdate

Specify the update level for timestamps.
POSIX specifies that timestamps be kept when you access, create, or
modify a file.
FFSv3 is documented as not supporting the access
timestamp, in order to reduce wear on the hardware.

The values for update are:

0 — don't update the modification time for files (the default).

1 — update the modification time for files according to the POSIX rules.

2 — update the modification time for files, as well as for
the parent directory.

Note:
The -u2 option is very, very expensive and will cause many
reclaims because the time updates have to flow right up to the root
directory, so one file update may cause many directory updates.

-V

Display filesystem and MTD version information, and then exit.

-v

Be verbose; specify additional v characters for more verbosity.
For more information, see
"Verbose output,"
below.

-Wnum

Use the workaround identifed by num.
The workarounds available (if any) depend on the board.

-wbuffersize

Write (append) buffer size in bytes.
The default buffersize is 512.
Using a larger write buffer prevents the creation of very small extents, reducing overhead.
If buffersize is 0, appending is disabled.

Description:

The devf-generic manager provides Flash filesystem
support for any standard flash device. Typically, all you need to do is to pass
the address and size using the -s option. The manager should detect the
device automatically.

For information on creating a custom variant of devf-generic
for your embedded system, see the
Customizing the Flash Filesystem
chapter of Building Embedded Systems

The default filenames are as follows (you can use the -i option to
change the ID, n, appended to /dev/fs):

You can specify the mountpoint above with the
mount attribute of the
mkefs
command, and override it with the
-n option to
flashctl.
By default, it's /fsnp0.

Note:

If you erase a raw partition or the raw array (socket),
you might erase any boot monitor,
BIOS, or other data installed by the manufacturer.
Check the documentation for the board.

You can't erase multiple partitions simultaneously.

The driver probes the hardware to determine its block size.
If you need to know the block size, you can:

Look in the documentation for the hardware.

Or:

Start the driver in verbose mode by specifying the -v option.
In the output, U: indicates the number of units (also known as
blocks or sectors),
and S: indicates the block size.
Both numbers are in hexadecimal.

The block size is the effective physical block size of the NOR chip
(i.e., the chip sector size multiplied by the interleave).
This is used for erasing; the filesystem itself uses variable-sized extents to store data.

The devf-* drivers support 32- and 64-byte error-correcting code (ECC) partitions.
If you use 32-byte ECC:

The interleave of the flash chips must be 1, or the driver reports an error.

If you specify the -v option, a devf-* driver provides
some useful information.
This section describes the output that you get if you specify -vvv;
at higher levels of verbosity, the output also includes messages about the
use of malloc() and free(), but these aren't likely
to be useful to you.

After identifying the hardware, the driver prints the geometry.
The chip total is the number of contiguous chips.
The bus width is the size of the data bus, in bytes.
The interleave is the number of physical chips sharing
the data bus (high and low halves of the data bus, for example).

This particular example indicates that there are two physical chips
sharing a 64-bit data bus.

(devf t1::f3s_skt_attach:135) fs0 array SRAM U: 80 S: 020000

The flash driver has allocated the flash array
(i.e., the storage media) of type SRAM, with 0x80 hardware sectors,
and a sector size of 0x020000 bytes.

(devf t1::f3s_recover_boot:248) fs0p0 boot P[00] U: 80

The filesystem is now scanning for partitions.
It has found a boot header, and has named the partition
/dev/fs0p0. The boot signature is located on physical
block 0, and the partition has 0x80 sectors (called "units" in
devf-* nomenclature).

(devf t1::f3s_recover_reclaim:989) fs0p0 spare P[7F]

The second phase of the startup scan is processing
/dev/fs0p0, and has found a spare block.
The spare block is located on physical sector 0x7F.

(devf t3::f3s_table_find:66) fs0p1 raw U: 09

A region of flash was found that isn't formatted.
The region is given the name /dev/fs0p1; its size is 0x09
sectors.

Examples:

Start devf-generic and automatically mount the flash filesystem
partitions at the base address 0xFF000 with a window size of 16 megabytes,
with an initial fault recovery process, most POSIX semantics
enabled and background reclaim at priority 5:

Access times aren't updated on the media; they're set to the modification time.

QNX Neutrino flash filesystem version 3 no longer
provides built-in decompression.
The flash filesystem's decompression functionality has moved into the
inflator
resource manager. You should now use the deflate utility
to compress files.

Performance might be slow when multiple writers are writing randomly
to a shared file or to a shared directory (e.g., using unlink or
rename).
In these cases,
the offset pointers have to be rewound for every access.
There's no performance penalty when appending to a file, or when
creating files with open(O_CREAT),
mkdir, mknod, or link.