Skip to main content
Senior
February 6, 2026
Solved

Interface External SRAM to extend Internal RAM at runtime

  • February 6, 2026
  • 1 reply
  • 182 views

Hello,

Using controller: STM32F767BIT6

External SRAM: SRAM-1x16M-48TSOPI

Interface SRAM via FMC is successful, currently using heap_4 and tried to work with moving variables & complete heap to external SRAM and it works.

But I want to use external RAM as extended RAM if internal RAM get exhaust.

I have seen some examples in Keil which allow to do the same by using .ANY

.ANY (+RW +ZI)

 So, this will allow to use runtime RAM if it is free, so just for thoughts, if I define .ANY in internal and external RAM then in runtime it will decide where to go based the available size.

But in STM32CubeIde, not sure how it can be done.

So, I need help or examples to understand how we can actually use external SRAM as extended RAM.

Thanks,

Nitin

Best answer by waclawek.jan

CubeIDE uses gcc and AFAIK there's no such automatic rearrangement of variables location in gcc, so you'd need to allocate "excessive" variables to the external RAM manually.

JW

1 reply

waclawek.jan
waclawek.janBest answer
Super User
February 6, 2026

CubeIDE uses gcc and AFAIK there's no such automatic rearrangement of variables location in gcc, so you'd need to allocate "excessive" variables to the external RAM manually.

JW