cancel
Showing results for 
Search instead for 
Did you mean: 

Can QSPI flash store large program memory code?

JChen.24
Associate III

 Hi,

I am using STM32F746G_DISCO board to create different pages for the LCD. I see only one page with 4 tabs project already takes 300KByte flash memory code space. The STM32F746 only has 1MByte flash. So I like to store the LCD graph code related modules to QSPI NOR flash on the discovery board and store other portions of firmware in STM32 flash. I see the QSPI_ExecuteInPlace example copies the .qspi section from LMA to VMA, then run from VMA(in QSPI flash). But the .qspi section also occupy the MCU internal flash space. Is there a way I can move section from internal to external flash, not copy?

The question is internal 1Mbytes flash is not enough to handle a few LCD pages plus other functionalities. In this case, how to use QSPI flash to share the load for program code space?

2 REPLIES 2

The linker script / scatter file needs an actual QSPI memory region, at 0x90000000, and you need to direct content into that region rather than the internal memory region.

STM32Cube_FW_F7_V1.15.0\Projects\STM32746G-Discovery\Examples\QSPI\QSPI_PreInitConfig\SW4STM32\STM32746G-DISCOVERY\STM32F746NGHx_FLASH.ld

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
JChen.24
Associate III

Thank you, Tesla.

In the QSPI_PreInitConfig example, how to put const array data to QSPI flash? I try to declare as follows, but cannot pass compiler. error: 'img2' causes a section type conflict with 'GpioToggle'

 __attribute__((section(".qspi")))

 const unsigned char img2[2] =

 {

 0xFF, 0xFF

 };