.format Method


Formats the flash memory to create a flash disk; no transaction journal sectors will be allocated.


fd.format(totalsize as word, numstoredfiles as byte) as pl_fd_status_codes


One of the following pl_fd_status_codes, also affects fd.laststatus:

0 — PL_FD_STATUS_OK: Completed successfully.

1 — PL_FD_STATUS_FAIL : Physical flash memory failure (fatal).

4 — PL_FD_STATUS_INV_PARAM: Invalid argument have been provided for the invoked method.

16 — PL_FD_STATUS_FLASH_NOT_DETECTED: Flash IC wasn't detected during boot, fd. object cannot operate normally.

See Also:

Formatting the Flash Disk, Checking Disk Vitals, fd.mount, fd.ready




Desired number of sectors occupied by the disk in flash memory. Cannot exceed available space (fd.availableflashspace) and may be slightly corrected downwards for internal housekeeping reasons. Actual total size can be checked through the fd.totalsize.


Desired maximum number of files that the disk will allow to create. Actual maximum number of files will be adjusted automatically to be a multiple of four and not exceed 64 (for example, specifying 6 will result in the actual value of 8). If you specify 0, you will get 4 files.


This method will not allocate and transaction journal sectors, so disk transactions will be impossible. Use fd.formatj (recommended) to create the disk that will support transactions.

After formatting, the disk will be in the dismounted state and will need to be mounted (see fd.mount) before any disk-related activity can be successfully performed.

.format Method