4 Replies Latest reply on Feb 7, 2015 10:21 AM by userc_13198

    Initializing/formatting Serial Flash for multi application file system?

      We have developed a board based on the ISM44362 and included a 16 Mbit external serial flash (SST25VF016B).  I am working on the code for OTA updates to the application running on the board.  I want to store my updated app on the external serial flash, then reboot the board to install the new application as is shown in the OTA example code.


      I reviewed the wiced_ota_server.c code, in particular the section where wired_framework_app_open() is called, along with getting/setting sizes.  This code has been implemented in my application, followed by calls to wiced_framework_app_write_chunk() to store chunks of the OTA received application data.  I am seeing failures when I call wiced_framework_app_write_chunk().


      I have previously erased the serial flash using sflash_chip_erase().  Tracing through the wiced code, I observe that in wiced_apps_get_size(), there is a call to sflash_read to read the app header.  The app header contains "1's" in all data fields (probably due to the erase), and nonsensical values are calculated for addresses and sizes in various functions inside of wiced_apps_common.c because of this.


      Is there a way to format/initialize the serial flash to make it look like a multi-application file system?

      What is the right way to erase an existing app and write a new one in its place (i.e. when I update from v1.0 to v2.0 to v3.0 etc.)


      I am running Wiced SDK 3.1.2.