How to enable compiler/linker to manage external memory?
I've managed to get the SDRAM up and running on my STM32H745 Disco board. I've confirmed this by using
uint32_t* sdram = (uint32_t*) 0xD0000000;
sdram[0] = 0xDEADBEEF;and checking the memory content. However, doing it this way, I have to control the address space myself.
Instead I want the linker to assign the address space automatically. I've made sure the linker script is set up properly as explained in the document linked here. The Build Analyzer confirms the correct assignment. However, As soon as I use code like this
// This part is declared globally
__attribute__((section(".sdram"))) uint32_t sdram[1000];
// This is in main()
sdram[0] = 0xDEADBEEF;I get the dreaded
Note that I've declared the variable as global because if I try to declare it locally inside main() just before the assignment of DEADBEEF to sdram[0], the compiler barfs.
How do I get the linker to recognize the definition of the variable sdram and have it memory managed?
