The next step is the actual
programming of the image to the SFLASH. Programming is applied in chunks of 4096
bytes. The image can be either unencrypted or encrypted with a 16-byte symmetric
key.
- If the image is unencrypted, the key size is irrelevant and
uses a length of 0.
- If the image is encrypted, the key size must be 16 bytes. The
key buffer precedes the data chunk.
In both cases, flags are for future
use and must be 0. The procedure for programming the SFLASH follows:
- The main processor sends the FS Programming command in chunks
of 4096 bytes. The user must provide the following elements in order:
- Key size (in bytes for an encrypted image) must be 16,
otherwise 0.
- Chunk size (in bytes) must be 4096, except for the
last chunk, which may be smaller according to the residue from the total
size.
- Flags must be 0.
- Key buffer
- Data buffer
- The CC3100 or CC3200 device responds with an Ack followed by a 4-byte response indicating the accumulated number
of bytes received. The status for the last chunk must be 0 to indicate
successful programming, otherwise, a negative status is returned.
- Steps 1 and 2 repeat until the entire image is
programmed.
- The image gets extracted and the file system is created.
Figure 5-9 shows the programming procedure in a zoomed-out pane. The last status code is 0
to indicate a successful programming and is delayed in time to reflect the period of
image extraction.
Figure 5-10 shows the programming procedure in a zoomed-in pane for an unencrypted image.
Figure 5-11 shows the programming procedure in a zoomed-in pane for an encrypted image.