cancel
Showing results for 
Search instead for 
Did you mean: 

How to use External Loader to load initialised data into NOR Flash on Octo-SPI interface on STM32L552E-EV

SSadi.1
Associate

Hi all,

I'm working on an STM32L552E-EV and trying to declare some constant data into the NOR Flash connected on the Octo-SPI interface. I want to have the Octo-SPI in memory-mapped, so that the constant arrays can be accessed easily in my code. To initialise the memory with the constant data I'm trying to use the available External Loader in CubeIDE, but the data doesn't get loaded.

My starting point was the 'OSPI_NOR_MemoryMapped' project available in the STM32L552E-EV examples. This example runs perfectly.

In order to load the data via the external loader i've made the following changes to the example

  1. added 'OSPI' memory and '.ospi_data' section (linker file attached)
  2. Select external loader 'MX25LM51245G_STM32L552E-EVAL, 0x90000000, NOR_FLASH, MX25LM51245G_STM32L552E-EVAL.stldr' in launch config properties.
  3. Added data array stored in 'ospi_data' section
  4. Commented out code segments in example to erase memory, and write and read from memory.

I've attached the linker file and modified 'main.c' file from the example.

I've done the same with the STM32F746-DISCO with NOR Flash on QSPI and an external loader and that works perfectly, but struggling to get this to work. Any help would be appreciated!

Thanks,

1 REPLY 1

I'd probably add the section prior to the DISCARD one, and have the data as a static const, it clearly isn't going to be volatile

Check the actual placement of the data by reviewing the .MAP file

Check then if the data at 0x90000000 is actually being written by the External Loader.

Try using STM32 Cube Programmer if you're using something else currently.

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