Skip to main content
Associate II
December 28, 2023
Solved

How to use external SDRAM as dynamic data memory in M4 core in STM32H747I-DISCO board?

  • December 28, 2023
  • 2 replies
  • 3487 views

Hi community,

I am using STM32H747I-DISCO board and I configured external SDRAM as dynamic data memory in M7 core by  calling the SystemInit_ExtMemCtl() function in  SystemInit() function, it is working fine but when I tried with the M4 SystemInit_ExtMemCtl() function call is only defined for M7 core in SystemInit() function. Please someone suggest is it possible to use external SDRAM as dynamic data memory in M4 core?

 

Best answer by mƎALLEm

Hello,

Yes, indeed you can. Enable DATA_IN_ExtSDRAM flag to activate the SDRAM config section in system_stm32h7xx.c

and you need to edit your linker file to let the SDRAM the location of code execution.

You can inspire from the AN4891 "STM32H72x, STM32H73x, and single-core STM32H74x/75x system architecture and performance" / x-cube-perf-h7

See the configuration "10 - D1_SDRAM_Swapped - D1_DTCM" in the project: code execution from SDRAM and data located in DTCM.

2 replies

TDK
December 28, 2023

Both cores can use the SDRAM once it is initialized. If you want initialization to be done on the M4 core, assign it to that core within CubeMX.

TDK_0-1703771945791.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate II
December 29, 2023

I tried with this method its working fine. But I want to use external SDRAM as program data memory for M4, I tried for M7 core to use as program data memory by initializing the SDRAM in SystemInit() function. But for M4 core it is not working. Is it possible to use external SDRAM as program data memory for M4 core?

TDK
December 29, 2023

> Is it possible to use external SDRAM as program data memory for M4 core?

Yes, it's possible.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru
January 23, 2024

But WHY?

This is going to be memory with the highest latency, slowest access, and is not cached as the M4 has no model for that.

Where possible use SRAM, ideally the stuff situated closest to the core that's going to be using it.

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