2025-01-22 10:08 PM
Hello,
I am currently working on an embedded project using an STM32G071 microcontroller. Due to the complexity of the application, I am running into limitations with the internal flash memory of the microcontroller. I am exploring the possibility of using an external SPI flash (MX25L6433F) memory to overcome this limitation.
Can external SPI flash memory be seamlessly integrated with STM32 microcontrollers to compensate for insufficient internal flash? If possible, how can this be implemented?
2025-01-22 10:25 PM
You have to create bootloader that starts the SPI or QuadSPI, put it in MemoryMapped mode and then jumps to the application that you have to load on it.
To load an application on SPI or QuadSpi, you have to create an external loader according to your hardware and provide it to STM32CubeIDE or CubeProgrammer in order to be able to upload a code through STLink.
Hope it helps.
greetings
2025-01-22 10:47 PM - edited 2025-01-22 10:49 PM
There are two ways of doing this if your internal flash is not enough to fit the code and data.
1. Split your code and data. Store your code in internal flash and the data in external SPI flash. The SPI flash connect and working in 4-line mode, NSS, SPI_MISO, SPI_MOSI, SPI_CLK.
2. Mapping your code and data in external SPI flash, if your code is too big to fit into internal flash after splitting the code and data. SPI is working in QuadSPI which could be mapping in memory map.
In both way, you need to secure the SPI pins of the MCU for external flash connection, esp. in QuadSPI mode. Also you need to put your code and/or data into external flash using some methods such as an SPI programmer.