Skip to main content
Visitor II
December 10, 2025
Question

how to run QSPI ?

  • December 10, 2025
  • 2 replies
  • 121 views

Post edited by ST moderator to be inline with the community rules for the code sharing. In next time please use </> button to paste your code and a linker script content. Please read this post: How to insert source code.

Hi everyone,

I'm trying to interface an ICNA3306 LCD display using STM32's QSPI peripheral. The LCD uses a custom protocol where commands are sent as:

  • Instruction: 0x02 (8 bits, 1-wire)
  • Address: 0x00, CMD, 0x00 (24 bits, 1-wire)

Expected behavior: 32 clock pulses (8 instruction + 24 address) Actual behavior: Only 8 clock pulses (instruction only - address phase not transmitted)

Here's my code:

HAL_StatusTypeDef ICNA3306_WriteCommand(uint8_t cmd)
{
QSPI_CommandTypeDef sCommand = {0};

sCommand.InstructionMode = QSPI_INSTRUCTION_1_LINE;
sCommand.Instruction = 0x02;

sCommand.AddressMode = QSPI_ADDRESS_1_LINE;
sCommand.AddressSize = QSPI_ADDRESS_24_BITS;
sCommand.Address = (0x00 << 16) | (cmd << ‌‌ | 0x00;

sCommand.AlternateByteMode = QSPI_ALTERNATE_BYTES_NONE;
sCommand.DataMode = QSPI_DATA_NONE;
sCommand.DummyCycles = 0;
sCommand.DdrMode = QSPI_DDR_MODE_DISABLE;
sCommand.SIOOMode = QSPI_SIOO_INST_EVERY_CMD;

return HAL_QSPI_Command(&hqspi, &sCommand, HAL_MAX_DELAY);
}

 

QSPI Configuration:

hqspi.Init.ClockPrescaler = 13;
hqspi.Init.FifoThreshold = 4;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
hqspi.Init.FlashSize = 23;
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_6_CYCLE;
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;

 

Oscilloscope shows:

luisfynn1_0-1765352949409.png

 

and then right waveform is below:(make QSPI using GPIO)

luisfynn1_1-1765352987189.png

 

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    December 10, 2025

    Hello,

    I don't see any relation between the title and the request. Could you please clarify?

    luisfynn1Author
    Visitor II
    December 10, 2025

    oh I am sorry.

    I fixed it.

    Technical Moderator
    December 10, 2025

    You need also to provide the MCU product part number you are using.

    How to write your question to maximize your chances to find a solution