Showing results for 
Search instead for 
Did you mean: 

SRAM1_text overflow


I am trying to port a FW which was running on STM32H7 controller to F4 core of STM32MP157.
I get this errors
CM4.elf section `.text' will not fit in region `SRAM1_text' CM4 C/C++ Problem
make: *** [makefile:68: CM4.elf] Error 1 CM4 C/C++ Problem
region `SRAM1_text' overflowed by 1073768 bytes CM4 C/C++ Problem
region SRAM1_text overflowed with text and data CM4 C/C++ Problem
section .data VMA [0000000010020000,0000000010020327] overlaps section .text VMA [0000000010000000,0000000010124003] CM4 C/C++ Problem

How to over come this problem, is it possible to change the allocated RAM for M4 code?


Was the STM32H7 2MB RAM? It seems that the STM32MP157 supports a lot of external memory.

The STM32MP157A/D devices incorporate high-speed embedded memories with 708 Kbytes of Internal SRAM (including 256 Kbytes of AXI SYSRAM, 3 banks of 128 Kbytes each of AHB SRAM, 64 Kbytes of AHB SRAM in backup domain and 4 Kbytes of SRAM in backup domain), as well as an extensive range of enhanced I/Os and peripherals connected to APB buses, AHB buses, a 32-bit multi-AHB bus matrix and a 64-bit multi layer AXI interconnect supporting internal and external memories access.

The STM32MP157A/D devices provide an external SDRAM interface supporting external memories up to 8-Gbit density (1 Gbyte), 16 or 32-bit LPDDR2/LPDDR3 or DDR3/DDR3L up to 533 MHz.

Code should reside in SRAMs/RETRAM as Cortex-M4 performance execution penalty for running code from external memory will be extremely high (has there is no caches and bus paths are not optimized for that).

The STM32H7 has 2MB Flash.
The A7 core copy the M4 elf. file from internal flash to the M4 RAM. 
So I need to have a M4 RAM to accommodate the H7 flash image.

As you explained the max available Internal RAM for M4 is 708KB so I should reduce my flash image size.

Now the question, can I have more than M4 image stored in A7 flash and  load the reqired one to M4 RAM and switch between them ?