Skip to main content
DPila.1
Associate II
March 1, 2023
Solved

STM32 with External QSPI Flash & SDRAM execution

  • March 1, 2023
  • 5 replies
  • 3895 views

I am using STM32H7xx MCU with External QSPI Flash and SDRAM.

I want to download my code using STMCubeIDE directly to External QSPI Flash and once done I want to execute the same code from SDRAM without compromising the debugging ability using STMCubeIDE. Can someone help me with some procedure here.

This topic has been closed for replies.
Best answer by ChahinezC

Hello @DPila.1​,

For the  External QSPI Flash, I advise you to check the MOOC External QSPI loader how to.

For the SDRAM execution, the memory-mapped mode allows all AHB masters to access the Quad-SPI memory as an internal memory and to execute the code from the Quad-SPI memory. You can refer to the AN4760.

Best regards,

Chahinez.

5 replies

Tesla DeLorean
Guru
March 1, 2023

Generally one needs code to bring up the external interfaces, this normally comes in the form of a small loader you debug into initially, or a debug script that brings up the hardware, ie RCC, GPIO, QSPI, FMC, etc.

That way the MCU just accesses the memories in way that the debugger simply uses.

Debug scripts in Keil are a bit convoluted, given the complexity of the interfaces and bring-up expectations. I'd probably go with the loader method, or partition the code, so I could break-point in Internal FLASH at a point everything was up, and step in from there.

CMSIS typically expects SystemInit() to do ALL this prior to the C runtime initializing, and jumping to main().

CubeMX/HAL seems to be more backassward, and does this type of initialization early in main(), which is too late. Thus having a staged load, where you have a simple app in FLASH, and then transfer control to an app in QSPI, or unpacked / loaded into SDRAM.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
DPila.1
DPila.1Author
Associate II
March 2, 2023

Thank you for the response.

ChahinezC
ChahinezCBest answer
Associate II
March 1, 2023

Hello @DPila.1​,

For the  External QSPI Flash, I advise you to check the MOOC External QSPI loader how to.

For the SDRAM execution, the memory-mapped mode allows all AHB masters to access the Quad-SPI memory as an internal memory and to execute the code from the Quad-SPI memory. You can refer to the AN4760.

Best regards,

Chahinez.

DPila.1
DPila.1Author
Associate II
March 2, 2023

Yes, I just found this method online on youtube, now I am going to implement the same. Hope to get it working quickly. Thanks though.