The QUADSPI module sent extra one clock to get data
When I sent an SPI commnad to get the status from an SPI NAND, an extra clock was sent by the STM32F4.
I chedked the waveform with a logic analyzer.
An 8-bit command was sent to D0.
An 8-bit address was sent to D0.
There were 9 clocks sent by the controller to get data from D1.
I expected only 8 clocks.
The behavior of the SPI slave or SPI NAND was correct. It replied the 8-bit data normally.
The board I used is NUCLEO-F412ZG.
The tool I use is STM32CubeIDE.
The code I worte was given below.
/////////////////////
QSPI_CommandTypeDef sCommand;
QSPI_AutoPollingTypeDef sConfig;
/* Configure automatic polling mode to wait for memory ready ------ */
sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
sCommand.Instruction = READ_STATUS_REG_CMD;
sCommand.AddressMode = QSPI_ADDRESS_1_LINE;
sCommand.AddressSize= QSPI_ADDRESS_8_BITS;
sCommand.Address = addr;
sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
sCommand.DataMode = QSPI_DATA_1_LINE;
sCommand.DummyCycles = 0;
sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
sCommand.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
sCommand.NbData = 1;
//check the status automatically
sConfig.Match = match;
sConfig.Mask = mask;
sConfig.MatchMode = QSPI_MATCH_MODE_AND;
sConfig.StatusBytesSize = 1;
sConfig.Interval = 0x10;
sConfig.AutomaticStop = QSPI_AUTOMATIC_STOP_ENABLE;
if (HAL_QSPI_AutoPolling(&hqspi, &sCommand, &sConfig, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
return HAL_ERROR;
}
return HAL_OK;
/////////////////////

