|Home > Programmers Model > Memory maps > Preloading transfers|
To improve the efficiency of ROW WRITE commands that utilize the Command queue, transfers can be preloaded to the CTRL register by enabling either CMD_ACCEPT_IRQ, CMD_SUCCESS_IRQ, or CMD_FAIL_IRQ, or any combination of them.
When the APB master wants to utilize a ROW WRITE command with improved efficiency, it must send the command for Flash transfers back‑to‑back, and prevent Flash returning from the high‑voltage programming state.
The following figure shows the ROW WRITE timing diagram.
The ROW WRITE command sequence is divided into different phases that are the actions that software requires to support the preloading mechanism.
The A/D setup phase comprises write updates to the contents of the ADDR and DATA0 registers for the upcoming command.
In the write CTRL phase, when ready, software writes the CTRL register and initiates the transfer. The timing diagram shows that the GFB interface is ready to accept the command at t2 immediately, and the command then passes to the GFB.
After t2, hardware clears the CTRL register automatically, and asserts a CMD_ACCEPT_IRQ.
Software is in the Wait IRQ phase until it receives the interrupt. Software then enters the Serve IRQ phase where it must acknowledge the interrupt by clearing the IRQ_STATUS register. When the IRQ_STATUS register clears, the address and data for the next transfer can be set up before writing the next ROW WRITE command to the CTRL register.
To ensure that the preload mechanism works correctly, the write CTRL phase in t5 must finish before t7, when the GFB interface is ready with the next currently executed command, and able to accept new commands. Otherwise, an IDLE command is inserted in the ROW WRITE sequence, and the benefits of the ROW WRITE command are not used. Write commands for the embedded Flash are expected to require thousands of clock cycles, software can use this period to service the CMD_ACCEPT_IRQ and update all necessary registers.
The CMD_ACCEPT_IRQ is intended for ROW WRITE commands. However, all other commands can use this interrupt because the hardware implementation cannot restrict its use.
In situations when the software driver uses CMD_ACCEPT_IRQ for READ commands, the read data of the current READ command might be lost if the resulting interrupts are not processed in time. If this occurs, a READ_OVERFLOW_IRQ indicates this error. Reads through the APB slave interface and the internal generic APB registers are intended for debug purposes only, and therefore the CMD_SUCCESS_IRQ and CMD_FAIL_IRQ can be used for reads. When higher efficiency reads are required, you must execute AHB reads instead.
The following figure shows the ROW WRITE preloading flowchart.