Store arbitrary data on flash with WICED

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MuOr_1658816
Level 4
Level 4
First like received

How can I store large amounts of data (about 128kb) downloaded from a server on the platform using WICED?

0 Likes
1 Solution
Anonymous
Not applicable

Hi Mustafa,

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?

Regards,

Aji

View solution in original post

4 Replies
Anonymous
Not applicable

Hi Mustafa,

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?

Regards,

Aji

Hi Aji,

How can I make sure that the OTA is not going to overwrite the content?

Thanks

mustafa

0 Likes
Anonymous
Not applicable

Mustafa,

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


Regards,

Aji

0 Likes
Anonymous
Not applicable

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.

Regards,

Aji