cancel
Showing results for 
Search instead for 
Did you mean: 

Problem when DMA2D is activated.

AKG
Associate III

Hi,

I am trying to activate DMA2D in my display. We are using an STM32F7 processor. I have few questions regarding this.

Current situation:

As soon I activated the DMA2D, I started observing glitters in text rendering. I thought it has something to do with invalidating cache and I added the line SCB_CleanInvalidateDCache(); at the beginning of function void STM32F7DMA::start().

This resolved the text rendering problem. But on stressing the display (by continuously sliding on the slider widget) after around 40seconds, the screen would freeze. There is no recovery after. The display restarts.

I guessed this has to do something with simultaneous DMA and TFT accesses to SDRAM, therefore I set the hal.lockDMAToFrontPorch to true.

After doing this, there was no screen freeze or text rendering problem.

I have the following questions based on the above situation:

1) While I had text rendering problem, hal.lockDMAToFrontPorch was set to false and on stress testing there was no screen freeze.

I also didn't find any instance of SCB_CleanInvalidateDCache() in the project except the one I added. So, I somehow feel that adding this line to solve text rendering problem introduced screen freeze.

Hence, is my fix of invalidating cache to solve text rendering problem correct ?

2) If invalidating cache is necessary then is there any way to fix screen freeze other than setting the hal.lockDMAToFrontPorch to true ?

Any inputs related to this will be very helpful.

2 REPLIES 2
Alexandre RENOUX
Principal

Hello @AKG​ ,

Indeed SCB_CLeanInvalidateDCache() is the solution of your text problem. This is strange because this is supposed to be generated automatically in TouchGFXHAL.cpp and STM32DMA.cpp. The lines might be commented but if you do a search and uncomment them this should work. Have you looked at the Application Template for F746G-DISCO available on TouchGFX Designer ? You can see clearly how it is implemented in this project.

Also make sure your MPU settings are correctly set. You can refer to F750-DISCO Application Template also for this.

What version of TouchGFX and CubeMX are you using ? Are you using single Framebuffer our double framebuffer ? And last but not least, what's your display interface (LTDC? SPI? FMC? DSI?) ?

/Alexandre

AKG
Associate III

Hi @Alexandre RENOUX​ ,

Thank you very much for your response. Let me provide you more details about our hardware.

We are using a F746G starter kit provided by our supplier EDT. The hardware by default was running on touchgfx version 4.9..3. It was quite a long time ago.

By default the files STM32F7DMA.cpp and STM32F7HAL.cpp contained few SCB_CLeanInvalidateDCache().

Gradually we updated the touchgfx to newer versions but the files STM32F7DMA.cpp and STM32F7HAL.cpp were never changed.

the default internal flash was less for us. So we internally changed the microcontroller to F767 to have 2MB internal flash.

Later on, our hardware suppliers provided us new STM32F7DMA.cpp and STM32F7HAL.cpp files to support the new MCU.

In the new files, there was never a single instance of SCB_CLeanInvalidateDCache(). So I was bit confused.

Now to answer your question:

currently we have F746G disco board with F767 chip with new STM32F7DMA.cpp and STM32F7HAL.cpp files. The touchgfx version running is 4.16.0.

and our display interface is LTDC. We have double framebuffer activated.

If necessary, I could share you the new STM32F7DMA.cpp and STM32F7HAL.cpp files.

somehow looks like DMA2D is having some problem. I am just wondering if DMA2D had some configuration issues then it would have never worked at all.

I just get screen freeze only when I stress the device by making too many draws.

Please provide your inputs. or let me know if you need anything more.