Skip to main content
Visitor II
May 6, 2025
Question

STM32F446RE QSPI in single line mode not transmitting

  • May 6, 2025
  • 2 replies
  • 369 views

Hello,

I am attempting to set up QSPI to operate in classic SPI mode so that I can transmit data to another STM32 processor. I have set up my code as followed and have connected my QSPI lines to an oscilloscope and a half duplex SPI slave on the same board for testing. I am unable to see any signals being sent over the QSPI lines. Have I setup my QSPI_CommandTypeDef incorrectly or am I missing necessary HAL commands?

QSPI_HandleTypeDef hqspi;
SPI_HandleTypeDef hspi1;
uint8_t test_data = 6;
uint8_t hold;

QSPI_CommandTypeDef cmd = {
		.Instruction = QSPI_INSTRUCTION_NONE,
		.InstructionMode = QSPI_INSTRUCTION_1_LINE,
		.DummyCycles = 0,
		.Address = QSPI_ADDRESS_NONE,
		.AddressMode = QSPI_ADDRESS_1_LINE,
		.AddressSize = QSPI_ADDRESS_24_BITS,
		.AlternateByteMode = QSPI_ALTERNATE_BYTES_1_LINE,
		.DataMode = QSPI_DATA_1_LINE,
		.NbData = 0,
};

void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_QUADSPI_Init(void);
static void MX_SPI1_Init(void);

int main(void)
{
 HAL_Init();
 SystemClock_Config();
 MX_GPIO_Init();
 MX_QUADSPI_Init();
 MX_SPI1_Init();
 while (1)
 {
	HAL_QSPI_Command(&hqspi, &cmd, 100);
	HAL_QSPI_Transmit(&hqspi, &test_data, 100);
	HAL_Delay(100);
	HAL_SPI_Receive(&hspi1, &hold, 1, 100);
 }
}

 

    This topic has been closed for replies.

    2 replies

    Graduate II
    May 7, 2025

    Perhaps focus on the QSPI first.

    Check the code initializing the pins.

    Reflect on setting the data length correctly in NbData

    Perhaps look at QSPI examples in the Cube F4 repo for send commands to a NOR FLASH, confirm you can see/capture that transaction on your scope/analyzer

    ST Employee
    June 25, 2025

    Hello @Bennett-Geo 

     

    Could you confirm the exact board you're using? Is it a NUCLEO-F446RE ?

    If so, please check the pins assigned to QSPI by referring to both the STM32F446RE datasheet and the User manual (UM1724)

    Kind regards,