Skip to main content
Associate III
September 14, 2021
Question

N25Q128A13EF840F External Flash read write example

  • September 14, 2021
  • 2 replies
  • 1534 views

Hi,

I am new to QSPI. I working with stm32f469 disco that comes with external flash N25Q128A13EF840F. I had done the GUI part now I need to store data to external flash but I don't know how to do it. I had initialized qspi with STMCUBE default initialization. Any help

below is the way i had initialized

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 = 1;
 hqspi.Init.FifoThreshold = 1;
 hqspi.Init.SampleShifting = QSPI_SAMPLE_SHIFTING_HALFCYCLE;
 hqspi.Init.FlashSize = 24;
 hqspi.Init.ChipSelectHighTime = QSPI_CS_HIGH_TIME_5_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 */
 
}

This topic has been closed for replies.

2 replies

Amel NASRI
ST Technical Moderator
September 17, 2021

Hi @himsha​ ,

The following article may be helpful for you: Where can I find source code of external loader (.stldr) for STM32 devices?

If this was really helpful, we appreciate upvoting for it (at the bottom of the page).

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Tesla DeLorean
Guru
September 17, 2021

Should be BSP side code for these parts in CubeF4, and if not there CubeF7/H7 ones

Should provide write/erase coverage

STM32Cube_FW_F4_V1.25.0\Drivers\BSP\Components\n25q128a\n25q128a.h

STM32Cube_FW_F4_V1.25.0\Drivers\BSP\STM32469I_EVAL\stm32469i_eval_qspi.c

STM32Cube_FW_F4_V1.25.0\Drivers\BSP\STM32F413H-Discovery\stm32f413h_discovery_qspi.c

Examples for some .STLDR can be found under ST-LINK Utilities or STM32 Cube Programmer directories.

Got some prebuilt external loaders for different parts and pin combinations here

https://github.com/cturvey/stm32extldr

Don't have much F4 stuff online as demand is low, but could be convinced to fashion some.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..