cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 DSI Host and tearing effects in video mode

Eetu Piukkula
Associate III
Posted on June 18, 2018 at 21:22

Hi,

So I have an issue with DSI tearing. Heres some background. I am using external SDRAM to hold framebuffers. I use double buffer method. Area is rather small at 180*400(*3). Back frame holds simple running number generated with for-loops and whole frame is stored inside SDRAM, back frame is copied to the front frame where LTDC layer points at. Also front frame is held in SDRAM.

I can write and copy the whole cycle successfully. Problem occurs every time something is moved inside SDRAM --> tearing. There is some sort of interrupt solution, but I have no clue how to implement that. I am not too familiar with DSI interrupts or interrupts in general. If I forcefully run HAL_DSI_Stop, do some SDRAM data transfers and then HAL_DSI_Start I no longer see tearing but since stopping whole DSI is quite violent there are some stutter. Therefore it is safe to say that BW of SDRAM is enough.

How do I implement this with interrupts. Heres code snippet and small video. Video is with Start/Stop hack.

// While True

HAL_DSI_Stop(&hdsi);

write_rpm(currentrpm, prevrpm); // Generating font with for-loops to back frame

HAL_DMA2D_Start_IT(&hdma2d, addrL0Back, addrL0Front, 180,400);   //DMA2D copy

HAL_DMA2D_PollForTransfer(&hdma2d, 100);

HAL_DSI_Start(&hdsi);

//Stuff

Big thanks beforehand

--Eetu

3 REPLIES 3
T J
Lead
Posted on June 18, 2018 at 21:32

I am sorry that I have never worked with the DSI, so I cannot help further but the concept is:

usually with Video systems, you can do some work in the blanking period.

the blanking period usually starts at the back porch and includes the front porch.

Generally with LCDs however, the Blanking time is very short.

so, enable the 'frame complete' interrupt, and work in that time, be sure to be out within the specified time, or you will get tearing.

Posted on June 18, 2018 at 23:50

What part are we talking about? Standard board/screen or custom?

The HAL libraries have examples for an assortment of boards, with configuration of LTDC and DSI. You might need to review these and cull them for details and use cases.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 19, 2018 at 09:33

Screen is Ortustech's Blanview MIPI display (

https://drive.google.com/open?id=1dhV63t3RHmN_dCihiGVoG5oTsKSddYxW

 ), MCU is STM32F769xxx and PCB is custom. Yes, I have looked to BSP drivers and example projects (mostly STM32F769xxx Discovery double buffer w/ video mode) but can't get my head around it.