4 Replies Latest reply on Jan 30, 2014 2:53 PM by userc_2167

    Store arbitrary data on flash with WICED

    MuOr_1658816

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

        • 1. Re: Store arbitrary data on flash with WICED

          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

          • 2. Re: Store arbitrary data on flash with WICED

            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

            • 3. Re: Store arbitrary data on flash with WICED
              MuOr_1658816

              Hi Aji,

               

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

               

              Thanks

              mustafa

              • 4. Re: Store arbitrary data on flash with WICED

                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