2021-07-08 06:47 PM
The Hardware Configuration is
/* Initialize QSPI Lines
*
* GPIO Pin Function
* PE7 : QSPI_BK2_IO3
* PFE8 : QSPI_BK2_IO2
* PE9 : QSPI_BK2_IO1
* PE10 : QSPI_BK2_IO0
* PA7 : QSPI_CLK
* PC12 : QSPI_BK2_NCS
* */
GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; // alternate function
GPIO_InitStruct.Pull = GPIO_PULLUP;//GPIO_NOPULL; // Enable internal pull ups in device for IO lines
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_12; // CS
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;//GPIO_MODE_OUTPUT_PP; //GPIO_MODE_AF_PP;// GPIO_MODE_OUTPUT_PP; // // alternate function disabled
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_7; // CLK
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; // alternate function
GPIO_InitStruct.Pull = GPIO_NOPULL; // alternate function
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
------------------------------------------------------------------------------------------------------------------
2021-07-08 11:57 PM
Hello @PRama.3 ,
What microcontroller and what cube firmware version you're using?
Best regards,
@SBEN .2
2021-07-09 01:16 AM
Missing a lot of salient detail.
What STM32 part?
How is the AF setting for the pin configured?
Any relevant QSPI initialization or related code?
Assume few here are psychic, express detail.
2021-07-09 08:42 AM
I am using STM32F469VGT6 (LQFP100 Part).
The intitialization of QSPI Lines in alternate mode GPIO:
/* Initialize QSPI Lines
*
* GPIO Pin Function
* PE7 : QSPI_BK2_IO3
* PFE8 : QSPI_BK2_IO2
* PE9 : QSPI_BK2_IO1
* PE10 : QSPI_BK2_IO0
* PA7 : QSPI_CLK
* PC12 : QSPI_BK2_NCS
* */
GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; // alternate function
GPIO_InitStruct.Pull = GPIO_PULLUP;//GPIO_NOPULL; // Enable internal pull ups in device for IO lines
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_12; // CS
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;//GPIO_MODE_OUTPUT_PP; //GPIO_MODE_AF_PP;// GPIO_MODE_OUTPUT_PP; // // alternate function disabled
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_7; // CLK
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; // alternate function
GPIO_InitStruct.Pull = GPIO_NOPULL; // alternate function
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
// Set QSPI NCS to inactive state- Pull High
// HAL_GPIO_WritePin(GPIOC, GPIO_PIN_12, GPIO_PIN_SET);
The QSPI init code is attached in the file
2021-07-09 08:50 AM
Cube FW version is 6.2.0 and STMCube FW package for STM32F4 series is 1.26.1
2021-07-09 09:18 AM
You're not configuring the pins properly
NCS is not driven manually with QSPI, it needs to be under the control of the QSPI peripheral
The pins aren't associated with the QSPI peripheral via the AF mux selection
Review the AF pin tables in the Data Sheet for your part
PE10:AF10
PE9:AF10
PE8:AF10
PE7:AF10
PA7:AF10
PC12 NO needs to be PC11:AF9 for QUADSPI_BK2_NCS
2021-07-09 09:19 AM
https://www.st.com/resource/en/datasheet/stm32f469vg.pdf
2021-07-09 09:26 AM
OK . Thanks - Will look into this and report back.
2021-07-09 09:58 AM
Things apt to fail in the auto-polling loops, or where time-outs expire because the chip is not responding.
For erase make sure timeout covers expected time for completion and device to report as ready.
Write Enable waits for an acknowledgement / change in status, will fail if communication issue.
Read ID should be fairly instructive, pull whole data pages, didn't deep-dive this MX part, but usually there's more data and serialization info than just mfg/part info.
Check Read, Read Dual type commands first. Check if Quad needs enabling, check Read Quad
Check Erase
Check Write with simple patterns, similarly Write Dual, Write Quad, expectations in dummy clocks, page size, and write timing.
2021-07-09 04:03 PM
I tried with changed configuration
Write enable fails at this point
if (HAL_QSPI_AutoPolling(&hqspi, &sCommand, &sConfig,
HAL_QPSI_TIMEOUT_DEFAULT_VALUE) != HAL_OK) {
return HAL_ERROR;
}