You can store your data in a serial flash. Please take a look at Wiced/Platform/common/drivers/spi_flash/spi_flash.h for the readily available SPI flash API.
WICED evaluation boards come with a serial flash. Which WICED board are you using for your evaluation?
An alternative solution and more complicated solution is to extend the DCT (Device Configuration Table) to suit your need, although this approach really depends on the size of the data to store and the internal flash sector size of the MCU.
Note that the DCT uses two DCT blocks which are erased and written alternately. Consequently, enlarging the DCT area also reduces the amount of space available for your application.
How can I make sure that the OTA is not going to overwrite the content?
During OTA upgrade app downloading, WICED uses waf.sflash_write (serial flash writer app) in conjunction with OpenOCD and a TCL script to write the OTA upgrade application to the serial flash.
You may store your data after the OTA upgrade app or shift the OTA upgrade app and store your data at the start of the serial flash. Both ways you need to make sure they can fit into the serial flash.
A few example apps to look at:
- Apps/snip/ota_fr - OTA and factory reset app
- Apps/waf/ota_upgrade - example OTA upgrade app that is written into the serial flash
- Apps/waf/sflash_write - serial flash writer app