cancel
Showing results for 
Search instead for 
Did you mean: 

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

EAbu
Associate

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;

1 ACCEPTED SOLUTION

Accepted Solutions

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
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3

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

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.

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
Up vote any posts that you find helpful, it shows what's working..