For enabling the QSPI mode, you need to set QEN bit of configuration bit and for that you have to send write enable command followed by 16 bit value of status register and configuration register. In that sequence CS# should be low.
given in data sheet. i have attached screen shot
but when I write code for enabling command given below
int32_t QSPI_EnterQPIMode(QSPI_HandleTypeDef *Ctx)
{
QSPI_CommandTypeDef s_command;
uint8_t reg_data[] = {0x02, 0x02};
/* Enable write operations */
s_command.InstructionMode = QSPI_INSTRUCTION_1_LINE;
s_command.Instruction = 0x01; /* equal on both memory types */
s_command.AddressMode = QSPI_ADDRESS_NONE;
s_command.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
s_command.DataMode = QSPI_DATA_NONE;
s_command.DummyCycles = 0;
s_command.NbData = 2;
s_command.DdrMode = QSPI_DDR_MODE_DISABLE;
s_command.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
s_command.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
if (HAL_QSPI_Command(&QSPIHandle, &s_command, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
return QSPI_ERROR;
}
if (HAL_QSPI_Transmit(&QSPIHandle, reg_data, HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
return QSPI_ERROR;
}
return QSPI_OK;
}
the CS# pin get two time HIGH_LOW sequence, where in datasheet(screen shot above) it should be done in consecutive.
CS# pin screen shot for enterQPI mode.
i think because of this i am not getting proper result, so if I manipulate CS pin, result would be proper. correct if am wrong .
thanking you