Can't read jedec id from the MT25TL512HBA8E12-0AAT TR using stm32h7
Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code.
i am trying to read the jedec id from the MT25TL512HBA8E12-0AAT TR using stm32h750xbh6 with qspi
i configured qspi using mx like follows:
hqspi.Instance = QUADSPI;
hqspi.Init.ClockPrescaler = 1;
hqspi.Init.FifoThreshold = 4;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_NONE;
hqspi.Init.FlashSize = 25;
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_6_CYCLE;
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
hqspi.Init.DualFlash = QSPI_DUALFLASH_ENABLE;
i configured the clock using rcc enabled hse and lse and finally giving the clock for qspi around 50mhz
the function im using to read is the below one
static HAL_StatusTypeDef QSPI_ReadID_3B(QSPI_HandleTypeDef *hq, uint8_t id[3]) {
QSPI_CommandTypeDef c = {0};
c.InstructionMode = QSPI_INSTRUCTION_1_LINE;
c.Instruction = 0x9F; // READ JEDEC ID (1-0-1)
c.AddressMode = QSPI_ADDRESS_NONE;
c.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
c.DataMode = QSPI_DATA_1_LINE;
c.DummyCycles = 0;
c.NbData = 3;
c.DdrMode = QSPI_DDR_MODE_DISABLE;
c.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;
c.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;
HAL_StatusTypeDef st = HAL_QSPI_Command(hq, &c, HAL_QSPI_TIMEOUT_DEFAULT_VALUE);
if (st != HAL_OK) return st;
return HAL_QSPI_Receive(hq, id, HAL_QSPI_TIMEOUT_DEFAULT_VALUE);
}its always returning only 0s
what are the issues.
what we have to keep in mind when we are doing this reading.
is there any proper procedure to follow
