5.9 Host File Download
The Host File Download is a feature supported in the ATWINC15x0 firmware version 19.6.1 and above. This feature is supported only in the ATWINC1510 device which has 8 Mb Flash. The ATWINC1500 only has 4 Mbit of Flash memory and therefore this feature is not supported for the ATWINC1500. With Host file download feature, the Host MCU can instruct the ATWINC1510 to download a file and save it in the ATWINC1510 Flash. The ATWINC1510 can download the file from a HTTP or a HTTPS web server only. The maximum size of file that can be stored in the ATWINC1510 is 508 KB. This feature is ideal for updating the firmware of host MCU. However, the feature is not limited to MCU OTA only.
When performing MCU OTA updates, there is no enforced file format, so the Application Developer can choose a strategy to perform integrity check validation on the received file. The WINC does not perform any integrity check on the downloaded file and therefore, it is recommended that the Application do it instead.
The feature is designed for single file support and allows for a maximum size of 508 KB. The driver protects against invalid access to the file stored in the WINC’s Flash by using file handlers to identify each file. If a new download starts or if the file is erased, access to the file partition is denied. Also, the application can request an explicit erase to delete the file from the ATWINC’s Flash, destroying any potentially confidential data.
The API m2m_ota_host_file_get
is used to download file from
remote location and store it in ATWINC1500 Flash. The
m2m_ota_host_file_get
can be used to download only one file at a
time. When the get file API is called again, the previously stored file is erased and
new file download is initiated.
To retrieve the downloaded file from the ATWINC1510 Flash,
m2m_ota_host_file_read_spi
or
m2m_ota_host_file_read_hif
API can be used by the host MCU. The
completion of file download is notified through the callback registered in
m2m_ota_host_file_get
API. The user can use the
m2m_ota_host_file_read_spi
or
m2m_ota_host_file_read_hif
API by passing required arguments to
initiate the file read from the WINC Flash.