1.. _stream_flash: 2 3Stream Flash 4############ 5The Stream Flash module takes contiguous fragments of a stream of data (e.g. 6from radio packets), aggregates them into a user-provided buffer, then when the 7buffer fills (or stream ends) writes it to a raw flash partition. It supports 8providing the read-back buffer to the client to use in validating the persisted 9stream content. 10 11One typical use of a stream write operation is when receiving a new firmware 12image to be used in a DFU operation. 13 14There are several reasons why one might want to use buffered writes instead of 15writing the data directly as it is made available. Some devices have hardware 16limitations which does not allow flash writes to be performed in parallel with 17other operations, such as radio RX and TX. Also, fewer write operations result 18in faster response times seen from the application. 19 20Persistent stream write progress 21******************************** 22Some stream write operations, such as DFU operations, may run for a long time. 23When performing such long running operations it can be useful to be able to save 24the stream write progress to persistent storage so that the operation can resume 25at the same point after an unexpected interruption. 26 27The Stream Flash module offers an API for loading, saving and clearing stream 28write progress to persistent storage using the :ref:`Settings <settings_api>` 29module. The API can be enabled using :kconfig:option:`CONFIG_STREAM_FLASH_PROGRESS`. 30 31API Reference 32************* 33 34.. doxygengroup:: stream_flash 35