cancel
Showing results for 
Search instead for 
Did you mean: 

How can I set extra RAM and Flash for TFT LCD display project?

stefyanna
Associate II

Hi,

I'm working on a project where I should display some parameters on display. The display resolution is 800 x 480. I followed some tutorials to how to set touchGFX on MXCube and then imported on Cube Ide the project. The problem is that when I compile the project it keeps me saying that the both RAM and Flash overflows, as you can see in listing below:

c:\st\stm32cubeide_1.12.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.200.202301161003\tools\arm-none-eabi\bin\ld.exe: test1.elf section `TouchGFX_Framebuffer' will not fit in region `RAM'
c:\st\stm32cubeide_1.12.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.200.202301161003\tools\arm-none-eabi\bin\ld.exe: test1.elf section `TouchGFX_Framebuffer' will not fit in region `FLASH'
c:\st\stm32cubeide_1.12.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.200.202301161003\tools\arm-none-eabi\bin\ld.exe: region `RAM' overflowed by 447656 bytes
c:\st\stm32cubeide_1.12.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.10.3-2021.10.win32_1.0.200.202301161003\tools\arm-none-eabi\bin\ld.exe: region `FLASH' overflowed by 595640 bytes
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:90: test1.elf] Error 1

I set the SDRAM and DMA2D, but is not working. I don't plan to use freertos.

Here are some screenshot of the settings of the project:

0693W00000bhTkgQAE.png0693W00000bhTl5QAE.png0693W00000bhTlFQAU.png0693W00000bhTltQAE.pngThe MCU that I'm using is STM32F746ZG.

The display that I'm using is the MIKROE-3620.

What can I do to resolve the overflowing problem?

6 REPLIES 6
JTP1
Lead

Hello

Set the Buffer location to 'By address' insted of 'By allocation'. And then set address where you want to place the frambuffer to the Start address (typically SDRAM1 starts from 0xC0000000).

Maybe this touchGFX documentation is worth reading: Display with framebuffer in external RAM

Also other 'Board bring up' chapters might be helpful.

JThom.13
Associate II

The error message you are seeing indicates that your TouchGFX project is using more RAM and Flash memory than your STM32F746ZG microcontroller has available. To resolve this issue, you can try the following:

  1. Increase the amount of RAM and Flash memory available to your project. The STM32F746ZG has 320 KB of RAM and 1 MB of Flash memory by default, but you may be able to increase these values by adding external memory to your project. You can refer to the datasheet of your specific board to see if it supports external memory expansion, and how to configure it.
  2. Reduce the memory usage of your TouchGFX project. There are several ways to reduce the memory usage of your project, such as:
  3. a. Reduce the resolution of your display. 800 x 480 is a relatively high resolution, and reducing it to a lower resolution can significantly reduce the amount of memory your project requires.
  4. b. Reduce the number of colors used by your project. Using fewer colors can reduce the amount of memory required to store the display buffer.
  5. c. Use compressed images and fonts. TouchGFX supports compressed images and fonts, which can significantly reduce their memory usage.
  6. Optimize your code. There may be opportunities to optimize your code to reduce its memory usage. You can try using a profiler tool to identify parts of your code that are using the most memory, and then optimize them.
  7. Use a different microcontroller or development board with more memory. If none of the above solutions work, you may need to switch to a different microcontroller or development board that has more RAM and Flash memory available.

In your specific case, since you have already tried to set up the SDRAM and DMA2D, but it did not work, I would suggest that you consider reducing the display resolution and number of colors used in your project, and using compressed images and fonts to reduce the memory usage. Additionally, you can try optimizing your code to further reduce its memory usage.

I hope it would be helpful😊

Thanks a lot. It has definetly helped to set the buffer location "by address". Now when I compile, it does show no more errors.

I already read the TouchGFX docuentation and followed their step to set up SDRAM and DMA2D, but I was stuck at the overflowing problem.

stefyanna
Associate II

When I encounter the overflow problem the first that came in mind was to lower the resolution, but I needed to lower up to 300x300 from 800x480. It was such a pity to ave such a great of resolution loss...

So then I tried to increase the RAM and Flash.

By the way, thanks for te advice to use compressed image and font, but how can I set this features. Is it done directly from TouchGFX software? Is there any documentation?

Regarding the number of color, right now I chose RGB565. Should I chose instead RGB888, ARGB1555 or ARGB4444. It is not clea the difference between the color formats... Any help?

When I encounter the overflow problem the first that came in mind was to lower the resolution, but I needed to lower up to 300x300 from 800x480. It was such a pity to ave such a great of resolution loss...

So then I tried to increase the RAM and Flash.

By the way, thanks for te advice to use compressed image and font, but how can I set this features. Is it done directly from TouchGFX software? Is there any documentation?

Regarding the number of color, right now I chose RGB565. Should I chose instead RGB888, ARGB1555 or ARGB4444. It is not clea the difference between the color formats... Any help?

MM..1
Chief II

MIKROE ??? Have you real SDRAM chips on your board. SDRAM isnt somthing to turn on...