AnsweredAssumed Answered

QuadSPI read with data only phase (Indirect mode)

Question asked by juan luis ferrando on Feb 14, 2018
Latest reply on Apr 2, 2018 by Clive One

Hi all,

I am trying to read from the QuadSPI peripherial but with data only phase removing the rest of the phases (no address, no dummy, no instrucction and no alternate). The problem is that as described in the manual there are to ways to trigger the conversion:

---------------------------

Indirect-read mode (FMODE = 01)
Communication starts immediately if:
•A write is performed to INSTRUCTION [7:0] (QUADSPI_CCR), and if no address is required (ADMODE=00).
•A write is performed toADDRESS [31:0] (QUADSPI_AR), and if an address is necessary (ADMODE!=00)
------------------------------------------------------
I have tried both but I cannot actually read any data. For the first one (writting the instructtion of quadspi_CCR register) I have tried the following code:
----------------------
//config:
  sCommand_qspi.InstructionMode   = QSPI_INSTRUCTION_NONE;
  sCommand_qspi.AddressMode       = QSPI_ADDRESS_NONE;
  sCommand_qspi.Address           = ((uint32_t)0x0050);
  sCommand_qspi.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
  sCommand_qspi.DataMode          = QSPI_DATA_4_LINES;
  sCommand_qspi.DummyCycles       = 0;
  sCommand_qspi.NbData            = 4;
  sCommand_qspi.DdrMode           = QSPI_DDR_MODE_DISABLE;
  sCommand_qspi.DdrHoldHalfCycle  = QSPI_DDR_HHC_ANALOG_DELAY;
  sCommand_qspi.SIOOMode          = QSPI_SIOO_INST_ONLY_FIRST_CMD;
//set functional mode as Indirect read mode
  MODIFY_REG(hqspi.Instance->CCR, QUADSPI_CCR_FMODE, ((uint32_t)QUADSPI_CCR_FMODE_0));
      /* Start the transfer by writing the address CCR register */
      __IO uint32_t *data_reg = &hqspi->Instance->DR;
          MODIFY_REG(hqspi->Instance->CCR, QUADSPI_CCR_INSTRUCTION, 0x03);

 

          while(hqspi->RxXferCount > 0)
          {
            /* Wait until FT or TC flag is set to read received data */
            status = QSPI_WaitFlagStateUntilTimeout(hqspi, (QSPI_FLAG_FT | QSPI_FLAG_TC), SET, tickstart, 100);     
       if  (status != HAL_OK)
            {
              break;
            }

 

            *hqspi->pRxBuffPtr++ = *(__IO uint8_t *)data_reg;
            hqspi->RxXferCount--;
          }
-------------------------------
but It actually just send a few cycles to read instruction from memory. The subsequent read data commands are not working and it does not generate the clock pulses to read the samples.
The second option was to wirte the address register as described in the manual, but it does not work for my application since it only seems to work when the address is sent as header (ADMODE!=00) and this is not what I would like to do. In all the functions of HAL driver the reception starts like this:
WRITE_REG(hqspi->Instance->AR, addr_reg);
But as I mentioned before I do not want to include the Address header in my read.
In the manual it clearly states the following:
------------
The QUADSPI communicates with the Flash memory using commands. Each command
can include 5 phases: instruction, address, alternate byte, dummy, data. Any of these
phases can be configured to be skipped, but at least one of the instruction, address,
alternate byte, or data phase must be present.
---------------------------------
So apparently data phase only should be possible.
Could you please provide some guidance for this?
BTW, the micro is STM32H743XI (development board)
Many thanks.
Best regards,
Juan Luis

Outcomes