STM32 DSI Host and tearing effects in video mode
- June 18, 2018
- 2 replies
- 1493 views
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