Skip to main content
EAbu
Associate
November 13, 2019
Solved

How to change the linker file for STM32H743 to support using the whole 1 MB of RAM for the code execution?

  • November 13, 2019
  • 3 replies
  • 1300 views

Here is the content of stm32h743xx_flash.icf:

define symbol __ICFEDIT_region_ROM_start__   = 0x08000000;

define symbol __ICFEDIT_region_ROM_end__    = 0x081FFFFF;

define symbol __ICFEDIT_region_RAM_start__   = 0x20000000;

define symbol __ICFEDIT_region_RAM_end__    = 0x2001FFFF;

define symbol __ICFEDIT_region_ITCMRAM_start__ = 0x00000000;

define symbol __ICFEDIT_region_ITCMRAM_end__  = 0x0000FFFF;

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

You'll need to describe the multiple regions, associate each with a section, and then use the attribute directive in the compiler to direct specific use by static variable allocation. Your code in startup.s would also need to expand to handle multiple sections.

​

If you want to allocate dynamically you would need to implement a more complex allocator (_sbrk) to understand the multiple pools the heap can draw from initially.​

3 replies

waclawek.jan
Super User
November 13, 2019

The SRAM memories are not located as a continuous block. That's a fixed mapping, you can't change it by changing the linker file which just describes the status quo.

0690X00000Arxw0QAB.png

JW

EAbu
EAbuAuthor
Associate
November 13, 2019

Yes, I saw that, and I didn't understand how can I use the whole RAM for executing my code.

Currently, I'm Having a problem while executing my code, I keep getting "memory allocation error" because there is no place in the RAM.

My system is very complicated and big, that needs a large size of RAM, that's why we chose STMH7 because it has 1 MB of RAM.

I need a way to instruct the complier to use a larger size of RAM.

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
November 13, 2019

You'll need to describe the multiple regions, associate each with a section, and then use the attribute directive in the compiler to direct specific use by static variable allocation. Your code in startup.s would also need to expand to handle multiple sections.

​

If you want to allocate dynamically you would need to implement a more complex allocator (_sbrk) to understand the multiple pools the heap can draw from initially.​

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