How to run parts of the program from external QSPI
I would to use the cheap STM32F750N8-DISCO evaluation board to run a ETH/I2C/SPI/IR/encoder/touch-screen application but the 64K of flash is very little for my program.
Now my program run a STM32F746G-DISCO with 1Mbit of flash and it use about 450K.
I use also the QSPI N25Q128A to store the static images.
Is possible boot the program from QSPI or move part of the program in QSPI to save flash space ?
For the images I use this following method.
#include <stdint.h>
#pragma pack(push, 1)
typedef struct Center2_tagBITMAPFILEHEADER {
uint16_t bfType;
uint32_t bfSize;
uint16_t bfReserved1;
uint16_t bfReserved2;
uint32_t bfOffBits;
} Center2_BITMAPFILEHEADER; // size is 14 bytes
typedef struct Center2_tagBITMAPINFOHEADER {
uint32_t biSize;
uint32_t biWidth;
uint32_t biHeight;
uint16_t biPlanes;
uint16_t biBitCount;
uint32_t biCompression;
uint32_t biSizeImage;
uint32_t biXPelsPerMeter;
uint32_t biYPelsPerMeter;
uint32_t biClrUsed;
uint32_t biClrImportant;
} Center2_BITMAPINFOHEADER; // size is 40 bytes
typedef struct Center2_tag_Struct {
// offset 0, size 14
Center2_BITMAPFILEHEADER fileHeader;
// offset 14, size 40
Center2_BITMAPINFOHEADER infoHeader;
// offset 54, size 129600 words
uint16_t data[129600];
} Center2_Struct;
#ifndef IMG_NO_DATA
#if defined ( __ICCARM__ )
#pragma location = ".textqspi"
#else
__attribute__((section(".textqspi")))
#endif
const Center2_Struct Center2 = {
...
}
#else
extern const Center2_Struct Center2;
#endif
#pragma pack (pop)