Skip to main content
Graduate
March 21, 2024
Question

External nor flash partitioning

  • March 21, 2024
  • 1 reply
  • 1293 views

I am using STM32L562E-DK that has an MX25LM512 external nor flash memory connected to the STM32 that uses OCTOSPI communication. I am using the example OSPI_NOR_ExecuteInPlace found in https://github.com/STMicroelectronics/STM32CubeL5/tree/master/Projects/STM32L562E-DK/Examples/OCTOSPI. In the example, the linker script is modified as follows so that the function GpioToggle is written in the external memory and executed from there: 

MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K
ROM (rx) : ORIGIN = 0x8000000, LENGTH = 512K
QSPI (xrw) : ORIGIN = 0x90000000, LENGTH = 65536K

}

/* For functions in QSPI memory */

_ospi_nor_init_base = LOADADDR(.ospi_nor);
_ospi_nor_init_length = SIZEOF(.ospi_nor);

.ospi_nor :
{
. = ALIGN(4);
_ospi_nor_start = .; /* create a global symbol at qspi start */
*(.ospi_nor) /* .ospi_nor sections */
*(.ospi_nor*) /* .ospi_nor* sections */
. = ALIGN(4);
ospi_nor_nor = .; /* define a global symbols at end of qspi */

} >QSPI AT> ROM

Apart from executing GpioToggle from the external memory, I also want to mount a file syste (littleFS) on it. For this reason, I want to use half of the memory for writing GpioToggle (and potentially other functions) and half of the memory for the filesystem. Is this even possible? Or are there some blocking points? Should I change the linker script in this case or should I just play with the address range in the file system configuration?

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    March 26, 2024

    Hello @Lyap94 and welcome to the Community :),

    It is possible to partition the external flash memory.

    For that; please make sure that you load the filesystem at the right address.

    Thank you.

    Kaouthar