17.2.5 Program (Program) Command

The PROGRAM command instructs the PE to program the Flash memory, including configuration words, starting from the 32-bit address specified in the Addr_Low and Addr_High fields. A 32-bit length field specifies the number of bytes to program.

Align the address to a Flash row size boundary and the length must be a multiple of a Flash row size. See Table 5-1 for the correct row size for the device to be programmed.
Figure 17-7. Program (Program) Command
Table 17-6. Program (Program) Command
FieldDescription
Op code0x2
OperandNot used
Addr_LowLow16 bits of 32-bit destination address
Addr_HighHigh16 bits of 32-bit destination address
Length_LowLow16 bits of Length
Length_HighHigh16 bits Length
Data_Low_NLow16 bits data word 2 through N
Data_High_NHigh16 bits data word 2 through N
The following are three programming scenarios:
  • The length of the data to be programmed is the size of a single Flash row
  • The length of the data to be programmed is the size of two Flash rows
  • The length of the data to be programmed is larger than the size of two Flash rows

When the data length is equal to 512 bytes, the PE receives the 512-byte block of data from the probe and immediately sends the response for this command back to the probe.

The PE will respond for each row of data that it receives. If the data length of the command is equal to a single row, a single PE response is generated. If the data length is equal to two rows, the PE waits to receive both rows of data, then sends back-to-back responses for each data row. If the data length is greater than two rows of data, the PE will send the response for the first row after receiving the first two rows of data. Subsequent responses are sent after receiving subsequent data row packets. The responses will lag the data by one row. When the last row of data is received, the PE will respond with backto- back responses for the second-to last data row followed by the last row.
Figure 17-8. Program (Program) Command Algorithm
If the PE encounters an error in programming any of the blocks, it sends a failure status to the probe and aborts the PROGRAM command. On receiving the failure status, the probe must stop sending data. The PE will not process any other data for this command from the probe. The process is illustrated in Figure 17-8.
Note: If the PROGRAM command fails, the programmer must read the failing row using the READ command from the Flash memory. Then the programmer must compare the row received from the Flash memory to its local copy, word-by-word, to determine the address where Flash programming fails.

The response for this command is a little different than the response for other commands. The 16 MSbs of the response contain the 16 LSbs of the destination address, where the last block is programmed. This helps the probe and the PE maintain proper synchronization of sending and receiving data and responses.

Expected Response (1 word):
Figure 17-9. Program (Program) Response