2020-06-03 05:33 AM
Hello,
i need to use this flash memory with Quad SPI. I read the STM32 user manual and some examples of random evaluation boards.
I think that this first step initialization should be ok
static void MX_QUADSPI_Init(void)
{
/* USER CODE BEGIN QUADSPI_Init 0 */
/* USER CODE END QUADSPI_Init 0 */
/* USER CODE BEGIN QUADSPI_Init 1 */
/* USER CODE END QUADSPI_Init 1 */
/* QUADSPI parameter configuration*/
hqspi.Instance = QUADSPI;
hqspi.Init.ClockPrescaler = 2;
hqspi.Init.FifoThreshold = 4;
hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
hqspi.Init.FlashSize = 25;
hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_2_CYCLE;
hqspi.Init.ClockMode = QSPI_CLOCK_MODE_0;
hqspi.Init.FlashID = QSPI_FLASH_ID_1;
hqspi.Init.DualFlash = QSPI_DUALFLASH_DISABLE;
if (HAL_QSPI_Init(&hqspi) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN QUADSPI_Init 2 */
/* USER CODE END QUADSPI_Init 2 */
}
Knowing that i'm using 200MHz with internal oscillator.
But i don't know the other initialization parameters to put. Can you help me?
2020-06-03 10:40 AM
Tip of the iceburg there.
Most of the ICs will go 50 MHz
Real complexity is at the command level for the specific chips (Winbond W25Q256) for read, write, erase, etc.
Review the code for the Micron parts used in the F7/H7 DISCO/EVAL boards, see BSP code in the drivers directories of CubeF7/H7 archives.
2020-06-03 03:02 PM
Ok, just to be sure. Suppose i have the N25Q512A chip. I have stm32f769i_eval_qspi.h, stm32f769i_eval_qspi.c and n25q512a.h files taken from official BSP repository.
What should i do now?
Should i include stm32f769i_eval_qspi.h inside my main.c and, after calling MX_QUADSPI_Init();, should i call BSP_QSPI_Init();?
2020-06-08 07:55 PM
I did it by writing the driver from scratch.