2019-04-01 01:17 AM
Hi,
In my system I have 2 devices connected over CAN bus (one on F746, second on F205), and F746 runs a TouchGFX application (800x600x16bpp) with 2 lightweight screens; FreeRTOS and SysTick configured to 100Hz. My problem is that image on screen may suddenly trembling (moves <-->), if CAN bus connected. If I disconnect second device trembling will stop. If I increase size of data transfer over CAN bus then screen picture trembling will increase. Sometimes only the random horizontal part of the screen shakes. The time during which the band is offset is approximately 1 frame or 17-20 ms. I watched LTDC rgb gpio outputs, and noticed that they changes too, so its not a synch lost. I think this is due to interruption priority (CAN and DMA2D/LTDC), but changing priority doesnt make an effect.
2019-04-02 12:18 AM
Hi @itxs,
What happens after you receive your data over CAN? Are you writing to the same memory the framebuffer is located? Now, it looks like your application is fairly simple currently, but you may have a lot of actors accessing the memory. DMA2D, LTDC, CAN. Maybe you're having memory contention issues. What is your VSYNC currently? Can you try slowing down your application by adjusting the porch areas a bit to see if that helps?
You can also try to set hal.lockDMAToFrontPorch(true) in the boardconfiguration to ease the pressure to start with to see if that helps.
2019-04-02 05:08 AM
Thanks for answer. lockDMAToFrontPorch(true) changes nothing, i tried this yesterday.
After receiving CAN data writes to SRAM buffers (not DRAM where videobuffer is located). This data viewed by my application protocol over CAN which manager I put to a separate FreeRTOS task.
TouchGFX task have priority tskIDLE_PRIORITY + 3
CAN application protocol have priority tskIDLE_PRIORITY + 2
I tried to change front porch, but picture on screen moved to right. Also i turn on setFrameRateCompensation to normalize animation timings, it doesnt not affect screen shake.
VSYNC GPIO:
VSYNC frequency is 62.7 Hz
2019-05-13 01:43 AM
I discovered that turning large Model class members into global variables can reduce or even get rid of screen shake. Anyone knows how Model class size affects screen shake or speed?
2019-05-13 02:17 AM
Hi @itxs,
I don't see how the size of the model should matter to run time performance. Do you have a video of this screen shake?
2019-05-21 04:24 AM
Any update on this @itxs ?
2019-05-22 02:55 AM
I found that this problem depends of how many time the CPU must give to non-graphic work. I refactored and optimized whole project and shaking disappear. In addition to my words that "turning large Model class members into global variables can reduce or even get rid of screen shake" I think that cpu takes more time to get access to Model class data than if that data was global variable. CAN events also consumes a lot of CPU cycles.
2019-05-22 03:55 AM
Okay, so i guess that's good news? Any issues left?
/Martin
2019-05-22 04:03 AM
I want to know is I right that cpu takes more time to get access to Model class data than if that data was global variable? If right, then why?