cancel
Showing results for 
Search instead for 
Did you mean: 

How to solve this ( region `RAM' overflowed by 1168976 bytes ) error.

Vins
Senior

Hi Community,

When I use the Touch GFX from software packs in STM32CubeIDE and generate the project, I am getting the following errors. So, anyone is having idea how to solve this?

1) region `RAM' overflowed by 1168976 bytes.

2) touchgfx_ide_new.elf section `Video_RGB_Buffer' will not fit in region `RAM'.

Thank you.

Vins.

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

Hi guys,

It's correct that the code generated by 4.19.1 Generator (through CubeMX/CubeIDE) now has instrumentation that allows you to place the buffers where you want to (by making appropriate modifications in your linker script). So, if you're using an older version you'll have to make modifications to the generated code (which would get overwritten upon next code generation from CubeMX). Here's the change:

LOCATION_PRAGMA("Video_RGB_Buffer")
uint32_t videoRGBBuffer[...calculated size...] LOCATION_ATTRIBUTE("Video_RGB_Buffer");

As such, if you're just using CubeMX/CubeIDE to create a custom project, you will not have a linker script for your board that has any reference to the Video Buffer (You can get inspiration from one of our board packs through the designer that supports video).

You should be able to find some information here about the matter:

Video Decoding | TouchGFX Documentation

Here's an example of how to place the buffer in SDRAM for CubeIDE. In this example, the SDRAM region (@ 0xC00FF000) has been defined after the framebuffer which is not allocated, but referenced by address (start of SDRAM @ 0xC0000000).

MEMORY
{
  ...
  SDRAM      (xrw)    : ORIGIN = 0xC00FF000,   LENGTH = 8M
}
 
BufferSection :
{
  *(Video_RGB_Buffer Video_RGB_Buffer.*)
  *(.gnu.linkonce.r.*)
  . = ALIGN(0x4);
} >SDRAM

And here's the .map file for the above configuration:

BufferSection   0x00000000c00ff000    0x1c200
 *(Video_RGB_Buffer Video_RGB_Buffer.*)
 Video_RGB_Buffer
                0x00000000c00ff000    0x1c200 Application/User/TouchGFX/target/generated/TouchGFXGeneratedHAL.o
                0x00000000c00ff000                videoRGBBuffer

Further Improvement in next version:

The next version of TouchGFX will support a new configuration for MDK-ARM compilers that might otherwise try to write zeros to the Video buffer SDRAM region before it's initialized, causing a crash.

/Martin

View solution in original post

4 REPLIES 4
TDK
Guru

You can't use more RAM than you have. That should be straightforward.

Put the buffer into external RAM if available on the hardware.

If you feel a post has answered your question, please click "Accept as Solution".
SofLit
ST Employee

Hello,

Please use TouchGFX v4.19.1. It relocates video buffer in SDRAM.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

@Community member​ Hi, I am directly not using v4.19.1 designer. I am using STM32CubeIDE in this activating Touch GFX v4.19.1 designer. Getting the same error.

Martin KJELDSEN
Chief III

Hi guys,

It's correct that the code generated by 4.19.1 Generator (through CubeMX/CubeIDE) now has instrumentation that allows you to place the buffers where you want to (by making appropriate modifications in your linker script). So, if you're using an older version you'll have to make modifications to the generated code (which would get overwritten upon next code generation from CubeMX). Here's the change:

LOCATION_PRAGMA("Video_RGB_Buffer")
uint32_t videoRGBBuffer[...calculated size...] LOCATION_ATTRIBUTE("Video_RGB_Buffer");

As such, if you're just using CubeMX/CubeIDE to create a custom project, you will not have a linker script for your board that has any reference to the Video Buffer (You can get inspiration from one of our board packs through the designer that supports video).

You should be able to find some information here about the matter:

Video Decoding | TouchGFX Documentation

Here's an example of how to place the buffer in SDRAM for CubeIDE. In this example, the SDRAM region (@ 0xC00FF000) has been defined after the framebuffer which is not allocated, but referenced by address (start of SDRAM @ 0xC0000000).

MEMORY
{
  ...
  SDRAM      (xrw)    : ORIGIN = 0xC00FF000,   LENGTH = 8M
}
 
BufferSection :
{
  *(Video_RGB_Buffer Video_RGB_Buffer.*)
  *(.gnu.linkonce.r.*)
  . = ALIGN(0x4);
} >SDRAM

And here's the .map file for the above configuration:

BufferSection   0x00000000c00ff000    0x1c200
 *(Video_RGB_Buffer Video_RGB_Buffer.*)
 Video_RGB_Buffer
                0x00000000c00ff000    0x1c200 Application/User/TouchGFX/target/generated/TouchGFXGeneratedHAL.o
                0x00000000c00ff000                videoRGBBuffer

Further Improvement in next version:

The next version of TouchGFX will support a new configuration for MDK-ARM compilers that might otherwise try to write zeros to the Video buffer SDRAM region before it's initialized, causing a crash.

/Martin