Skip to main content
Auloedus
Associate
May 20, 2021
Solved

Would it be possible to run code that is partly written in internal flash and partly written in external flash?

  • May 20, 2021
  • 4 replies
  • 1066 views

Hi everyone!

Quick question: this is my platform.

  • STM32F4 main controller
  • external QSPI flash

I'm currently using FreeRTOS with TouchGFX so the external flash stores the graphical resources. In case I run out of memory, could I run some of the code (the "excess" code) in external memory by modifying the linker file appropriately? Obviously I'll have performance issues because I would have to fetch code from the QSPI, but would it be feasible in a theoretical way at least?

Many thanks to all! :)

This topic has been closed for replies.
Best answer by Tesla DeLorean

Yes, you can use both.

You would however need to get the external interface up and running early, and all the code dependencies and call trees that would be needed to bring up the interface would need to be in internal flash. One route would be for a small loader app to bring up the pins, clocks and interfaces first, check the integrity, and then transfer control to the app code, which could be split amongst the memories available to the processor.

4 replies

waclawek.jan
Super User
May 20, 2021

Which STM32F4?

Probably all models which support QSPI allow also code execution from it, if it's configured to memory mapped mode, but you can confirm this by reading the QUAD-SPI chapter in your model's datasheet.

JW

Auloedus
AuloedusAuthor
Associate
May 20, 2021

Thanks waclawek.jan!

The involved P/N is the STM32F469.

I've already written the driver for the external QSPI flash memory and I use it for TouchGFX's graphical resources.

Just to be sure that I've explained myself well and that we're on the same page: my intention would be to extend the code "beyond" the internal flash memory, so to use both the internal and the esternal QSPI for the code segments, simultaneously.

Thanks a lot! :)

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
May 20, 2021

Yes, you can use both.

You would however need to get the external interface up and running early, and all the code dependencies and call trees that would be needed to bring up the interface would need to be in internal flash. One route would be for a small loader app to bring up the pins, clocks and interfaces first, check the integrity, and then transfer control to the app code, which could be split amongst the memories available to the processor.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Auloedus
AuloedusAuthor
Associate
May 20, 2021

Thank you very much Tesla DeLorean and waclawek.jan!

Have a nice day!