cancel
Showing results for 
Search instead for 
Did you mean: 

How to use internal flash as frame buffer?

HAhan.1
Associate II

I'm working a smart thermostat using STM32 and TouchGFX. So far I managed to implement major parts of my UI on a STM32F429-DISCO board. Now I'm trying to migrate to my custom board, which works differently from the discovery board mainly in 2 areas:

1) I want to internal flash for frame buffer

2) I want to use FSMC as my LCD controller

Since I couldn't find any documentation on how to implement these on TouchGFX framework (especially the first one), I don't have any clue where to begin.

So, can anyone please help me?

Best regards,

Hamid Ahangari

1 ACCEPTED SOLUTION

Accepted Solutions
Jagdish Bisawa
Associate III

Hi @HAhan.1​ ,

1) I took an overview of the the application note referred by you & I understand that it demonstrates the usage of the FSMC as a LCD controller, using the internal flash or external memory devices as holders for the image to be displayed/animated. In case there is a requirement of only displaying pre-loaded bitmaps/images on an LCD display, then such an arrangement could work good.

My earlier comments were in the context of a situation where you have multiple screens & each screen has a number of widgets/containers. In such a scenario, one has to make use of the SRAM/SDRAM, since the changing of screens & the animations of widgets requires writing(rendering) to the memory, at run time. The flash memory will not work out to be a good choice in this situation. Whenever there is an event ( say a user press on the a widget like button ), there is rendering that take place & the widget is redrawn. TO appear the redrawing seamless ( pleasant to the eye ), it has to be done as fast as possible. This is where the SRAM/SDRAM is useful over the flash memory. Further, SRAM/SDRAM has virtually lifelong capability to be written to, as compared to the flash memory.

2) As regards using the FSMC as an LCD controller for TouchGFX, there is no documentation, as I can see in the resources. May be a search in tis forum or the internet can lead to to some results. I have not come across such a situation myself, so not able to comment beyond this.

/Jagdish Bisawa

View solution in original post

5 REPLIES 5
Jagdish Bisawa
Associate III

Hi @HAhan.1​ ,

1) Using the internal flash as a frame buffer might not be a good idea. A frame buffer is frequently written to & read from, as a part of the process that requires updating the pixels of the display glass. Whereas reading frequently is okay, writing frequently to the internal flash is not good.

Further, the internal flash is slow & hence any read/write operation will be much slower than that of the internal SRAM or an external SDRAM. This will have an adverse effect on the display refreshing.

2) Using the FSMC as an LCD controller requires replacing the Touch GFX controller driver. May be you want to do it since the chip you want to use does not have the LCD controller on chip. This calls for writing your own controller driver.

\Jagdish Bisawa

Hi @Jagdish Bisawa​ 

1) Actually ST released an application note on that matter (AN2790 - TFT LCD interfacing with the high-density STM32F10xxx FSMC), which compares the speed of different components when used as frame buffer memory. From the app note, internal flash with dma is the fastest second to the internal SRAM.

Further, I don't know what you mean by "writing frequently to the internal flash is not good", define "not good"

2) Of course I have to write my own driver for FSMC. I was asking for some guidelines on where to begin, since I couldn't find any documentation on TouchGFX

Best regards,

Hamid Ahangari

Jagdish Bisawa
Associate III

Hi @HAhan.1​ ,

1) I took an overview of the the application note referred by you & I understand that it demonstrates the usage of the FSMC as a LCD controller, using the internal flash or external memory devices as holders for the image to be displayed/animated. In case there is a requirement of only displaying pre-loaded bitmaps/images on an LCD display, then such an arrangement could work good.

My earlier comments were in the context of a situation where you have multiple screens & each screen has a number of widgets/containers. In such a scenario, one has to make use of the SRAM/SDRAM, since the changing of screens & the animations of widgets requires writing(rendering) to the memory, at run time. The flash memory will not work out to be a good choice in this situation. Whenever there is an event ( say a user press on the a widget like button ), there is rendering that take place & the widget is redrawn. TO appear the redrawing seamless ( pleasant to the eye ), it has to be done as fast as possible. This is where the SRAM/SDRAM is useful over the flash memory. Further, SRAM/SDRAM has virtually lifelong capability to be written to, as compared to the flash memory.

2) As regards using the FSMC as an LCD controller for TouchGFX, there is no documentation, as I can see in the resources. May be a search in tis forum or the internet can lead to to some results. I have not come across such a situation myself, so not able to comment beyond this.

/Jagdish Bisawa

Hi @Jagdish Bisawa​ 

Thank you for your time. Your comments actually helped a lot. So, I have to use an external SRAM or internal SRAM with partial buffer.

As for FSMC, I will deep further into the TouchGFX firmware to find a solution.

Best regards,

Hamid Ahangari

Jagdish Bisawa
Associate III

Hi @HAhan.1​ ,

Glad that the comments helped.

Whereas you might deep dive, understand & implement the FSMC as a LCD controller, be aware that you might loose on the advantages offered by the built-in LCD controller on the STM32 chips. This piece of hardware, also known as the DMA2D (DMA to display ) is also a hardware accelerator, which makes the rendering to the display smooth & intuitive. Not using such a hardware accelerator can have it's pitfalls.

However, if the application is not too demanding on rich (mobile phone like ) graphics, then you could go your planned way.

/Jagdish Bisawa