Return to previous page Return to menu Go to next page

3.4 Data transfer

(1) Data transfer procedure

For commands that involve data transfer, the host must perform data transfer processing after the command / response. The procedure is shown below.

 (a) Execute a command (data extraction / writing) with data transfer.
(B) Wait for data transfer preparation (CDC_DataReady). (Wait for DRDY to become 1)
(C) Input / output data through the data transfer register.
Execute the CDC_GetDataPtr function to obtain the register pointer.
(D) When necessary data is transferred, end data transfer (CDC_DataEnd). 

(2) End of data transfer

If there is a data transfer request in the
status, the data transfer must be terminated even if there is an error even if the data is not actually transferred. Not required for REJECT and WAIT.
∙ If an error occurs while waiting for data transfer preparation, the application does not need to execute data transfer termination. It is automatically executed inside the preparation wait function.

(3) Data transfer error

Table 3.8 shows errors that occur while waiting for data transfer preparation.

Table 3.8 Data transfer error
 Data transfer error 
 Description 
 Data transfer time-out 
 The CD block is not ready for data transfer within the specified time. 
(DRDY flag is not 1)
 Reserving write sector 
Not possible
 Sector data writing cannot secure a free sector 
It was.
(DRDY flag remains 0, EHST flag is 1)

(4) Prohibited matters

When a command that involves data transfer is executed, the data is returned before the DRDY flag becomes 1. Do not perform a transfer termination. Even if data is not actually transferred, be sure to wait for the DRDY flag to become 1 before exiting. (Exit after waiting for data transfer preparation)


Return to previous page Return to menu Go to next page