Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
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 followed the directions in the thread you linked to, in particular defining FR_APP to be a legit factory default app.
The magic that is required to format/init the serial flash (and this isn't at all clear from the linked thread) is to add "download_apps" to the build target (without the quotes). This causes a serial flash downloader to be built and downloaded to your target. That program then initializes the serial flash using an application LUT and downloads any apps you've defined (in my case FR_APP).
Subsequent calls to get/set size, write chunk, etc. now work properly.