Flash programming may also be performed by the boot application. The boot application can only program the full flash; it is not capable of partial flash updating and it cannot program EEPROM data. The primary usage of boot flash programming is for situations when the system cannot transition to the main application, such as an empty or corrupted flash.
The following commands are used to erase, program, and verify flash:
Figure 5-19 demonstrates the flash programming steps.
- Write Flash Interface Rate - Notifies the Boot Application of the maximum allowable flash interface speed and the read modes that the flash part supports. This is used to maximize flash SPI bandwidth in order to shorten flash programming time based on the selected flash part's capabilities. If this command is not sent prior to flash programming, a default speed of 10 MHz and only Fast Read will be used which may significantly slow programming operations. This default may also cause issues with the flash verification step since it does not meet the DLPC230 minimum flash bandwidth requirement.
- Write Flash Full Erase - Erases the entire flash.
- Flash Write Data - Repeatedly write a page (256 bytes) of flash data. If the desired data is less than 256 bytes, the remaining bytes should be set to 0xFF. After each section of data is written, read the short status repeatedly until the write has completed. Continue until there is no remaining flash data.
- Write Flash Interface Rate - This step is required if a quad read mode is desired. The boot application will disable quad mode in some flash devices during write operations. This step ensures that quad mode is enabled in the flash device prior to flash verification. The same data may be written for this step and step 1.
- Flash Verify Data - Begin verification of the flash data. This process may require significant time to complete. The Write Command Handler should expect additional time to poll the Short Status to confirm that the command tag has changed to the appropriate value and that the Request In Progress bit has been cleared. A flash verification error will flag the Command Error tag in the Short Status. This should be detected in the write command handling procedure.